WordPress Snippets at WPcustoms

Extend post type support for existing CPTs

if you want to extend existing custom post type support use this small function which hooks into the cpt init and add your desired meta boxes.


/**
 * Snippet Name: Extend post type support for existing CPTs
 * Snippet URL: https://wpcustoms.net/snippets/extend-post-type-support-existing-cpts/
 */
  function wpc_custom_posttype_init() {
  add_post_type_support( 'movies', array( 'page-attributes', 'comments', 'author' ) );
}
add_action('init', 'wpc_custom_posttype_init');