do_core_upgrade [ WordPress Function ]
do_core_upgrade ( $reinstall = false )
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: find_core_update, core_upgrade_preamble, get_core_updates, list_core_update, do_dismiss_core_update
Upgrade WordPress core display.
Source
<?php
function do_core_upgrade( $reinstall = false ) {
global $wp_filesystem;
if ( $reinstall )
$url = 'update-core.php?action=do-core-reinstall';
else
$url = 'update-core.php?action=do-core-upgrade';
$url = wp_nonce_url($url, 'upgrade-core');
if ( false === ($credentials = request_filesystem_credentials($url, '', false, ABSPATH)) )
return;
$version = isset( $_POST['version'] )? $_POST['version'] : false;
$locale = isset( $_POST['locale'] )? $_POST['locale'] : 'en_US';
$update = find_core_update( $version, $locale );
if ( !$update )
return;
if ( ! WP_Filesystem($credentials, ABSPATH) ) {
request_filesystem_credentials($url, '', true, ABSPATH); //Failed to connect, Error and request again
return;
}
?>
<div class="wrap">
<?php screen_icon('tools'); ?>
<h2><?php _e('Update WordPress'); ?></h2>
<?php
if ( $wp_filesystem->errors->get_error_code() ) {
foreach ( $wp_filesystem->errors->get_error_messages() as $message )
show_message($message);
echo '</div>';
return;
}
if ( $reinstall )
$update->response = 'reinstall';
$result = wp_update_core($update, 'show_message');
if ( is_wp_error($result) ) {
show_message($result);
if ('up_to_date' != $result->get_error_code() )
show_message( __('Installation Failed') );
echo '</div>';
return;
}
show_message( __('WordPress updated successfully') );
show_message( '<span class="hide-if-no-js">' . sprintf( __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href="%s">here</a>.' ), $result, esc_url( self_admin_url( 'about.php?updated' ) ) ) . '</span>' );
show_message( '<span class="hide-if-js">' . sprintf( __( 'Welcome to WordPress %1$s. <a href="%2$s">Learn more</a>.' ), $result, esc_url( self_admin_url( 'about.php?updated' ) ) ) . '</span>' );
?>
</div>
<script type="text/javascript">
window.location = '<?php echo self_admin_url( 'about.php?upgraded' ); ?>';
</script>
<?php
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- do_core_upgrade | A HitchHackers guide through WordPress
Feb 11, 2011 ... function do_core_upgrade( $reinstall = false ) { global $wp_filesystem; if ( $ reinstall ) $url = 'update-core.php?action=do-core-reinstall'; else ...
hitchhackerguide.com - WordPress › Support » 2.8 auto update didn't work - 2.7.1 ...
... http://www.raffaz.net/grigioneutro/wp-admin/update-core.php?action=do-core- upgrade [Thu Jun 11 20:50:51 2009] [error] [client 80.182.65.60] Premature end ...
wordpress.org - WordPress › Support » can't automatically upgrade from 2.8 to 2.8.1
When I try to manually go to the upgrade URL (update-core.php?action=do-core- upgrade) I get a message that says "Are you sure you want to do this?" but no ...
wordpress.org - PHPXRef 0.7 : WordPress : /wp-admin/update-core.php source
331 * 332 * @since 2.7 333 * 334 * @return null 335 */ 336 function do_core_upgrade( $reinstall = false ) { 337 global $wp_filesystem; 338 339 if ( $ reinstall ) ...
phpxref.ftwr.co.uk