當前位置: 首頁>>代碼示例>>PHP>>正文


PHP list_theme_updates函數代碼示例

本文整理匯總了PHP中list_theme_updates函數的典型用法代碼示例。如果您正苦於以下問題:PHP list_theme_updates函數的具體用法?PHP list_theme_updates怎麽用?PHP list_theme_updates使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了list_theme_updates函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: core_upgrade_preamble

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7
 *
 * @return null
 */
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 ' &nbsp; <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>';
}
開發者ID:jawandsingh,項目名稱:wordpress_with_sql_azure,代碼行數:71,代碼來源:update-core.php

示例2: printf

        }
        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 ' &nbsp; <a class="button" href="' . esc_url(self_admin_url('update-core.php?force-check=1')) . '">' . __('Check Again') . '</a>';
    echo '</p>';
    if ($core = current_user_can('update_core')) {
        core_upgrade_preamble();
    }
    if ($plugins = current_user_can('update_plugins')) {
        list_plugin_updates();
    }
    if ($themes = current_user_can('update_themes')) {
        list_theme_updates();
    }
    if ($core || $plugins || $themes) {
        list_translation_updates();
    }
    unset($core, $plugins, $themes);
    /**
     * Fires after the core, plugin, and theme update tables.
     *
     * @since 2.9.0
     */
    do_action('core_upgrade_preamble');
    echo '</div>';
    include ABSPATH . 'wp-admin/admin-footer.php';
} elseif ('do-core-upgrade' == $action || 'do-core-reinstall' == $action) {
    if (!current_user_can('update_core')) {
開發者ID:leonardopires,項目名稱:projectnami,代碼行數:31,代碼來源:update-core.php

示例3: core_upgrade_preamble

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7
 *
 * @return null
 */
function core_upgrade_preamble()
{
    global $upgrade_error;
    $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>';
        _e('Please select one or more plugins to upgrade.');
        echo '</p></div>';
    }
    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"><p>';
        _e('<strong>Important:</strong> before updating, please <a href="http://codex.wordpress.org/WordPress_Backups">backup 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) {
        $class = $alternate ? ' class="alternate"' : '';
        $alternate = !$alternate;
        echo "<li {$class}>";
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    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>';
    dismissed_updates();
    list_plugin_updates();
    list_theme_updates();
    do_action('core_upgrade_preamble');
    echo '</div>';
}
開發者ID:laiello,項目名稱:cartonbank,代碼行數:55,代碼來源:update-core.php


注:本文中的list_theme_updates函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。