Fragen\GitHub_Updater\API::wp_update_response PHP Метод

wp_update_response() публичный статический Метод

This catches the response and reloads the transients.
public static wp_update_response ( mixed $response, array $args, string $url ) : mixed
$response mixed HTTP server response.
$args array HTTP response arguments.
$url string URL of HTTP response.
Результат mixed $response Just a pass through, no manipulation.
    public static function wp_update_response($response, $args, $url)
    {
        $parsed_url = parse_url($url);
        if ('api.wordpress.org' === $parsed_url['host']) {
            if (current_user_can('update_plugins') && isset($args['body']['plugins'])) {
                $current = get_site_transient('update_plugins');
                Plugin::instance()->forced_meta_update_plugins(true);
                $current = Plugin::instance()->pre_set_site_transient_update_plugins($current);
                set_site_transient('update_plugins', $current);
            }
            if (current_user_can('update_themes') && isset($args['body']['themes'])) {
                $current = get_site_transient('update_themes');
                Theme::instance()->forced_meta_update_themes(true);
                $current = Theme::instance()->pre_set_site_transient_update_themes($current);
                set_site_transient('update_themes', $current);
            }
        }
        return $response;
    }