本文整理汇总了PHP中unregister_setting函数的典型用法代码示例。如果您正苦于以下问题:PHP unregister_setting函数的具体用法?PHP unregister_setting怎么用?PHP unregister_setting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unregister_setting函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:wangshipeng,项目名称:creative-commons-license-manager,代码行数:7,代码来源:wordpress-cc-plugin.php
示例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');
}
开发者ID:BoomtownIG,项目名称:merit-sp-batching,代码行数:8,代码来源:index.php
示例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');
}
开发者ID:adsitus,项目名称:post-rotation,代码行数:8,代码来源:post-rotation.php
示例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');
}
开发者ID:TakenCdosG,项目名称:admissionsrevolution_new,代码行数:14,代码来源:index.php
示例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');
}
开发者ID:kevinreilly,项目名称:bats-wp,代码行数:14,代码来源:wp-sitemap-page.php
示例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();
}
}
开发者ID:Telemedellin,项目名称:fonvalmed,代码行数:12,代码来源:uninstall.php
示例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');
}
}
}
开发者ID:RipJustice,项目名称:DynamicTextPluginWP,代码行数:14,代码来源:dynamic_text_options.php
示例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);
}
}
开发者ID:navinweb,项目名称:wordpress-starter-pack,代码行数:17,代码来源:wp-customer-reviews-admin.php
示例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');
}
开发者ID:WP-API,项目名称:wp-api-site-endpoints,代码行数:17,代码来源:test-rest-settings-controller.php
示例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');
}
开发者ID:ugurbastan,项目名称:swe-574-group4,代码行数:45,代码来源:classipress-author-post-sort.php
示例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');
}
开发者ID:ugurbastan,项目名称:swe-574-group4,代码行数:39,代码来源:wp-ajax-post-sort.php
示例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");
}
开发者ID:arshanam,项目名称:inbound-rocket,代码行数:45,代码来源:inbound-rocket.php
示例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);
/*
开发者ID:ncross42,项目名称:dobalance,代码行数:31,代码来源:uninstall.php
示例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);
}
开发者ID:aim-web-projects,项目名称:kobe-chuoh,代码行数:45,代码来源:common.php
示例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);
}
}
}
开发者ID:phongvan212,项目名称:ttctxh,代码行数:27,代码来源:my-plugin-installer.php
示例16: uninstall_options
function uninstall_options($name)
{
unregister_setting("{$name}_group", $name);
WPPlugin::remove_options($name);
}
开发者ID:vpatrinica,项目名称:jfdesign,代码行数:5,代码来源:uninstall.php
示例17: unregister_settings
static function unregister_settings()
{
unregister_setting(self::$_prefix, self::$_prefix . 'key');
unregister_setting(self::$_prefix, self::$_prefix . 'searchId');
unregister_setting(self::$_prefix, self::$_prefix . 'login');
unregister_setting(self::$_prefix, self::$_prefix . 'message');
}
开发者ID:ByAxe,项目名称:Modern,代码行数:7,代码来源:plugin.php
示例18: 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');
delete_option('wsp_add_nofollow');
delete_option('wsp_is_display_copyright');
delete_option('wsp_is_display_post_multiple_time');
delete_option('wsp_is_exclude_password_protected');
unregister_setting('wp-sitemap-page', 'wsp_posts_by_category');
}
开发者ID:GSA,项目名称:wp-sitemap-page,代码行数:18,代码来源:wp-sitemap-page.php
示例19: dirname
<?php
/* If uninstall is not called from WordPress, exit */
if (!defined('WP_UNINSTALL_PLUGIN')) {
exit;
}
require_once dirname(__FILE__) . '/CTMP_Cookie_Consent.class.php';
$setting_names = array_keys(CTMP_Cookie_Consent::ctmpcc_default_configuration());
foreach ($setting_names as $setting_name) {
/* Unregister and delete each setting */
unregister_setting(CTMPCC_OPTION_GROUP, CTMPCC_OPTION_PREFIX . $setting_name);
delete_option(CTMPCC_OPTION_PREFIX . $setting_name);
}
开发者ID:chrimm,项目名称:ctmp-cookieconsent,代码行数:13,代码来源:uninstall.php
示例20: test_get_item_with_filter
public function test_get_item_with_filter()
{
wp_set_current_user(self::$administrator);
add_filter('rest_pre_get_setting', array($this, 'get_setting_custom_callback'), 10, 3);
register_setting('somegroup', 'mycustomsetting1', array('show_in_rest' => array('name' => 'mycustomsettinginrest1'), 'type' => 'string'));
register_setting('somegroup', 'mycustomsetting2', array('show_in_rest' => array('name' => 'mycustomsettinginrest2'), 'type' => 'string'));
update_option('mycustomsetting1', 'unfiltered1');
update_option('mycustomsetting2', 'unfiltered2');
$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('mycustomsettinginrest1', $data);
$this->assertEquals('unfiltered1', $data['mycustomsettinginrest1']);
$this->assertArrayHasKey('mycustomsettinginrest2', $data);
$this->assertEquals('unfiltered2', $data['mycustomsettinginrest2']);
unregister_setting('somegroup', 'mycustomsetting');
remove_all_filters('rest_pre_get_setting');
}
开发者ID:aaemnnosttv,项目名称:develop.git.wordpress.org,代码行数:19,代码来源:rest-settings-controller.php
注:本文中的unregister_setting函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论