本文整理汇总了PHP中wp_unregister_widget_control函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_unregister_widget_control函数的具体用法?PHP wp_unregister_widget_control怎么用?PHP wp_unregister_widget_control使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_unregister_widget_control函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unregister_widget_control
/**
* Alias of {@link wp_unregister_widget_control()}.
*
* @since 2.2.0
* @deprecated 2.8.0
* @deprecated Use wp_unregister_widget_control()
* @see wp_unregister_widget_control()
*
* @param int|string $id Widget ID.
*/
function unregister_widget_control($id)
{
_deprecated_function(__FUNCTION__, '2.8', 'wp_unregister_widget_control()');
return wp_unregister_widget_control($id);
}
示例2: wp_unregister_sidebar_widget
/**
* Remove widget from sidebar.
*
* @since 2.2.0
*
* @param int|string $id Widget ID.
*/
function wp_unregister_sidebar_widget($id)
{
/**
* Fires just before a widget is removed from a sidebar.
*
* @since 3.0.0
*
* @param int $id The widget ID.
*/
do_action('wp_unregister_sidebar_widget', $id);
wp_register_sidebar_widget($id, '', '');
wp_unregister_widget_control($id);
}
示例3: wp_unregister_sidebar_widget
/**
* Remove widget from sidebar.
*
* @since 2.2.0
*
* @param int|string $id Widget ID.
*/
function wp_unregister_sidebar_widget($id)
{
do_action('wp_unregister_sidebar_widget', $id);
wp_register_sidebar_widget($id, '', '');
wp_unregister_widget_control($id);
}
示例4: unregister_widget_control
/**
* Alias of {@link wp_unregister_widget_control()}.
*
* @since 2.2.0
* @see wp_unregister_widget_control()
*
* @param int|string $id Widget ID.
*/
function unregister_widget_control($id)
{
return wp_unregister_widget_control($id);
}
示例5: barthelme_widgets_init
function barthelme_widgets_init()
{
if (!function_exists('register_sidebars')) {
return;
}
$p = array('before_title' => "<h3 class='widgettitle'>", 'after_title' => "</h3>\n");
register_sidebars(1, $p);
// Finished intializing Widgets plugin, now let's load the Barthelme default widgets; first, Barthelme search widget
$widget_ops = array('classname' => 'widget_search', 'description' => __("A search form for your blog (Barthelme)", "barthelme"));
wp_register_sidebar_widget('search', __('Search', 'barthelme'), 'widget_barthelme_search', $widget_ops);
wp_unregister_widget_control('search');
wp_register_widget_control('search', __('Search', 'barthelme'), 'widget_barthelme_search_control');
// Barthelme Meta widget
$widget_ops = array('classname' => 'widget_meta', 'description' => __("Log in/out and administration links (Barthelme)", "barthelme"));
wp_register_sidebar_widget('meta', __('Meta', 'barthelme'), 'widget_barthelme_meta', $widget_ops);
wp_unregister_widget_control('meta');
wp_register_widget_control('meta', __('Meta'), 'wp_widget_meta_control');
//Barthelme Home Link widget
$widget_ops = array('classname' => 'widget_home_link', 'description' => __("Link to the front page when elsewhere (Barthelme)", "barthelme"));
wp_register_sidebar_widget('home_link', __('Home Link', 'barthelme'), 'widget_barthelme_homelink', $widget_ops);
wp_register_widget_control('home_link', __('Home Link', 'barthelme'), 'widget_barthelme_homelink_control');
//Barthelme RSS Links widget
$widget_ops = array('classname' => 'widget_rss_links', 'description' => __("RSS links for both posts and comments (Barthelme)", "barthelme"));
wp_register_sidebar_widget('rss_links', __('RSS Links', 'barthelme'), 'widget_barthelme_rsslinks', $widget_ops);
wp_register_widget_control('rss_links', __('RSS Links', 'barthelme'), 'widget_barthelme_rsslinks_control');
}
示例6: wp_unregister_sidebar_widget
/**
* Remove widget from sidebar.
*
* @since 2.2.0
*
* @param int|string $id Widget ID.
*/
function wp_unregister_sidebar_widget($id)
{
wp_register_sidebar_widget($id, '', '');
wp_unregister_widget_control($id);
}
示例7: pageOptions
function pageOptions()
{
// Update or reset options
if (isset($_POST['updateoptions'])) {
foreach ((array) $this->options as $key => $value) {
$newval = isset($_POST[$key]) ? stripslashes($_POST[$key]) : '0';
if ($newval != $value) {
$this->setOption($key, $newval);
}
}
$this->saveOptions();
$this->message = __('Options saved', 'wpkitcn');
$this->status = 'updated';
}
if (isset($_POST['deletealloptions'])) {
wp_unregister_sidebar_widget('wkc_advanced_blogroll');
wp_unregister_widget_control('wkc_advanced_blogroll');
wp_unregister_sidebar_widget('wkc_most_active_commentors');
wp_unregister_widget_control('wkc_most_active_commentors');
wp_unregister_sidebar_widget('wkc_most_commented');
wp_unregister_widget_control('wkc_most_commented');
wp_unregister_sidebar_widget('wkc_random_posts');
wp_unregister_widget_control('wkc_random_posts');
wp_unregister_sidebar_widget('wkc_recent_commentors');
wp_unregister_widget_control('wkc_recent_commentors');
wp_unregister_sidebar_widget('wkc_recent_comments');
wp_unregister_widget_control('wkc_recent_comments');
delete_option($this->db_options);
delete_option('widget_wkc_advanced_blogroll');
delete_option('widget_wkc_most_active_commentors');
delete_option('widget_wkc_most_commented_posts');
delete_option('widget_wkc_random_posts');
delete_option('widget_wkc_recent_commentors');
delete_option('widget_wkc_recent_comments');
deactivate_plugins('wp-kit-cn/wp-kit-cn.php');
$this->message = __('Options of WP Kit CN have been removed, and the plugin has been deactivated.', 'wpkitcn');
}
$this->displayMessage();
?>
<style type="text/css">
legend {display:none!important;}
fieldset {border:0 none;margin:0;padding:0;}
</style>
<div class="wrap">
<h2><?php
_e('WP Kit CN Options', 'wpkitcn');
?>
</h2>
<p><?php
_e('Visit the <a href="http://sexywp.com/wp-kit-cn.htm">plugin\'s homepage</a> for further details. If you find a bug, or have a fantastic idea for this plugin, <a href="mailto:charlestang@foxmail.com">ask me</a> !', 'wpkitcn');
?>
</p>
<form method="post" action="<?php
echo $this->admin_base_url . 'wkc_options';
?>
">
<table class="form-table">
<tbody>
<tr>
<th scope="row"><?php
_e('Auto Excerpt Settings', 'wpkitcn');
?>
</th>
<td><fieldset>
<legend><?php
_e('Auto Excerpt Settings', 'wpkitcn');
?>
</legend>
<input type="hidden" name="enable_excerpt_algorithm" id="enable_excerpt_algorithm" value="0" />
<p><label for="enable_excerpt_algorithm"><input type="checkbox" name="enable_excerpt_algorithm" id="enable_excerpt_algorithm" value="1" <?php
echo $this->options['enable_excerpt_algorithm'] ? 'checked="checked"' : '';
?>
/><?php
_e('Enable the Excerpt Algorithm', 'wpkitcn');
?>
</label></p>
<p><?php
_e('The excerpt algorithm in this plugin will replace the original excerpt algorithm. This algorithm allows you customize how many paragraphs or how many words you want use to excerpt the post.', 'wpkitcn');
?>
</p>
<p><label for="excerpt_words_number">
<?php
_e('How many words?', 'wpkitcn');
?>
</label>
<input type="text" name="excerpt_words_number" id="excerpt_words_number" value="<?php
echo $this->options['excerpt_words_number'];
?>
" size="5" />
<?php
_e('words.', 'wpkitcn');
?>
</p>
<p><label for="excerpt_paragraphs_number">
<?php
_e('or How many paragraphs?', 'wpkitcn');
?>
</label>
<input type="text" name="excerpt_paragraphs_number" id="excerpt_paragraphs_number" value="<?php
echo $this->options['excerpt_paragraphs_number'];
//.........这里部分代码省略.........
示例8: sandbox_widgets_init
function sandbox_widgets_init()
{
if (!function_exists('register_sidebars')) {
return;
}
// Formats the Sandbox widgets, adding readability-improving whitespace
$p = array('before_widget' => "\n\t\t\t" . '<li id="%1$s" class="widget %2$s">', 'after_widget' => "\n\t\t\t</li>\n", 'before_title' => "\n\t\t\t\t" . '<h3 class="widgettitle">', 'after_title' => "</h3>\n");
// Table for how many? Two? This way, please.
register_sidebars(2, $p);
// Finished intializing Widgets plugin, now let's load the Sandbox default widgets; first, Sandbox search widget
$widget_ops = array('classname' => 'widget_search', 'description' => __("A search form for your blog (Sandbox)", "sandbox"));
wp_register_sidebar_widget('search', __('Search', 'sandbox'), 'widget_sandbox_search', $widget_ops);
wp_unregister_widget_control('search');
// We're being Sandbox-specific; remove WP default
wp_register_widget_control('search', __('Search', 'sandbox'), 'widget_sandbox_search_control');
// Sandbox Meta widget
$widget_ops = array('classname' => 'widget_meta', 'description' => __("Log in/out and administration links (Sandbox)", "sandbox"));
wp_register_sidebar_widget('meta', __('Meta', 'sandbox'), 'widget_sandbox_meta', $widget_ops);
wp_unregister_widget_control('meta');
// We're being Sandbox-specific; remove WP default
wp_register_widget_control('meta', __('Meta', 'sandbox'), 'wp_widget_meta_control');
//Sandbox RSS Links widget
$widget_ops = array('classname' => 'widget_rss_links', 'description' => __("RSS links for both posts and comments (Sandbox)", "sandbox"));
wp_register_sidebar_widget('rss_links', __('RSS Links', 'sandbox'), 'widget_sandbox_rsslinks', $widget_ops);
wp_register_widget_control('rss_links', __('RSS Links', 'sandbox'), 'widget_sandbox_rsslinks_control');
}