本文整理汇总了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'));
}
示例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();
}