making custom shortcodes in wordpress code example
Example 1: How to disable Gutenberg / block editor for certain post types
add_filter( 'use_block_editor_for_post_type', 'prefix_disable_gutenberg', 10, 2 );
function prefix_disable_gutenberg( $current_status, $post_type ) {
// Use your post type key instead of 'page or post'
if ( in_array( $post_type, array( 'page', 'post' ) ) ) {
return false;
}
return $current_status;
}
Example 2: how to add site logo in wordpress
function themename_custom_logo_setup() {
$defaults = array(
'height' => 100,
'width' => 400,
'flex-height' => true,
'flex-width' => true,
'header-text' => array( 'site-title', 'site-description' ),
);
add_theme_support( 'custom-logo', $defaults );
}
add_action( 'after_setup_theme', 'themename_custom_logo_setup' );