本文整理汇总了PHP中unregister_setting函数的典型用法代码示例。如果您正苦于以下问题:PHP unregister_setting函数的具体用法?PHP unregister_setting怎么用?PHP unregister_setting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unregister_setting函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cc_wordpress_uninstall
function cc_wordpress_uninstall()
{
global $cc_wordpress_options;
foreach ($cc_wordpress_options as $option) {
unregister_setting('cc_wordpress_options', $option);
}
}
示例2: sp_deactivate
function sp_deactivate()
{
unregister_setting('general', 'sp_host', 'esc_attr');
unregister_setting('general', 'sp_port', 'esc_attr');
unregister_setting('general', 'sp_username', 'esc_attr');
unregister_setting('general', 'sp_password', 'esc_attr');
unregister_setting('general', 'sp_dfilepath', 'esc_attr');
}
示例3: pr_deactivation
function pr_deactivation()
{
unregister_setting('pr-settings-group', 'pr_enabled');
unregister_setting('pr-settings-group', 'pr_interval');
unregister_setting('pr-settings-group', 'pr_also_alter_last_modified');
unregister_setting('pr-settings-group', 'pr_included_categories');
unregister_setting('pr-settings-group', 'pr_clean_uninstall');
}
示例4: mdp_gwt_deactivate
/** function/deactivate
* Usage: create tables if not exist and activates the plugin
* Arg(0): null
* Return: void
*/
public function mdp_gwt_deactivate()
{
unregister_setting(MDP_GWT_WT_ID . '_options', 'mdp_gwt_email');
unregister_setting(MDP_GWT_WT_ID . '_options', 'mdp_gwt_password');
unregister_setting(MDP_GWT_WT_ID . '_options', 'mdp_gwt_position');
unregister_setting(MDP_GWT_WT_ID . '_options', 'mdp_gwt_allsites');
unregister_setting(MDP_GWT_WT_ID . '_options', 'mdp_gwt_version');
unregister_setting(MDP_GWT_WT_ID . '_options', 'mdp_gwt_hook');
}
示例5: wsp_uninstall
/**
* Uninstall this plugin
*/
function wsp_uninstall()
{
// Unregister an option
delete_option('wsp_posts_by_category');
delete_option('wsp_exclude_pages');
delete_option('wsp_exclude_cpt_page');
delete_option('wsp_exclude_cpt_post');
delete_option('wsp_exclude_cpt_archive');
delete_option('wsp_exclude_cpt_author');
unregister_setting('wp-sitemap-page', 'wsp_posts_by_category');
}
示例6: TS_VCSC_Delete_Plugin_Settings_Uninstall
function TS_VCSC_Delete_Plugin_Settings_Uninstall()
{
if (get_option('ts_vcsc_extend_settings_retain') != 2) {
TS_VCSC_DeleteOptionsPrefixed('ts_vcsc_extend_settings_');
unregister_setting('ts_vcsc_extend_custom_css', 'ts_vcsc_extend_custom_css', 'TS_VCSC_CustomCSS_Validation');
unregister_setting('ts_vcsc_extend_custom_js', 'ts_vcsc_extend_custom_js', 'TS_VCSC_CustomJS_Validation');
delete_option("ts_vcsc_extend_custom_css");
delete_option("ts_vcsc_extend_custom_js");
TS_VCSC_RemoveCap();
TS_VCSC_DeleteCustomPack();
}
}
示例7: delMultiVal
public function delMultiVal()
{
//Delete all options
if (isset($_POST[deleteme])) {
//reset all domains if the option button is pressed
$datadynamic = dbPull();
foreach ($datadynamic as $key => $value) {
delete_option($key);
unregister_setting('dynamic_text_settings', $key);
add_option("DynamicDomain_1", "Change Me", "", "yes");
register_setting('dynamic_text_settings', 'DynamicDomain_1');
}
}
}
示例8: real_admin_init
function real_admin_init()
{
$this->parentClass->init();
// $this->enqueue_admin_stuff();
register_setting('wpcr_options', 'wpcr_options');
/* used for redirecting to settings page upon initial activation */
if (get_option('wpcr_gotosettings', false)) {
delete_option('wpcr_gotosettings');
unregister_setting('wpcr_gotosettings', 'wpcr_gotosettings');
/* no auto settings redirect if upgrading */
if (isset($this->p->action) && $this->p->action == 'activate-plugin') {
return false;
}
$url = get_admin_url() . 'options-general.php?page=wpcr_options';
$this->parentClass->wpcr_redirect($url);
}
}
示例9: test_get_item_with_custom_setting
public function test_get_item_with_custom_setting()
{
wp_set_current_user($this->administrator);
register_setting('somegroup', 'mycustomsetting', array('show_in_rest' => array('name' => 'mycustomsettinginrest', 'schema' => array('enum' => array('validvalue1', 'validvalue2'), 'default' => 'validvalue1')), 'type' => 'string'));
$request = new WP_REST_Request('GET', '/wp/v2/settings');
$response = $this->server->dispatch($request);
$data = $response->get_data();
$this->assertEquals(200, $response->get_status());
$this->assertArrayHasKey('mycustomsettinginrest', $data);
$this->assertEquals('validvalue1', $data['mycustomsettinginrest']);
update_option('mycustomsetting', 'validvalue2');
$request = new WP_REST_Request('GET', '/wp/v2/settings');
$response = $this->server->dispatch($request);
$data = $response->get_data();
$this->assertEquals('validvalue2', $data['mycustomsettinginrest']);
unregister_setting('somegroup', 'mycustomsetting');
}
示例10: mcp_aps_uninstall_plugin
function mcp_aps_uninstall_plugin()
{
//Delete Strings
delete_option('mcp_title_asc');
delete_option('mcp_title_desc');
delete_option('mcp_views_asc');
delete_option('mcp_views_desc');
delete_option('mcp_status_asc');
delete_option('mcp_status_desc');
delete_option('mcp_mod_new');
delete_option('mcp_mod_old');
delete_option('mcp_date_new');
delete_option('mcp_date_old');
delete_option('mcp_ex_sold_ads');
delete_option('mcp_ex_exp_ads');
//Delete Options
delete_option('enable_mcp_title');
delete_option('enable_mcp_views');
delete_option('enable_mcp_status');
delete_option('enable_mcp_mod');
delete_option('enable_mcp_date');
delete_option('exclude_mcp_sold_ads');
delete_option('exclude_mcp_ex_ads');
//Unhook Strings
unregister_setting('mcp-aps-settings-group', 'mcp_title_asc');
unregister_setting('mcp-aps-settings-group', 'mcp_title_desc');
unregister_setting('mcp-aps-settings-group', 'mcp_views_asc');
unregister_setting('mcp-aps-settings-group', 'mcp_views_desc');
unregister_setting('mcp-aps-settings-group', 'mcp_status_asc');
unregister_setting('mcp-aps-settings-group', 'mcp_status_desc');
unregister_setting('mcp-aps-settings-group', 'mcp_mod_new');
unregister_setting('mcp-aps-settings-group', 'mcp_mod_old');
unregister_setting('mcp-aps-settings-group', 'mcp_date_new');
unregister_setting('mcp-aps-settings-group', 'mcp_date_old');
unregister_setting('mcp-aps-settings-group', 'mcp_ex_sold_ads');
unregister_setting('mcp-aps-settings-group', 'mcp_ex_exp_ads');
//Unhook Options
unregister_setting('mcp-aps-settings-group', 'enable_mcp_title');
unregister_setting('mcp-aps-settings-group', 'enable_mcp_views');
unregister_setting('mcp-aps-settings-group', 'enable_mcp_status');
unregister_setting('mcp-aps-settings-group', 'enable_mcp_mod');
unregister_setting('mcp-aps-settings-group', 'enable_mcp_date');
unregister_setting('mcp-aps-settings-group', 'exclude_mcp_sold_ads');
unregister_setting('mcp-aps-settings-group', 'exclude_mcp_ex_ads');
}
示例11: twg_waps_uninstall_plugin
function twg_waps_uninstall_plugin()
{
delete_option('sort_price_asc');
delete_option('sort_price_desc');
delete_option('sort_by_newest');
delete_option('sort_by_oldest');
delete_option('sort_by_az');
delete_option('sort_by_za');
delete_option('sort_by_mod_new');
delete_option('sort_by_mod_old');
delete_option('enable_price');
delete_option('enable_date');
delete_option('enable_title');
delete_option('enable_mod');
delete_option('default_sort');
delete_option('exclude_sold');
delete_option('exclude_noimage');
delete_option('enable_ex_sold');
delete_option('enable_ex_noimage');
delete_option('sort_by_ignore');
unregister_setting('cps-settings-group', 'sort_price_asc');
unregister_setting('cps-settings-group', 'sort_price_desc');
unregister_setting('cps-settings-group', 'sort_by_newest');
unregister_setting('cps-settings-group', 'sort_by_oldest');
unregister_setting('cps-settings-group', 'sort_by_az');
unregister_setting('cps-settings-group', 'sort_by_za');
unregister_setting('cps-settings-group', 'sort_by_mod_new');
unregister_setting('cps-settings-group', 'sort_by_mod_old');
unregister_setting('cps-settings-group', 'enable_price');
unregister_setting('cps-settings-group', 'enable_date');
unregister_setting('cps-settings-group', 'enable_title');
unregister_setting('cps-settings-group', 'enable_mod');
unregister_setting('cps-settings-group', 'default_sort');
unregister_setting('cps-settings-group', 'exclude_sold');
unregister_setting('cps-settings-group', 'exclude_noimage');
unregister_setting('cps-settings-group', 'enable_ex_sold');
unregister_setting('cps-settings-group', 'enable_ex_noimage');
unregister_setting('cps-settings-group', 'sort_by_ignore');
}
示例12: uninstall_inboundrocket
/**
* Drops or uninstalls the inboundrocket tables
*/
function uninstall_inboundrocket()
{
if (!defined('ABSPATH')) {
exit;
}
global $wpdb;
$options = get_option('inboundrocket_options');
$email = isset($options['ir_email']) ? $options['ir_email'] : get_bloginfo('admin_email');
inboundrocket_mark_deleted_user($email);
$wpdb->query("DROP TABLE IF EXISTS {$wpdb->ir_leads}");
$wpdb->query("DROP TABLE IF EXISTS {$wpdb->ir_pageviews}");
$wpdb->query("DROP TABLE IF EXISTS {$wpdb->ir_shares}");
$wpdb->query("DROP TABLE IF EXISTS {$wpdb->ir_submissions}");
$wpdb->query("DROP TABLE IF EXISTS {$wpdb->ir_tag_relationships}");
$wpdb->query("DROP TABLE IF EXISTS {$wpdb->ir_tags}");
$wpdb->query("DROP TABLE IF EXISTS {$wpdb->ir_emails}");
unregister_setting('inboundrocket_settings_options', 'inboundrocket_settings_options');
delete_option('inboundrocket_options');
delete_site_option('inboundrocket_options');
unregister_setting('inboundrocket_settings_options', 'inboundrocket_active_power_ups');
delete_option('inboundrocket_active_power_ups');
delete_site_option('inboundrocket_active_power_ups');
unregister_setting('inboundrocket_ss_options', 'inboundrocket_ss_options');
delete_option('inboundrocket_ss_options');
delete_site_option('inboundrocket_ss_options');
unregister_setting('inboundrocket_ctt_options', 'inboundrocket_ctt_options');
delete_option('inboundrocket_ctt_options');
delete_site_option('inboundrocket_ctt_options');
unregister_setting('inboundrocket_is_options', 'inboundrocket_is_options');
delete_option('inboundrocket_is_options');
delete_site_option('inboundrocket_is_options');
unregister_setting('inboundrocket_wb_options', 'inboundrocket_wb_options');
delete_option('inboundrocket_wb_options');
delete_site_option('inboundrocket_wb_options');
unregister_setting('inboundrocket_email_options', 'inboundrocket_email_options');
delete_option('inboundrocket_email_options');
delete_site_option('inboundrocket_email_options');
unregister_setting('inboundrocket_settings_options', 'inboundrocket_subscribe_options');
delete_option('inboundrocket_subscribe_options');
delete_site_option('inboundrocket_subscribe_options');
inboundrocket_track_plugin_activity("Plugin Uninstalled");
}
示例13: define
<?php
if (!defined('WP_USE_THEMES')) {
define('WP_USE_THEMES', false);
require_once dirname(dirname(dirname(dirname(__DIR__)))) . DIRECTORY_SEPARATOR . 'wp-blog-header.php';
}
global $wpdb;
############ version 0.1 ############
##### option #####
unregister_setting('dob_setting', 'dob_root_hierarchy');
unregister_setting('dob_setting', 'dob_root_subject');
##### DB #####
$table_name = $wpdb->prefix . 'dob_cache';
$sql = "DROP TABLE IF EXISTS `{$table_name}`";
$wpdb->query($sql);
$table_name = $wpdb->prefix . 'dob_cart';
$sql = "DROP TABLE IF EXISTS `{$table_name}`";
$wpdb->query($sql);
$table_name = $wpdb->prefix . 'dob_user_category';
$sql = "DROP TABLE IF EXISTS `{$table_name}`";
$wpdb->query($sql);
$table_name = $wpdb->prefix . 'dob_vote_post_latest';
$sql = "DROP TABLE IF EXISTS `{$table_name}`";
$wpdb->query($sql);
$table_name = $wpdb->prefix . 'dob_vote_post_log';
$sql = "DROP TABLE IF EXISTS `{$table_name}`";
$wpdb->query($sql);
$table_name = $wpdb->prefix . 'term_taxonomy';
$sql = "ALTER TABLE `{$table_name}`\n\tDROP `lft`, DROP `rgt`, DROP `lvl`, DROP `pos`, DROP `inf`, DROP `chl`, DROP `anc`,\n\tDROP INDEX IDX_taxonomy_parent_pos";
$wpdb->query($sql);
/*
示例14: ewww_image_optimizer_install_table
function ewww_image_optimizer_install_table()
{
global $ewww_debug;
$ewww_debug .= "<b>ewww_image_optimizer_install_table()</b><br>";
global $wpdb;
// create a table with 4 columns: an id, the file path, the md5sum, and the optimization results
$sql = "CREATE TABLE {$wpdb->ewwwio_images} (\n\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\tpath text NOT NULL,\n\t\timage_md5 VARCHAR(55),\n\t\tresults VARCHAR(55) NOT NULL,\n\t\tgallery VARCHAR(30),\n\t\timage_size int UNSIGNED,\n\t\torig_size int UNSIGNED,\n\t\tUNIQUE KEY id (id)\n\t);";
// include the upgrade library to initialize a table
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
dbDelta($sql);
// remove extra decimals in ewwwio_images table
/*$query = "SELECT id,results FROM $wpdb->ewwwio_images WHERE results LIKE '%.0 B)%'";
$old_records = $wpdb->get_results($query, ARRAY_A);
foreach ($old_records as $record) {
$ewww_debug .= 'converting record: ' . $record['id'] . '<br>';
$savings = preg_replace('/\.0 B/', ' B', $record['results']);
$ewww_debug .= 'using string: ' . $savings . '<br>';
$wpdb->update($wpdb->ewwwio_images,
array(
'results' => $savings,
),
array(
'id' => $record['id'],
));
}*/
// ewww_image_optimizer_debug_log();
// make sure some of our options are not autoloaded (since they can be huge)
$bulk_attachments = get_option('ewww_image_optimizer_bulk_attachments', '');
delete_option('ewww_image_optimizer_bulk_attachments');
add_option('ewww_image_optimizer_bulk_attachments', $bulk_attachments, '', 'no');
$bulk_attachments = get_option('ewww_image_optimizer_flag_attachments', '');
delete_option('ewww_image_optimizer_flag_attachments');
add_option('ewww_image_optimizer_flag_attachments', $bulk_attachments, '', 'no');
$bulk_attachments = get_option('ewww_image_optimizer_ngg_attachments', '');
delete_option('ewww_image_optimizer_ngg_attachments');
add_option('ewww_image_optimizer_ngg_attachments', $bulk_attachments, '', 'no');
$bulk_attachments = get_option('ewww_image_optimizer_aux_attachments', '');
delete_option('ewww_image_optimizer_aux_attachments');
add_option('ewww_image_optimizer_aux_attachments', $bulk_attachments, '', 'no');
// need to re-register the api_key for the sanitize function
$api_key = ewww_image_optimizer_get_option('ewww_image_optimizer_cloud_key');
unregister_setting('ewww_image_optimizer_options', 'ewww_image_optimizer_cloud_key');
register_setting('ewww_image_optimizer_options', 'ewww_image_optimizer_cloud_key', 'ewww_image_optimizer_cloud_key_sanitize');
ewww_image_optimizer_set_option('ewww_image_optimizer_cloud_key', $api_key);
}
示例15: unregister_all_settings
/**
* Unregisters each setting and deletes saved options if required.
*/
public static function unregister_all_settings($option_group_page_name, $option_settings_db_names, $delete_saved_settings = true)
{
if (is_array($option_settings_db_names)) {
foreach ($option_settings_db_names as $unique_db_name) {
//Unregister each setting for each unique id
unregister_setting($option_group_page_name, $unique_db_name);
// settings db name - can change with unique id
// cannot access the abstract function - as it is particular to each instance of this class
//Delete the saved options for each unique id
if ($delete_saved_settings) {
delete_option($unique_db_name);
}
}
} else {
//Unregister settings
unregister_setting($option_group_page_name, $option_settings_db_names);
// settings db name - can change with unique id
// cannot access the abstract function - as it is particular to each instance of this class
//Delete the saved options
if ($delete_saved_settings) {
delete_option($option_settings_db_names);
}
}
}