• I have read this post, and researching relevant articles. I have seen that some have this:

    if (empty($transient->checked)) {
       return $transient;
    }
    1. Is this necessary although I don’t know what it does and why I need it ( the logic ).
    2. Do the below is all I need for a theme?
    $theme = array(
       'theme' => 'sun',
       'new_version' => '2.0.0',
       'url' => 'https://sun.com/updater.php',
       'package' => 'https://sun.com/releases.php',
       'requires' => '6.0',
       'requires_php' => '8.0.0'
    );

    Thank you so much in advanced!

Viewing 2 replies - 1 through 2 (of 2 total)
  • It’s not exactly clear what you’re trying to accomplish.

    But if you’re making a request to the DotOrg API, you should always store the data in a transient that’s stored for X amount of time. This is so that you’re not making a request to the server on each page load (this is the case for any third-party API).

    You can learn more about working with the Transients API here: https://developer.www.ads-software.com/apis/transients/

    Thread Starter ace0930

    (@ace0930)

    @greenshady Hi, I’m trying to use the hook pre_set_site_transient_update_themes to receive update ( for theme ) from my own API. I’m following the turtorial here, but I saw others articles has this line of code if (empty($transient->checked)) { return $transient; } which I’m not sure what it does and if I need it. Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Theme Updater’ is closed to new replies.