• Resolved takeok

    (@takeok)


    Unfortunately does not work with Custom Post types with WP 6.7.1

    • This topic was modified 3 months, 3 weeks ago by takeok.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Small Plugins

    (@smallplugins)

    Hey, @takeok, what have you done to test this? I can confirm this plugin does work with CPT when on WP 6.7.1

    Would you like help debugging your issue?

    Thread Starter takeok

    (@takeok)

    Thanks for letting me know it’s working for you. I will try to understand the issue better and report back soon.

    Thread Starter takeok

    (@takeok)

    Ok it’s working on the frontend… it’s just in the Editor that the selected posts are not being rendered. The Editor appears to just be using the standard query parameters without the post__in modification. So when I switch to the post type to “Testimonials” for example and choose “Testimonial Four” the editor still just shows Testimonial One, Testimonial Two, etc…

    Plugin Author Small Plugins

    (@smallplugins)

    And you’re definitely on the latest version–1.0.2–right? I know we fixed a similar backend issue previously. My tests are working, too. https://ocl.ink/v/vgcYpQ

    Thread Starter takeok

    (@takeok)

    I’ve created a test CPT using the ACF UI (the CPT I was using before is being created by theme code / PHP) and the test CPT is working. So it has something to do with the way the theme is registering the CPT I was trying to use. show_in_rest and it’s set to true. Not sure what else it might be.

    Plugin Author Small Plugins

    (@smallplugins)

    Let me check with my team and see what ideas we can come up with.

    Thread Starter takeok

    (@takeok)

    Ok it’s not anything in the register_post_type() function. I tried exporting my working “Test CPT” that I created in ACF as PHP, deleted it in ACF and then copy/pasted the exact ACF PHP code at the bottom of the functions.php file and… doesn’t work.

    So it doesn’t work when the CPT is registered via the theme’s functions.php. But it does work when the CPT is registered via ACF. The Theme is sage (ugg)

    • This reply was modified 3 months, 3 weeks ago by takeok.
    • This reply was modified 3 months, 3 weeks ago by takeok.
    Thread Starter takeok

    (@takeok)

    p.s. I’ve noticed my custom post type registered via PHP in the theme isn’t being returned in line 49 of /query-loop-post-selector.php

    Thread Starter takeok

    (@takeok)

    p.p.s. using the ‘after_setup_theme’ action in the theme to register the CPT instead of the ‘init’ action makes it work without any changes to the plugin. So that’s probably a good workaround. Unless there’s another hook that can be used in the plugin that will work when CPTs are registered with ‘init’

    Perhaps it would make sense for the plugin to use ‘wp_loaded’ instead? Although it works fine when I register my CPT via ACF. Anyway I have a workaround and we know the issue has to do with when the timing of when the theme registers the CPTs and when your plugin looks for the CPTs so I’ll leave that with you. Thanks for being so responsive!

    • This reply was modified 3 months, 3 weeks ago by takeok.
    Plugin Author Small Plugins

    (@smallplugins)

    Thanks for the troubleshooting and feedback! I confirmed that Custom Post Type UI’s export code also uses the init hook; it wouldn’t be reasonable–in my opinion–to expect users to know to change that. So we’re discussing how we want to modify our plugin. I think your suggestion would work, or perhaps we’ll set a priority on our init call. Either way, I expect we’ll release an update in the coming days!

    Thread Starter takeok

    (@takeok)

    Awesome. I’ll mark as resolved on the assumption an update is coming soon.

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.