当前位置: 首页>>代码示例>>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;未经允许,请勿转载。