• Resolved Abland

    (@abland)


    In case this is useful to others, I have some widgets that I don’t want made available to the site admin. They’re widgets created by specific plugins and somewhat “immune” to being deregistered. I have them removed from the admin widgets page but removing them from Panels needed some plugin edits.

    In the file: siteorigin-panels/tpl/metabox-panels.php

    Line 36 find:
    <li class=”panel-type”
    and change to:
    <li class=”panel-type” id=”<?php echo esc_attr($class) ?>”

    Then above <ul class=”panel-type-list”> add style rules to hide those id’s

    <style type=”text/css”>
    #one_type_widget,
    #another_type_widget,
    #yet_another_type {
    display: none !important;
    }
    </style>

    Whichever widget id’s you want to hide add them to the style rule. Normally I don’t like editing the plugins because of updates but sometimes it’s needed. I always write my edits in a text file so when I update the plugin I re-add the edits accordingly.

    https://wordpress.org/plugins/siteorigin-panels/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Greg – SiteOrigin

    (@gpriday)

    Hi Abland

    You can remove any widgets from being displayed in Page Builder by using the filter.

    function mytheme_panels_widgets( $widgets ){
    	unset($widgets['The_Widget_Class']);
    	return $widgets;
    }
    add_filter( 'siteorigin_panels_widgets', 'mytheme_panels_widgets', 11);

    You can use this to remove any widgets you need to. The example I gave runs with priority 11, to ensure it runs after all of Page Builders functions.

    Hi Greg,

    How do I find The_Widget_Class from the different widgets?

    Plugin Support Andrew Misplon

    (@misplon)

    Hi zkagen

    There might be a better way but one way is to head to /plugins/siteorigin-panels/widgets/widgets open the widget in question, check for example animated-image.php, the class is:

    SiteOrigin_Panels_Widget_Animated_Image

    Hope that helps.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Hiding specific widgets’ is closed to new replies.