Skip to content

Instantly share code, notes, and snippets.

@nathaningram
Created February 7, 2023 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathaningram/2a256edb0702d23e32cccf5cc133b725 to your computer and use it in GitHub Desktop.
Save nathaningram/2a256edb0702d23e32cccf5cc133b725 to your computer and use it in GitHub Desktop.
Convert to Block Support Per Post Type
// Adds Convert to Block Support Per Post Type
// Used along with Convert to Blocks plugin by 10up
// https://wordpress.org/plugins/convert-to-blocks/
add_filter( 'post_type_supports_convert_to_blocks', function( $supports, $post_type ) {
if ( $post_type === 'YOUR_CPT_SLUG_HERE' ) {
return true;
}
return $supports;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment