WordPress.org

Ready to get started?Download WordPress

Forums

Download Monitor
[resolved] Hide Dashboard Widget (2 posts)

  1. define3d
    Member
    Posted 3 years ago #

    Hello there,
    Thanks for this wonderful plugin.
    I want to remove the dashboard widget for all of my site users except the admin. I can remove default wordpress widgets on my dashboard but i've no idea how to hide download stats and top 5 downloads from dashboard.

    hope to hear shortly on this..
    Thanks

  2. define3d
    Member
    Posted 3 years ago #

    I've figured it out. We need to add following lines to the functions.php file -->

    function remove_dashboard_widgets() {

    global $wp_meta_boxes;

    unset($wp_meta_boxes['dashboard']['normal']['core']['dlm_download_stats_widget']);
    unset($wp_meta_boxes['dashboard']['normal']['core']['dlm_download_top_widget']);

    }

    if (!current_user_can('manage_options')) {
    add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );
    }
    ?>

    :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic