• Resolved mrickan

    (@mrickan)


    This question likely falls more into the general realm of WP but since I’m experimenting with CPT UI I figured I would seek advice in this forum. Please excuse me if this is a typical noob type of inquiry:

    My theme includes a meta box that provides formatting options and a number of plug-ins I use include their own meta boxes. I would like to derive custom posts that include some of these meta boxes based on their relevance to the particular custom post type.

    I know that I can associate post types when meta boxes are originally created but modifying my theme and plug-in code is going to introduce maintenance issues.

    Is there a way to derive a custom post from an existing post or to include a meta box in a custom post if it was originally assigned to a general post type?

    http://wordpress.org/plugins/custom-post-type-ui/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Sadly I can’t think of any way to do this cleanly, unless whatever is adding them for your current setup has filters around the post type parameter before registering.

    Thread Starter mrickan

    (@mrickan)

    I discovered a snippet that allows individual meta boxes included with the theme that I’m currently working with (Sahifa) to be added to custom posts:

    add_action("admin_init", "mycustom_posts_init");
    function mycustom_posts_init(){
        add_meta_box("tie_post_options", theme_name ." - Post Options", "tie_post_options_module", "news", "normal", "high");
    }

    With the known ID and callback this is straightforward enough. By iterating through an array this could also be generalized for multiple post types.

    Hopefully this will be prove to be helpful to others.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Including meta boxes in custom posts’ is closed to new replies.