WordPress.org

Ready to get started?Download WordPress

Forums

selfhosted theme update not working properly (4 posts)

  1. Andrés
    Member
    Posted 1 year ago #

    i have my selfhosted theme update service witch works perfectly on normal wordpress instalation,

    On multisite the functions.php file of the theme is not executed/included, so the update hook is not added.

    the file is only included (appeart to upgrade) when i activate the theme on the main site of the network.

    anyone knows ho to add the update hook/filter to the network update?

  2. Remember, Multisite upgrades plugins and themes via the network admin, not per-site, so the update hook would have to be called via that.

    What kind of code are you using for that?

  3. Andrés
    Member
    Posted 1 year ago #

    i'm using w-sahdow's class
    http://w-shadow.com/blog/2011/06/02/automatic-updates-for-commercial-themes/

    this class uses the
    add_filter('site_transient_update_themes', array($this,'injectUpdate'));
    function to add the hook,

    point is: i tried to put a simple echo "TEST"; in my themes function.php file, and then go to the network admin panel. "TEST" only is printed (in network andmin) if i have activated the theme on the main site of the network.

    my conclusion is that the same happens to the hook, since , i think, the themes function.php file is only included if the theme is active in the networks main site (don't know why it must be the main site).

    I don't know how to add the "update check" hook if functions.pho is not included.

  4. Ah, okay, what's at work here is that the normal theme information that you'd see in a single site is moved to Network admin. couple that with the fact that the function only gets called if the theme is active and the fact that the network utelizes the main site theme (site 1 is the master site), yeah, I'd expect to see all that :/

    Tl;dr
    Updating themes is the purview of network -> themes on Multisite.

Topic Closed

This topic has been closed to new replies.

About this Topic