Thanks for very handy plugin! I’m looking for a way to hide the dashboard widget from everyone but the site admin. I have tried the following code, without success:
add_action('wp_dashboard_setup', 'jr_mss_hide_widget_on_dashboard');
function jr_mss_hide_widget_on_dashboard() {
global $pagenow;
if (!is_admin() || $pagenow !== 'index.php') {
return;
}
if (!current_user_can('administrator')) {
remove_meta_box('simple_space_widget', 'dashboard', 'side');
}
}
I have also tried the above code with the ‘admin_init’ hook, with the same (unsuccessful) result. Is it at all possible to hide the widget from specific user roles?
Thanks.
Edit: …aaand, it turns out, all I had to do was to add a priority argument, like this:
add_action('wp_dashboard_setup', 'jr_mss_hide_widget_on_dashboard', 999);
function jr_mss_hide_widget_on_dashboard() {
global $pagenow;
if (!is_admin() || $pagenow !== 'index.php') {
return;
}
if (!current_user_can('administrator')) {
remove_meta_box('simple_space_widget', 'dashboard', 'side');
}
}
I really should explore things more carefully before I ask questions in the forum, hehe. Thanks again for a neat plugin!
/jenny
]]>I find it very confusing for users, when untagged posts show all kinds of popular tags in the sidebar.
Is there an option to hide the widget for untagged posts? I couldn’t find one.
Cheers
Shnipsel
PS: Great looking plugin … happy I found it anyway.
]]>Thanks
]]>I’m creating a free membership level (PMPro) on my site which has limited access to site (no private BP messaging) and I would like to hide the Flyzoo widget so they can’t communicate with users online in chat. Is that something you could help with? Basically line of code I could put into functions.php to exclude that level from seeing the widget.
Thank you
]]>.page-id-1394 .sidebar-after-main-content, .sidebar-before-main-content {
display: none !important;
}
Thank you!
Katie
I have been using your plugin for sometimes, thanks very much, it is great !
I need the widget not to display on one specific page. of course I could hide it with css (display:none;), but I presume there must be some better and cleaner way to do this.
May you help ?
Thanks
]]>I want one that just hides, I would then add an IF statement to hide it on a condition.
I have shortcodes in my widget to display custom fields, and sometimes the custom fields are empty, so I don’t want it to display if they are empty. The widget itself isn’t empty though because it has the shortcodes so the existing hook above doesn’t work for me.
Thanks
]]>Anything like “is_amp” or something? This would be in conjunction with the free “AMP” plugin by Automattic.
]]>