• I am creating a new CPT called certificates, which include PDF rendering using pdfjs-dist, So don’t need the block editor and block settings on the Gutenberg editor but I need the Gutenberg editor itself for better state management and @wordpress/components for better development.

    I want to remove these items

Viewing 1 replies (of 1 total)
  • Hello @e-lab innovations
    To remove the block editor and block settings from the Gutenberg editor for your custom post type “certificates” while retaining the Gutenberg editor for state management and utilizing @wordpress/components, add the following code to your theme’s functions.php file or a custom plugin:

    add_filter( 'use_block_editor_for_post_type', 'disable_block_editor_for_certificates', 10, 2 ); function disable_block_editor_for_certificates( $can_edit, $post_type ) { if ( $post_type === 'certificates' ) { return false; } return $can_edit; }

    This code snippet disables the block editor for the “certificates” post type, allowing you to continue using the Gutenberg editor for state management and @wordpress/components for development without the block editor interface. Adjust the post type slug (certificates) as needed.

Viewing 1 replies (of 1 total)
  • The topic ‘Gutenberg without Block Editor’ is closed to new replies.