core_upgrade_preamble [ WordPress Function ]
core_upgrade_preamble ( No parameters )
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: do_core_upgrade, upgrade_all, upgrade_230_options_table, core_update_footer, upgrade_230_old_tables
Display upgrade WordPress for downloading latest or upgrading automatically form.
Source
<?php
function core_upgrade_preamble() {
global $upgrade_error, $wp_version;
$updates = get_core_updates();
?>
<div class="wrap">
<?php screen_icon('tools'); ?>
<h2><?php _e('WordPress Updates'); ?></h2>
<?php
if ( $upgrade_error ) {
echo '<div class="error"><p>';
if ( $upgrade_error == 'themes' )
_e('Please select one or more themes to update.');
else
_e('Please select one or more plugins to update.');
echo '</p></div>';
}
echo '<p>';
/* translators: %1 date, %2 time. */
printf( __('Last checked on %1$s at %2$s.'), date_i18n( get_option( 'date_format' ) ), date_i18n( get_option( 'time_format' ) ) );
echo ' <a class="button" href="' . esc_url( self_admin_url('update-core.php') ) . '">' . __( 'Check Again' ) . '</a>';
echo '</p>';
if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) {
echo '<h3>';
_e('You have the latest version of WordPress.');
echo '</h3>';
} else {
echo '<div class="updated inline"><p>';
_e('<strong>Important:</strong> before updating, please <a href="http://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="http://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
echo '</p></div>';
echo '<h3 class="response">';
_e( 'An updated version of WordPress is available.' );
echo '</h3>';
}
echo '<ul class="core-updates">';
$alternate = true;
foreach( (array) $updates as $update ) {
echo '<li>';
list_core_update( $update );
echo '</li>';
}
echo '</ul>';
if ( $updates ) {
echo '<p>' . __( 'While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.' ) . '</p>';
} else {
list( $normalized_version ) = explode( '-', $wp_version );
echo '<p>' . sprintf( __( '<a href="%s">Learn more about WordPress %s</a>.' ), esc_url( self_admin_url( 'about.php' ) ), $normalized_version ) . '</p>';
}
dismissed_updates();
if ( current_user_can( 'update_plugins' ) )
list_plugin_updates();
if ( current_user_can( 'update_themes' ) )
list_theme_updates();
do_action('core_upgrade_preamble');
echo '</div>';
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- core_upgrade_preamble | A HitchHackers guide through WordPress
Feb 11, 2011 ... function core_upgrade_preamble() { global $upgrade_error; $updates = get_core_updates(); ?> <div class="wrap"> <?php screen_icon('tools') ...
hitchhackerguide.com - core_upgrade_preamble Wordpress hook details -- Adam Brown ...
core_upgrade_preamble. WordPress version history for core_upgrade_preamble . This database has information for all major versions from WP 1.2.1 through ...
adambrown.info - PHPXRef 0.7 : WordPress : Detail view of update-core.php
core_upgrade_preamble() list_plugin_updates() ...
phpxref.ftwr.co.uk - admin - Is there a way to hook into the update-core page for custom ...
Apr 13, 2012 ... There is an action, 'core_upgrade_preamble' , which can be added to output anything you would like at the bottom of the upgrade-core page.
wordpress.stackexchange.com