• Hello, is there a way to get this to work with the following?
    register_sub_post_type(‘mediahit’,$args,’post’);

    It seems I can’t make a post type a subordinate to post.

    Also when registering post types through register_sub_post_type, they aren’t detectable by plugins like Advanced Custom Fields. It would be awesome if we could use ACF to add fields to both the subordinate and superordinate type.

    Please let me know what you think.

    Thanks!
    Brian

    https://www.ads-software.com/extend/plugins/subordinate-post-type-helpers/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author randyhoyt

    (@randyhoyt)

    I’m not sure why it wouldn’t work with posts, but I’ll take a look. I have opened a bug for this on Github: Use ‘post’ as parent post type.

    As far as Advanced Custom Fields, my plugin calls register_post_type() like normal for the subordinate post type. It should be detectable by ACF. However, ACF won’t add custom fields to the subordinate post type lightbox that you launch from the parent post type edit screen: is that what you mean? I have opened an enhancement request on Github: Allow ACF in subordinate post type lightbox. (Please reply if that’s not the issue.)

    Thread Starter Brian Cruikshank

    (@brianbws)

    Thanks for the response! Definitely can’t get it to work with ‘post’ as parent.

    I figured out why ACF wasn’t detecting the post types: I copied the example code for groups and meetings and they had “‘public’ -> false” as an argument. Setting them to true made them show up in ACF.

    So yes, the question now is whether we can get ACF fields to show up in the subordinate post type lightbox. That would be so awesome and so much easier than coding fields by hand.

    Another small bug I noticed was setting the subordinate post type’s argument to “‘show_in_menu’ => false” resulted in it still showing in the menu (albeit subordinate). It should probably be hidden.

    This plugin has huge potential. Thanks for thinking of it!
    Brian

    Plugin Author randyhoyt

    (@randyhoyt)

    @brian, I have fixed the plugin so that ‘post’ can now be specified as the parent post type.

    Plugin Author randyhoyt

    (@randyhoyt)

    Also, I opened a new issue for the ‘show_in_menu’ item. Track it here.

    Plugin Author randyhoyt

    (@randyhoyt)

    @brian Cruikshank, I have released 0.2 to address the ‘show_in_menu’ issue. Good find!

    Thread Starter Brian Cruikshank

    (@brianbws)

    Thanks Randy!

    I think there is something amiss with the version numbering.

    The plugin page says:

    Download Version %VERSION_NUMBER%

    Plugin Author randyhoyt

    (@randyhoyt)

    Good catch! I’m working on an automated deploy script to push code from Github to Subversion over here, and I outsmarted myself. :~) The version number says 0.2 now. Thanks for your help!

    (If you upgraded to version %VERSION_NUMBER%, you may have to upgrade manually to 0.2. I’m not exactly sure how WordPress will handle versions that aren’t numbers.)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Subordinate Post Type Helpers] making subordinate to post / make post types detectable by o’ is closed to new replies.