本文整理匯總了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();
}