• Resolved David

    (@kazango)


    Hey, great plugin upon initial inspection, it’s nice and clean, free of bloat, and ideal for my users. Something that’s quite rare on this repository.

    One thing I would like to do is remove 1 or 2 post types from the settings page. I figured to do this would mean adding a line to the admin/includes/settings.php file around line 76 (in the “public function admin_init()”). Any pointers as to exactly what I could insert to unset my post_type_x?

    Thanks

    https://www.ads-software.com/plugins/post-type-requirements-checklist/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter David

    (@kazango)

    Never mind, I figured it out.

    For anyone who might come across this wondering the same thing, open public/class-post-type-requirements-checklist.php and after line 90:
    $post_types = get_post_types( $args, $output, $operator );

    add
    unset( $post_types['CUSTOMPOSTTYPE'] );

    where CUSTOMPOSTTYPE is your custom post type’s slug.

    Thanks again!

    Plugin Author dauidus

    (@dauidus)

    David,

    Yes, this is the appropriate code to do what you want. In the future, I may add this as an option to the plugin itself. Thanks for sharing your answer!

    I’m interested to know why you’d like to unset the post type… as a UX guy, I’m always interested to know the thought behind code decisions. Is merely not enabling requirements not enough? Adding a setting wouldn’t add much bloat at all… but I wonder if it is necessary.

    And, thanks for the kind words.

    -D

    Thread Starter David

    (@kazango)

    Hi David,

    I run an instance of Multisite which hosts a few clients sites, one of those clients has several authors so your plugin comes in handy to give those authors a checklist before they can submit a post for review by the admin/my client. I also have a page builder plugin active network-wide which adds the post type “templates”, and this plugin by default adds a settings tab for that post type, which is unnecessary. To be aesthetically as clean as possible for the benefit of my client I thought it would be best to strip out the option to set requirements for the templates post type, since seeing it would likely confuse him.

    I don’t need a physical setting to disable certain post types from the settings, and I’m sure having one wouldn’t benefit the masses either since like you say they could just not activate the checklist for that custom post type, I appreciate your interest though ??

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unset a post type’ is closed to new replies.