• Howdy!

    I’m playing around with having some custom themes/plugins be setup on Github, mostly following this guideline: https://code.tutsplus.com/tutorials/distributing-your-plugins-in-github-with-automatic-updates–wp-34817

    This works brilliantly for plugins, and I have it set up similarly for themes using ‘pre_set_site_transient_update_themes’ instead of ‘pre_set_site_transient_update_plugins’, with one small exception…

    When I set my the “transient response” ($transient->response[$theme_name]), I have to pass an array, rather than an object like I did with my plugin code. This was not a very simple thing to discover, and ended up digging around in Core for a while before I found my answer.

    My assumption is that these hooks were created at different times in WordPress’ lifecycle, and it would make sense that maybe they were handled differently then, but I think it would be nice if we could have consistency around things like this, as I am sure it is happening at a few different places in Core. If there’s a simple explanation around why this was built this way, I’m happy to take that, I just got a bit frustrated working on something today and this ended up taking me longer than I’d expected to figure out.

    Thank you,

    –d

The topic ‘Theme / Plugin Differences for Similar Functionality’ is closed to new replies.