Support » Plugin: Jetpack by WordPress.com » Publicize works for regular post type, but doesn't for CPT

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Richard Archambault

    (@richardmtl)

    Happiness Engineer

    Hi!

    Have a look here:

    https://github.com/Automattic/jetpack/issues/8

    As mentioned in this comment, your CPT needs to be added with a priority of less than 10. This will be fixed in the next update to Jetpack, but meanwhile, changing your CPT’s priority to less than 10 should make it work.

    Try that and let me know!

    Pods plugin does all the CPT work for me. I looked at it and it seemed a little complex to modify. Instead, I applied the one line patch (URL below) to Jetpack and it worked great.

    https://github.com/Automattic/jetpack/commit/5870427825dca7e42c9ad89b5b68cf79226442bf

    Pods does it’s init at priority 10 like most plugins are told to do for registering post types and taxonomies. If Jetpack then adds it’s init at priority 10, supposing it runs before plugins named by alphabetic characters after the letter J or after the word Jetpack, then those plugins will be left out of inclusion here, for their registered post types. It would then be good, to have a higher priority set for ‘init’ in this case, for Jetpack to have access to all registered post types, but I’m not sure “999” should be used here, perhaps 12, 15, 20 something like that would be much more sane. “999” just exacerbates the problem and escalates priorities in cases where someone wants to customize around hooks further. But that’s not your issue 🙂

    Plugin Contributor Richard Archambault

    (@richardmtl)

    Happiness Engineer

    @scott: you make a good point; we’ll see what the developers have to say about it. Mind raising the point on the issue?

    Plugin Contributor Brandon Kraft

    (@kraftbj)

    Happiness Engineer

    Hi Scott,

    Please do raise the issue on the GH issue (I’m just another HE, not one of the JP devs). That particular action, I would think, should never need to be out-prioritized (as there are other, more desirable ways to programmatically un-publicize something that is set to publicize), but looking to make sure everything has had a chance to load before we setup the syncing.

    That said, is there a better hook than init to hook onto to avoid a high priority number? Is this the best practice on how to run an action that expects to be ran after everything else it setup? Fodder for a good discussion.

    Init action should be fine, just set priority to something like 11-20 so plugins have a chance to register their post types.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Publicize works for regular post type, but doesn't for CPT’ is closed to new replies.