Skip to content
Site Under Re-Design: We're updating & improving the docs! Some layouts or content may look broken or inconsistent during this process. If you’re unable to find an article, please use the search bar while we restructure and optimize the sidebar navigation.

Enable the “Media” Post Settings For Custom Post Types

Instead of using this snippet, we highly recommend using our Post Types Unlimited plugin to register you custom post types which has all the options you need including the ability to enable the Media tab for your post type.

// Must enable the theme settings metabox for your CPT.
add_filter( 'wpex_main_metaboxes_post_types', function( $types ) {
  $types[] = 'my_custom_type';
  return $types;
}, 20 );

// Enable the "Media" post settings tab for custom post types
add_filter( 'wpex_metabox_array', function( $array ) {
    $array['media']['post_type'][] = 'my_custom_type';
    return $array;
}, 40 );
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)
Related Snippets
Back To Top