• Resolved arjanvandenbos

    (@arjanvandenbos)


    I have been using CPT UI on several sites build with the Thesis framework.
    Since CPT UI version 1.0.+ custom post type templates in Thesis 2.1 are no longer generated.
    I understand this has something to do with a change in hooking into the WordPress init hook.
    Version 0.9.5 works fine and I had to roll back.
    Any chance this can be looked into?

    https://www.ads-software.com/plugins/custom-post-type-ui/

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

    (@tw2113)

    The BenchPresser

    Hi arjanvandenbos,

    sorry to hear you’re experiencing issues. I am honestly not sure what is going on here, as I have zero experience with Thesis and do no have access to a copy of it.

    The way we’re doing our registration shouldn’t have chanced that drastically that it should cause issues like this with template generation, but stranger things have happened too, so I’m not saying anything absolutely.

    We still do our registration on the init hook as well, so that’s a detail that didn’t change.

    Are you able to provide any extra detail about the thesis template generation stuff, for the uniformed? ??

    Thread Starter arjanvandenbos

    (@arjanvandenbos)

    Hi Michael,

    Herewith some more details for you, courtesy of Rick Anderson – BYOBWebsite:

    Thesis uses the global variables $wp_post_types & $wp_taxonomies. It checks those variables on the init() hook.

    Thesis doesn’t set a priority on the init hook so either CPTUI registers after Thesis checks or the global variables are updated after Thesis checks.

    Arjan

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Interesting, we don’t touch those variables at all, but we also don’t do anything special with regards to our registration callback priority either. It is possible we may be running before theirs, but I’m not able to test to confirm.

    I wonder if a developer plugin like https://www.ads-software.com/plugins/query-monitor/ could help check on the order that things are fired in for you. Worth trying at least.

    Thread Starter arjanvandenbos

    (@arjanvandenbos)

    If you wish, I can provide you with a copy of Thesis for testing purposes. Just tell me how to get it to you

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    As good intentioned as that is, I’d really preferable not to accept since it is a paid product that I’d be getting for “free”.

    That said, I was mistaken earlier regarding priority. I forgot that I bumped the post type registration down to 11 for the sake of getting taxonomies registered first. If you’re adventurous, the following line is around line 94 of custom-post-type-ui.php. May be worth tinkering with briefly to see if it helps.

    add_action( 'init', 'cptui_create_custom_post_types', 11 ); //Priority 11 so that the taxonomies are registered first.
    Thread Starter arjanvandenbos

    (@arjanvandenbos)

    OK, changing the priority from 11 to 10 fixed the issue with Thesis templates.
    Will this have any other serious implications ?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Shouldn’t. Only thing I can think of may be with regards to the comment I have after the line above. If you’re not using any custom taxonomies with our plugin, you should be fine.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Any changes or updates to this one arjanvandenbos?

    Thread Starter arjanvandenbos

    (@arjanvandenbos)

    I just updated on of my sites to 1.0.6 and everything seems to be working as it should.

    I believe the issue is resolved.

    Thanks a lot, I will upgrade my other sites as well and will let you know if I encounter any problems.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Part of 1.0.6 was the before-mentioned priority change, so good to know it still worked ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Version 1.0.2 no longer working Thesis 2.1’ is closed to new replies.