This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function tf_filter_gutenberg_post_types( $args, $post_type ) { | |
// Return early - we're not registering the right CPT | |
if ( 'whitepaper' !== $post_type ) { | |
return $args; | |
} | |
// Only enable the REST API for users with edit permissions, otherwise | |
// explicitly disable it. This prevents other users having access to |