Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

enable gutenberg for template

add_filter( 'use_block_editor_for_post', 'my_disable_gutenberg', 10, 2 );

function my_disable_gutenberg( $can_edit, $post ) {
  if( $post->post_type == 'page' &&
    get_page_template_slug( $post->ID ) == 'page-gutenberg.php' ) {
    return true;
  }

  return false;
}
Source by silvawebdesigns.com #
 
PREVIOUS NEXT
Tagged: #enable #gutenberg #template
ADD COMMENT
Topic
Name
9+4 =