Skip to content

Snippet: Include or Exclude Gallery Metabox from Post Types

function my_gallery_metabox_post_types( $types ) {

	// Add to portfolio
    $types[] = 'portfolio';

    // Remove from staff
    unset( $types['staff' ] );

    // Return types
    return $types;

add_filter( 'wpex_gallery_metabox_post_types', 'my_gallery_metabox_post_types', 99 );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top