本文整理汇总了PHP中unregister_widget函数的典型用法代码示例。如果您正苦于以下问题:PHP unregister_widget函数的具体用法?PHP unregister_widget怎么用?PHP unregister_widget使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unregister_widget函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load_widget_sb_search_widget
function load_widget_sb_search_widget()
{
// Widget: Search Widget
unregister_widget('WP_Widget_Search');
// We're being StartBox-specific; remove WP default
register_widget('sb_search_widget');
}
示例2: uw_register_widgets
function uw_register_widgets()
{
if (!is_blog_installed()) {
return;
}
unregister_widget('Widget_Akismet');
unregister_widget('WP_Widget_Meta');
unregister_widget('WP_Widget_Recent_Posts');
unregister_widget('WP_Widget_RSS');
//register_widget('UW_Widget_Single_Image');
//register_widget('UW_RSS_Widget');
//register_widget('UW_Widget_Recent_Posts');
//register_widget('UW_Widget_CommunityPhotos');
register_widget('UW_Widget_Categories');
//register_widget('UW_Widget_Twitter');
//register_widget('UW_KEXP_KUOW_Widget');
//register_widget('UW_Showcase_Widget');
//register_widget('UW_Subpage_Menu');
register_widget('UW_Nav_Menu_Widget');
//register_widget('UW_Calendar');
//register_widget('UW_Campus_Map');
// Specific to Page Builder only
register_widget('UW_Headline_Separator_Widget');
register_widget('UW_Headline_Widget');
register_widget('UW_Intro_Widget');
//register_widget('UW_YouTube_Playlist_Widget');
if (is_multisite() && get_blog_details('marketing')) {
register_widget('UW_Pride_Points');
}
}
示例3: deregister_widgets
function deregister_widgets()
{
//todo: only unregister if on the story edit page?
foreach ($this->get_widgets() as $widget) {
unregister_widget($widget);
}
}
示例4: load_sWidgets
function load_sWidgets()
{
unregister_widget('Latest_Releases_Widget');
register_widget('Latest_Releases_Widget');
unregister_widget('Chapters_Progress_Widget');
register_widget('Chapters_Progress_Widget');
}
示例5: unregister_widgets
function unregister_widgets()
{
$unregister = array('WP_Widget_Archives', 'WP_Widget_Calendar', 'WP_Widget_Categories', 'WP_Widget_Links', 'WP_Widget_Meta', 'WP_Widget_Pages', 'WP_Widget_Recent_Comments', 'WP_Widget_Recent_Posts', 'WP_Widget_RSS', 'WP_Widget_Search', 'WP_Widget_Tag_Cloud', 'WP_Widget_Text', 'WP_Nav_Menu_Widget');
for ($i = 0; $i < count($unregister); $i++) {
unregister_widget($unregister[$i]);
}
}
示例6: _mw_adminimize_unregister_widgets
/**
* Remove widgets, areas for different roles
*
* @return void
*/
function _mw_adminimize_unregister_widgets()
{
// Get settings.
$adminimizeoptions = _mw_adminimize_get_option_value();
// Update settings.
_mw_adminimize_update_option($adminimizeoptions);
// exclude super admin
if (_mw_adminimize_exclude_super_admin()) {
return NULL;
}
$user_roles = _mw_adminimize_get_all_user_roles();
foreach ($user_roles as $role) {
$disabled_widget_option_[$role] = _mw_adminimize_get_option_value('mw_adminimize_disabled_widget_option_' . $role . '_items');
}
foreach ($user_roles as $role) {
if (!isset($disabled_widget_option_[$role]['0'])) {
$disabled_widget_option_[$role]['0'] = '';
}
}
foreach ($user_roles as $role) {
$user = wp_get_current_user();
if (is_array($user->roles) && in_array($role, $user->roles)) {
if (_mw_adminimize_current_user_has_role($role) && is_array($disabled_widget_option_[$role])) {
foreach ($disabled_widget_option_[$role] as $widgets) {
unregister_widget($widgets);
$GLOBALS['wp_widget_factory']->unregister($widgets);
//wp_unregister_sidebar_widget( 'Monster_Widget' );
}
}
}
// end if user roles
}
}
示例7: recent_posts
function recent_posts()
{
unregister_widget('WP_Widget_Recent_Posts');
$widget_ops = array('classname' => 'recent-posts', 'description' => __('The latest posts, with a preview thumb.', 'yit'));
$control_ops = array('id_base' => 'recent-posts');
$this->WP_Widget('recent-posts', __('Recent Posts', 'yit'), $widget_ops, $control_ops);
}
示例8: makeclean_custom_widgets
function makeclean_custom_widgets()
{
register_widget('Footer_WP_Widget_Categories');
register_widget('Widget_form_footer');
register_widget('Custom_Search');
//woocommerce category
if (class_exists('WC_Widget_Product_Categories')) {
unregister_widget('WC_Widget_Product_Categories');
include_once 'class-wc-widget-product-categories.php';
register_widget('Custom_WC_Widget_Product_Categories');
}
if (class_exists('WC_Widget_Price_Filter')) {
unregister_widget('WC_Widget_Price_Filter');
include_once 'class-wc-widget-price-filter.php';
register_widget('Custom_WC_Widget_Price_Filter');
}
if (class_exists('WC_Widget_Product_Search')) {
unregister_widget('WC_Widget_Product_Search');
include_once 'class-wc-widget-product-search.php';
register_widget('Custom_Widget_Product_Search');
}
if (class_exists('WP_Widget_Recent_Posts')) {
unregister_widget('WP_Widget_Recent_Posts');
}
register_widget('Custom_WP_Widget_Recent_Posts');
if (class_exists('WP_Widget_Categories')) {
unregister_widget('WP_Widget_Categories');
}
register_widget('Custom_WP_Widget_Categories');
if (class_exists('WP_Widget_Search')) {
unregister_widget('WP_Widget_Search');
}
register_widget('Custom_Gallery_Post');
}
示例9: fadtastic_widget_init
function fadtastic_widget_init()
{
register_sidebar(array('before_title' => "<h3 class='widgettitle'>", 'after_title' => "</h3>", 'name' => 'Sidebar 1', 'id' => 'main-sidebar'));
register_sidebar(array('before_title' => "<h3 class='widgettitle'>", 'after_title' => "</h3>", 'name' => 'Sidebar 2', 'id' => 'bottom-bar'));
unregister_widget('WP_Widget_Links');
wp_register_sidebar_widget('links', __('Links', 'sandbox'), 'widget_fadtastic_links');
}
示例10: unregister_all
/**
* Unregister all widgets.
*/
public static function unregister_all()
{
global $wp_widget_factory;
foreach ($wp_widget_factory->widgets as $widget => $class) {
unregister_widget($widget);
}
}
示例11: unregister_default_widgets
/**
* Register sidebars and widgets
*/
function unregister_default_widgets()
{
unregister_widget('WC_Widget_Featured_Products');
unregister_widget('WC_Widget_Best_Sellers');
unregister_widget('WC_Widget_Price_Filter');
unregister_widget('WC_Widget_Top_Rated_Products');
}
示例12: remove_unneeded_widgets
function remove_unneeded_widgets()
{
unregister_widget('WP_Widget_Pages');
unregister_widget('WP_Widget_Calendar');
unregister_widget('WP_Widget_Tag_Cloud');
unregister_widget('WP_Nav_Menu_Widget');
}
示例13: tst_custom_widgets
function tst_custom_widgets()
{
unregister_widget('WP_Widget_Pages');
unregister_widget('WP_Widget_Archives');
unregister_widget('WP_Widget_Calendar');
unregister_widget('WP_Widget_Meta');
unregister_widget('WP_Widget_Categories');
unregister_widget('WP_Widget_Recent_Posts');
unregister_widget('WP_Widget_Tag_Cloud');
unregister_widget('WP_Widget_RSS');
unregister_widget('WP_Widget_Search');
unregister_widget('FrmListEntries');
unregister_widget('FrmShowForm');
//Most of widgets do not perform well with MDL as for now
unregister_widget('Leyka_Donations_List_Widget');
unregister_widget('Leyka_Campaign_Card_Widget');
unregister_widget('Leyka_Campaigns_List_Widget');
unregister_widget('Su_Widget');
unregister_widget('Ninja_Forms_Widget');
//register_widget('BB_RSS_Widget');
//register_widget('BB_Recent_Posts_Widget');
register_widget('TST_Featured_Product_Widget');
register_widget('TST_Social_Links');
//register_widget('TST_Related_Widget');
}
示例14: recent_comments
function recent_comments()
{
unregister_widget('WP_Widget_Recent_Comments');
$widget_ops = array('classname' => 'recent-comments', 'description' => __('The most recent comments.', 'yit'));
$control_ops = array('id_base' => 'recent-comments');
WP_Widget::__construct('recent-comments', __('Recent Comments', 'yit'), $widget_ops, $control_ops);
}
示例15: true_remove_default_widget
function true_remove_default_widget()
{
unregister_widget('WP_Widget_Archives');
// Архивы
unregister_widget('WP_Widget_Calendar');
// Календарь
unregister_widget('WP_Widget_Categories');
// Рубрики
unregister_widget('WP_Widget_Meta');
// Мета
unregister_widget('WP_Widget_Pages');
// Страницы
unregister_widget('WP_Widget_Recent_Comments');
// Свежие комментарии
unregister_widget('WP_Widget_Recent_Posts');
// Свежие записи
unregister_widget('WP_Widget_RSS');
// RSS
unregister_widget('WP_Widget_Search');
// Поиск
unregister_widget('WP_Widget_Tag_Cloud');
// Облако меток
unregister_widget('WP_Widget_Text');
// Текст
unregister_widget('WP_Nav_Menu_Widget');
// Произвольное меню
}