• Resolved teeboy4real

    (@teeboy4real)


    Hello,

    how can I remover the widget from admin im using this now but it is now working

    function remove_dashboard_widgets() {
    global $wp_meta_boxes;

    unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_right_now’]);
    unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘sbs_dashboard_widget’]);
    unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘simple_blog_stats_logged_users_widget’]);
    unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_incoming_links’]);
    update_user_meta( get_current_user_id(), ‘show_welcome_panel’, false );
    remove_meta_box( ‘dashboard_activity’, ‘dashboard’, ‘normal’);

    }

    if (!current_user_can(‘manage_options’)) {
    add_action(‘wp_dashboard_setup’, ‘remove_dashboard_widgets’ );
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter teeboy4real

    (@teeboy4real)

    I dont want my authors who have admin access to see the stats

    Plugin Author Jeff Starr

    (@specialk)

    Glad to help. I’m not sure what that code is from/for, but it is not something that is included or used in the Simple Blog Stats plugin. If you want to show/hide content in general (like stats or whatever), check out a plugin such as Private Content:

    https://wordpress.org/plugins/private-content/

    That will enable you to show/hide whatever content on any post or page.

    Thread Starter teeboy4real

    (@teeboy4real)

    Hello that plugin is not applicable what I’m trying to hide is the stats widget in the Admin welcome dashboard page. My site has multiple authors who have admin access. I don’t want my authors to see this stats widget except for the administrator.

    That is why I inserted the stats widget ID in the code above simple_blog_stats_logged_users_widget and sbs_dashboard_widget

    Thanks

    Plugin Author Jeff Starr

    (@specialk)

    I don’t know about whatever code you are working with, so can’t help with that. But, if you want to show/hide content in general (like stats or whatever), check out a plugin such as Private Content:

    https://wordpress.org/plugins/private-content/

    That will enable you to show/hide whatever content on any post or page.

    Plugin Author Jeff Starr

    (@specialk)

    Hey @teeboy4real, I hope you got this sorted. It’s been awhile with no reply so gonna go ahead and mark this thread as resolved to help keep the forum organized. Feel free to post again with any further questions or feedback, Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘how to remove stats widget from admin’ is closed to new replies.