Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove "Right Now in Forums" widget form dashboard programatically


  • t.sjogren
    Participant

    @tsjogren

    Hi

    I am trying to remove the “Right Now in Forums” with a function but i donĀ“t know hoe to target it. Someone how knows?

    Code below:

    
    function disable_default_dashboard_widgets() {
    
        // Right Now Widget
    
        remove_meta_box('dashboard_right_now', 'dashboard', 'core');
    
        // Comments Widget
        remove_meta_box('dashboard_recent_comments', 'dashboard', 'core');
    
        // Incoming Links Widget
    
        remove_meta_box('dashboard_incoming_links', 'dashboard', 'core');
    
    
        // Plugins Widget
    
        remove_meta_box('dashboard_plugins', 'dashboard', 'core');
    
    
        // Quick Press Widget
    
        remove_meta_box('dashboard_quick_press', 'dashboard', 'core');
    
    
        // Recent Drafts Widget
    
    
        remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core');
    
    
        // WordPress Blog Feed
    
        remove_meta_box('dashboard_primary', 'dashboard', 'side');
    
    
        // Other WordPress News
    
    
        remove_meta_box('dashboard_secondary', 'dashboard', 'side');
    
    
    // bbPress widget 'Right Now in Forums'bbp-dashboard-right-now
    // *******Does not work right now *******//    
    remove_meta_box('bbp_dashboard_right_now', 'dashboard', 'core');}
    
    if (!current_user_can('manage_options')) {
        add_action('wp_dashboard_setup', 'disable_default_dashboard_widgets');
    
    }  
    
Viewing 3 replies - 1 through 3 (of 3 total)

  • Juanfrito
    Participant

    @juanfrito

    Hi, I know this post is quite old, but just in case you didn’t find it, heres the solution:

    change bbp_dashboard_right_now and write bbp-dashboard-right-now


    Verra
    Participant

    @nguyenkinh

    Exactly what I want, thanks!


    kamronk
    Participant

    @kamronk

    For others I was able to remove the widget by adding the following line to [wp docroot]/wp-admin/includes/dashboard.php

    remove_meta_box('bbp-dashboard-right-now', 'dashboard', 'core');
    

    Specifically line 55, just above the line

    // WordPress News
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar