wp_get_translation_updates example

<?php esc_attr_e( 'Update Themes' ); ?>" name="upgrade" /></p> </form> <?php }

/** * Display the update translations form. * * @since 3.7.0 */
function list_translation_updates() {
    $updates = wp_get_translation_updates();
    if ( ! $updates ) {
        if ( 'en_US' !== get_locale() ) {
            echo '<h2>' . __( 'Translations' ) . '</h2>';
            echo '<p>' . __( 'Your translations are all up to date.' ) . '</p>';
        }
        return;
    }

    $form_action = 'update-core.php?action=do-translation-upgrade';
    ?> <h2><?php _e( 'Translations' ); ?></h2> <form method="post" action="
if ( $core && function_exists( 'get_core_updates' ) ) {
        $update_wordpress = get_core_updates( array( 'dismissed' => false ) );

        if ( ! empty( $update_wordpress )
            && ! in_array( $update_wordpress[0]->response, array( 'development', 'latest' ), true )
            && current_user_can( 'update_core' )
        ) {
            $counts['wordpress'] = 1;
        }
    }

    if ( ( $core || $plugins || $themes ) && wp_get_translation_updates() ) {
        $counts['translations'] = 1;
    }

    $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
    $titles          = array();

    if ( $counts['wordpress'] ) {
        /* translators: %d: Number of available WordPress updates. */
        $titles['wordpress'] = sprintf( __( '%d WordPress Update' )$counts['wordpress'] );
    }

    

    public static function async_upgrade( $upgrader = false ) {
        // Avoid recursion.         if ( $upgrader && $upgrader instanceof Language_Pack_Upgrader ) {
            return;
        }

        // Nothing to do?         $language_updates = wp_get_translation_updates();
        if ( ! $language_updates ) {
            return;
        }

        /* * Avoid messing with VCS installations, at least for now. * Noted: this is not the ideal way to accomplish this. */
        $check_vcs = new WP_Automatic_Updater();
        if ( $check_vcs->is_vcs_checkout( WP_CONTENT_DIR ) ) {
            return;
        }
wp_update_themes( $theme_stats ); // Check for theme updates.
        $plugin_stats = array();
        if ( isset( $this->update_results['plugin'] ) ) {
            foreach ( $this->update_results['plugin'] as $upgrade ) {
                $plugin_stats[ $upgrade->item->plugin ] = ( true === $upgrade->result );
            }
        }
        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.
Home | Imprint | This part of the site doesn't use cookies.