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


PHP Options::tarski_options_update方法代碼示例

本文整理匯總了PHP中Options::tarski_options_update方法的典型用法代碼示例。如果您正苦於以下問題:PHP Options::tarski_options_update方法的具體用法?PHP Options::tarski_options_update怎麽用?PHP Options::tarski_options_update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Options的用法示例。


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

示例1: save_tarski_options

/**
 * save_tarski_options() - Saves a new set of Tarski options.
 * 
 * The primary request handler for the Tarski options system. Saves any updated
 * options and redirects to the options page.
 * 
 * @see tarskiupdate() which it replaces
 * @see delete_tarski_options()
 * @see restore_tarski_options()
 * @since 2.0
 */
function save_tarski_options()
{
    check_admin_referer('admin_post_tarski_options', '_wpnonce_tarski_options');
    if (!current_user_can('edit_themes')) {
        wp_die(__('You are not authorised to perform this operation.', 'tarski'));
    }
    $options = new Options();
    $options->tarski_options_get();
    $options->tarski_options_update();
    update_option('tarski_options', $options);
    wp_redirect(admin_url('themes.php?page=tarski-options&updated=true'));
}
開發者ID:nihad,項目名稱:tarski,代碼行數:23,代碼來源:admin_helper.php

示例2: save_tarski_options

/**
 * save_tarski_options() - Saves a new set of Tarski options.
 * 
 * If the Tarski Options page request includes a $_POST call
 * and it's been generated by hitting the 'submit' button, this
 * function will generate a new Options object, set its properties
 * to the existing set of options, and then save the new options
 * over the old ones. It then flushes the options so the Options
 * page, which executes after this function, will display the new
 * values rather than the old ones.
 * @see tarskiupdate() which it replaces
 * @since 2.0
 */
function save_tarski_options()
{
    $tarski_options = new Options();
    $tarski_options->tarski_options_get();
    if (ready_to_delete_options($tarski_options->deleted)) {
        delete_option('tarski_options');
        flush_tarski_options();
        return;
    }
    tarski_upgrade_and_flush_options();
    if (isset($_POST['submit'])) {
        $tarski_options->tarski_options_update();
        update_option('tarski_options', $tarski_options);
    }
    flush_tarski_options();
}
開發者ID:jeremylightsmith,項目名稱:blog,代碼行數:29,代碼來源:options.php


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