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".
-
i tried searching for it a lot.....but i could not find anything– Shahrukh KhanFeb 19, 2015 at 15:29
-
2Please 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 GardFeb 19, 2015 at 15:33
2 Answers
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' );
-
-
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. Feb 20, 2015 at 9:58
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' );