本文整理汇总了PHP中do_core_upgrade函数的典型用法代码示例。如果您正苦于以下问题:PHP do_core_upgrade函数的具体用法?PHP do_core_upgrade怎么用?PHP do_core_upgrade使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了do_core_upgrade函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
$action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core';
if ( 'upgrade-core' == $action ) {
wp_version_check();
$title = __('Upgrade WordPress');
$parent_file = 'tools.php';
require_once('admin-header.php');
core_upgrade_preamble();
include('admin-footer.php');
} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
check_admin_referer('upgrade-core');
$title = __('Upgrade WordPress');
$parent_file = 'tools.php';
// do the (un)dismiss actions before headers,
// so that they can redirect
if ( isset( $_POST['dismiss'] ) )
do_dismiss_core_update();
elseif ( isset( $_POST['undismiss'] ) )
do_undismiss_core_update();
require_once('admin-header.php');
if ( 'do-core-reinstall' == $action )
$reinstall = true;
else
$reinstall = false;
if ( isset( $_POST['upgrade'] ) )
do_core_upgrade($reinstall);
include('admin-footer.php');
}?>
示例2: su_update_all
/**
* Install all available updates.
*
* Updates themes, plugins, core and translations.
*/
function su_update_all()
{
if (!current_user_can('update_core') && !current_user_can('update_plugins') && !current_user_can('update_themes')) {
wp_die(__('You do not have sufficient permissions to update this site.'));
}
check_admin_referer('upgrade-core');
require_once ABSPATH . 'wp-admin/admin-header.php';
// Update themes.
$themes = array_keys(get_theme_updates());
if (!empty($themes)) {
$url = 'update.php?action=update-selected-themes&themes=' . urlencode(implode(',', $themes));
$url = wp_nonce_url($url, 'bulk-update-themes');
?>
<div class="wrap">
<h1><?php
_e('Update Themes');
?>
</h1>
<iframe src="<?php
echo $url;
?>
" style="width: 100%; height: 100%; min-height: 750px;" frameborder="0" title="<?php
esc_attr_e('Update progress');
?>
"></iframe>
</div>
<?php
}
// Update plugins.
$plugins = array_keys(get_plugin_updates());
if (!empty($plugins)) {
$url = 'update.php?action=update-selected&plugins=' . urlencode(implode(',', $plugins));
$url = wp_nonce_url($url, 'bulk-update-plugins');
?>
<div class="wrap">
<h1><?php
_e('Update Plugins');
?>
</h1>
<iframe src="<?php
echo $url;
?>
" style="width: 100%; height: 100%; min-height: 750px;" frameborder="0" title="<?php
esc_attr_e('Update progress');
?>
"></iframe>
</div>
<?php
}
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
// Update translations.
$url = 'update-core.php?action=do-translation-upgrade';
$nonce = 'upgrade-translations';
$title = __('Update Translations');
$context = WP_LANG_DIR;
$upgrader = new Language_Pack_Upgrader(new Language_Pack_Upgrader_Skin(compact('url', 'nonce', 'title', 'context')));
$upgrader->bulk_upgrade();
// Update core.
do_core_upgrade();
include ABSPATH . 'wp-admin/admin-footer.php';
}