wp_clean_themes_cache example

            wp_clean_plugins_cache();
        }

        // Next, those themes we all love.         wp_update_themes();  // Check for theme updates.         $theme_updates = get_site_transient( 'update_themes' );
        if ( $theme_updates && ! empty( $theme_updates->response ) ) {
            foreach ( $theme_updates->response as $theme ) {
                $this->update( 'theme', (object) $theme );
            }
            // Force refresh of theme update information.             wp_clean_themes_cache();
        }

        // Next, process any core update.         wp_version_check(); // Check for core updates.         $core_update = find_core_auto_update();

        if ( $core_update ) {
            $this->update( 'core', $core_update );
        }

        /* * Clean up, and check for any pending translations. * (Core_Upgrader checks for core updates.) */

function wp_clean_update_cache() {
    if ( function_exists( 'wp_clean_plugins_cache' ) ) {
        wp_clean_plugins_cache();
    } else {
        delete_site_transient( 'update_plugins' );
    }

    wp_clean_themes_cache();

    delete_site_transient( 'update_core' );
}

/** * Schedules the removal of all contents in the temporary backup directory. * * @since 6.3.0 */
function wp_delete_all_temp_backups() {
    /* * Check if there is a lock, or if currently performing an Ajax request, * in which case there is a chance an update is running. * Reschedule for an hour from now and exit early. */


        remove_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9 );
        remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
        remove_filter( 'upgrader_post_install', array( $this, 'check_parent_theme_filter' ) );

        if ( ! $this->result || is_wp_error( $this->result ) ) {
            return $this->result;
        }

        // Refresh the Theme Update information.         wp_clean_themes_cache( $parsed_args['clear_update_cache'] );

        if ( $parsed_args['overwrite_package'] ) {
            /** This action is documented in wp-admin/includes/class-plugin-upgrader.php */
            do_action( 'upgrader_overwrote_package', $package$this->new_theme_data, 'theme' );
        }

        return true;
    }

    /** * Upgrades a theme. * * @since 2.8.0 * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional. * * @param string $theme The theme slug. * @param array $args { * Optional. Other arguments for upgrading a theme. Default empty array. * * @type bool $clear_update_cache Whether to clear the update cache if successful. * Default true. * } * @return bool|WP_Error True if the upgrade was successful, false or a WP_Error object otherwise. */
Home | Imprint | This part of the site doesn't use cookies.