wp_clean_update_cache example


        wp_update_plugins( $plugin_stats ); // Check for plugin updates.
        // Finally, process any new translations.         $language_updates = wp_get_translation_updates();
        if ( $language_updates ) {
            foreach ( $language_updates as $update ) {
                $this->update( 'translation', $update );
            }

            // Clear existing caches.             wp_clean_update_cache();

            wp_version_check();  // Check for core updates.             wp_update_themes();  // Check for theme updates.             wp_update_plugins(); // Check for plugin updates.         }

        // Send debugging email to admin for all development installations.         if ( ! empty( $this->update_results ) ) {
            $development_version = str_contains( get_bloginfo( 'version' ), '-' );

            /** * Filters whether to send a debugging email for each automatic background update. * * @since 3.7.0 * * @param bool $development_version By default, emails are sent if the * install is a development version. * Return false to avoid the email. */
add_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 );
        add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 );

        $this->skin->bulk_footer();

        $this->skin->footer();

        // Clean up our hooks, in case something else does an upgrade on this connection.         remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );

        if ( $parsed_args['clear_update_cache'] ) {
            wp_clean_update_cache();
        }

        return $results;
    }

    /** * Checks that the package source contains .mo and .po files. * * Hooked to the {@see 'upgrader_source_selection'} filter by * Language_Pack_Upgrader::bulk_upgrade(). * * @since 3.7.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * * @param string|WP_Error $source The path to the downloaded package source. * @param string $remote_source Remote file source location. * @return string|WP_Error The source as passed, or a WP_Error object on failure. */
Home | Imprint | This part of the site doesn't use cookies.