Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




list_core_update [ WordPress Function ]

list_core_update ( $update )
Defined at:



No description yet.

Source


<?php
function list_core_update$update ) {
    global 
$wp_local_package$wpdb;
    static 
$first_pass true;

    
$version_string = ('en_US' == $update->locale && 'en_US' == get_locale() ) ?
            
$update->current sprintf("%s&ndash;<strong>%s</strong>"$update->current$update->locale);
    
$current false;
    if ( !isset(
$update->response) || 'latest' == $update->response )
        
$current true;
    
$submit __('Update Now');
    
$form_action 'update-core.php?action=do-core-upgrade';
    
$php_version    phpversion();
    
$mysql_version  $wpdb->db_version();
    
$show_buttons true;
    if ( 
'development' == $update->response ) {
        
$message __('You are using a development version of WordPress. You can update to the latest nightly build automatically or download the nightly build and install it manually:');
        
$download __('Download nightly build');
    } else {
        if ( 
$current ) {
            
$message sprintf(__('You have the latest version of WordPress. You do not need to update. However, if you want to re-install version %s, you can do so automatically or download the package and re-install manually:'), $version_string);
            
$submit __('Re-install Now');
            
$form_action 'update-core.php?action=do-core-reinstall';
        } else {
            
$php_compat     version_compare$php_version$update->php_version'>=' );
            if ( 
file_existsWP_CONTENT_DIR '/db.php' ) && empty( $wpdb->is_mysql ) )
                
$mysql_compat true;
            else
                
$mysql_compat version_compare$mysql_version$update->mysql_version'>=' );

            if ( !
$mysql_compat && !$php_compat )
                
$message sprintf__('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $update->current$update->php_version$update->mysql_version$php_version$mysql_version );
            elseif ( !
$php_compat )
                
$message sprintf__('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.'), $update->current$update->php_version$php_version );
            elseif ( !
$mysql_compat )
                
$message sprintf__('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.'), $update->current$update->mysql_version$mysql_version );
            else
                
$message =     sprintf(__('You can update to <a href="http://codex.wordpress.org/Version_%1$s">WordPress %2$s</a> automatically or download the package and install it manually:'), $update->current$version_string);
            if ( !
$mysql_compat || !$php_compat )
                
$show_buttons false;
        }
        
$download sprintf(__('Download %s'), $version_string);
    }

    echo 
'<p>';
    echo 
$message;
    echo 
'</p>';
    echo 
'<form method="post" action="' $form_action '" name="upgrade" class="upgrade">';
    
wp_nonce_field('upgrade-core');
    echo 
'<p>';
    echo 
'<input name="version" value="'esc_attr($update->current) .'" type="hidden"/>';
    echo 
'<input name="locale" value="'esc_attr($update->locale) .'" type="hidden"/>';
    if ( 
$show_buttons ) {
        if ( 
$first_pass ) {
            
submit_button$submit$current 'button' 'primary''upgrade'false );
            
$first_pass false;
        } else {
            
submit_button$submit'button''upgrade'false );
        }
        echo 
'&nbsp;<a href="' esc_url$update->download ) . '" class="button">' $download '</a>&nbsp;';
    }
    if ( 
'en_US' != $update->locale )
        if ( !isset( 
$update->dismissed ) || !$update->dismissed )
            
submit_button__('Hide this update'), 'button''dismiss'false );
        else
            
submit_button__('Bring back this update'), 'button''undismiss'false );
    echo 
'</p>';
    if ( 
'en_US' != $update->locale && ( !isset($wp_local_package) || $wp_local_package != $update->locale ) )
        echo 
'<p class="hint">'.__('This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.').'</p>';
    else if ( 
'en_US' == $update->locale && get_locale() != 'en_US' ) {
        echo 
'<p class="hint">'.sprintf__('You are about to install WordPress %s <strong>in English (US).</strong> There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.'), $update->response != 'development' $update->current '' ).'</p>';
    }
    echo 
'</form>';

}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics