• Resolved Venutius

    (@venutius)


    Hi there, thanks for creating this, it almost does exactly what I’m looking for!

    Almost because I really want to use it with my custom post types and for those unfortunately the “logged in” post status does not appear, although the other options do.

    Anyway you could update it to support custom post types?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Venutius

    (@venutius)

    This seems to be a timing issue. I’m registering my post type on ‘init’ and you are adding the post types to your plugin on ‘init’ so I’m thinking that your init is happening before my init event.

    I trying changing your plugin so that it registered the post types on wo_loaded but this threw errors deeper in the plugin. I’m just a novice at this so I’m unsure if that should have worked.

    Plugin Author shawfactor

    (@shawfactor)

    change line 112 on my plugin too:

    //register the post status
    add_action( ‘init’, array($this,”register_status”), 10000000 );

    That will ensure my plugin adds the status after the cpt is added. Ive tested this and will add it too the next version I’ll release in a couple of days.

    Thread Starter Venutius

    (@venutius)

    Thanks, I got it working by changing the priority on my own init event but this will make sure it works for all.

    Thread Starter Venutius

    (@venutius)

    Actually, when I chenged this setting my own fix stopped working and the logged in option was no longer shown.

    Plugin Author shawfactor

    (@shawfactor)

    Just make sure your cpt is registered before my plugins post status is registered.

    So if they are both using init then your cpt needs to use a lower priority number than my my plugin. WordPress executes the hooks lowest to highest.

    I’ve tested the fix and it works on my test site.

    Thread Starter Venutius

    (@venutius)

    Yep that was my fix, I set the priority of my cpt to 1, so I was surprised it no longer worked with your code modification, I thought it would work. I’ve just tried it again and not only does it knock out the logged in option for my cpt but it also knocks it out for normal posts as well. it works if I set it your priority to 1000, but at 10000 and above I lose the logged in option or rather it has no name by the looks of it – there’s a blank row in the drop down.

    Plugin Author shawfactor

    (@shawfactor)

    I have updated my plugin to include this fix/enhancement.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Support for custom post types’ is closed to new replies.