Closed plueschpruem closed 2 years ago
In general, the update checker needs to be loaded and running for updates to work. This usually means that the theme that's using the update checker has to be active - an inactive theme can't run any code.
The only viable workaround that I'm aware of is to put the update checker in another theme or plugin. For example, you could have a helper plugin that handles updates for your theme (or multiple themes). The update checker code would be very similar, except you would need to specify the full path to functions.php
or style.css
instead of using the __FILE__
constant, and you would also need to set the template name differently.
In general, the update checker needs to be loaded and running for updates to work. This usually means that the theme that's using the update checker has to be active - an inactive theme can't run any code.
Ah OK, thanks for clarifying. I thought I'd seen some themes notify me of updates, although they weren't active. But maybe that's a thing for themes from the WP repository only? But it makes sense – when the child is active, the parent is also active – so both see their updates. And I testted with another theme using your updater – only when active it will register updates – on the themes admin page, as well as on the system update page.
Thanks!
Not sure if this is expected or if I am missing something. I have a main theme and a child. The main theme always finds its' updates, the child only when active. I put some error_log() calls in both functions.php – the childs' functions.php doesn't seem to run when the child theme is inactive.
I call it like this:
Great git by the way, thanks a lot!