WidgetOptions / widget-options

Additional Widget options for better widget control. Available on
https://widget-options.com/
GNU General Public License v3.0
35 stars 16 forks source link

Display Widget Logic for Super Admins only on Multisite #10

Closed Surbma closed 6 years ago

Surbma commented 7 years ago

Hi,

I have a lot of Multisite installs with hundreds of websites running on them. Mostly client websites. I don't allow them to modify any code, so the installation remain safe.

The Display Widget Logic option allows them to write any PHP code, which is not a good idea in a Multisite install.

Please add a condition for the Display Widget Logic to show this only for Super Admins, if it is a Multisite install. It is very easy to add this using the unfiltered_html capability, which belongs only to Super Admins if it is a Multisite, but belongs to the normal Admin on a normal install.

This capability is meant to be used in these very situations, so please add this feature, Multisite owners will love this move. :)

Thank you!

phpbits commented 7 years ago

Hi,

Thank you very much for the plugin feature suggestion. For the meantime you can hide the Display Logic via css using this function:

add_action('admin_print_styles-widgets.php', 'widgetopts_hide_logic' );
function widgetopts_hide_logic(){
    if ( !is_super_admin() ){ ?>
        <style>
        .extended-widget-opts-settings-tab-logic {
            display: none !important;
        }
        </style>
    <?php }
}

Let me know how it goes. Thanks!

Cheers, Jeffrey