1

i want to remove screen options from wordpress admin panel and remove default dashboard items and add quick draft widget in dashboard for custom post type "gallery". enter image description here

2
  • i tried searching for it a lot.....but i could not find anything Feb 19, 2015 at 15:29
  • 2
    Please post what you have searched for in your question. It may be that you don't know the proper termonology to search for, and someone can point you in the right direction. But as it stands, this question looks like you are saying "someone do this for me", and that is not what this site is about. I again ask you to please vist How do I ask a good question?.
    – David Gard
    Feb 19, 2015 at 15:33

2 Answers 2

1

You can remove the Screen Options with the 'screen_options_show_screen' filter.

function myplugin_disable_screen_options( $show_screen ) {
    // Logic to allow admins to still access the menu
    if ( current_user_can( 'manage_options' ) ) {
        return $show_screen;
    }
    return false;
}
add_filter( 'screen_options_show_screen', 'myplugin_disable_screen_options' );
2
  • how can we remove default dashboard widgets Feb 20, 2015 at 5:02
  • Just use remove_meta_box() with the name of the widgets. There are LOTS of examples of this as well as some plugins that will do it for you.
    – mikemanger
    Feb 20, 2015 at 9:58
9

To remove all the wordpress default items use the code given below.

function remove_dashboard_meta() {
        remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
        remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
        remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
        remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );
        remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
        remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );
        remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
        remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
        remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');//since 3.8
}
add_action( 'admin_init', 'remove_dashboard_meta' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.