/** * Modify the Dashboard */ function bac_modify_dashboard() { // Remove the "Quick Draft" widget remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); // Remove the "WordPress News" widget remove_meta_box('dashboard_primary', 'dashboard', 'side'); }
/** * Remove the Person metabox from all post types. */ function remove_person_meta_box() { $post_types = get_post_types('', 'names'); foreach ($post_types as $post_type) { remove_meta_box('tagsdiv-person', '' . $post_type . '', 'side'); } }
/** * Setup the Admin menu in WordPress * * @return void */ function cx_admin_menu() { global $wp_version, $CX; // Add old style custom icon for before WP 3.8 $old_ico = version_compare($wp_version, '3.8', '<') ? CX_URL . '/assets/img/cx-ico-16.png' : ''; /** * Menu for Admins */ if (current_user_can('manage_options')) { add_menu_page($CX->meta['Name'], 'Chat X', 'manage_options', 'chat_x', 'cx_console_template', $old_ico, '50.9874'); /** * Menu for Operators */ } else { if (current_user_can('answer_visitors')) { add_menu_page($CX->meta['Name'], 'Chat X', 'cx_op', 'chat_x', 'cx_console_template', $old_ico, '50.9874'); } } /** * Add submenus */ // Chat Logs add_submenu_page('chat_x', __('Chat Logs', 'cx'), __('Chat Logs', 'cx'), 'manage_options', 'cx_chat_logs', 'cx_render_chat_logs'); // Offline Messages add_submenu_page('chat_x', __('Offline messages', 'cx'), __('Offline messages', 'cx'), 'manage_options', 'edit.php?post_type=cx_offline_msg'); /*add_submenu_page( 'chat_x', __( 'Predefined messages', 'cx' ), __( 'Predefined messages', 'cx' ), 'manage_options', 'edit.php?post_type=cx_predefined_msg' );*/ // Remove publish box some post types remove_meta_box('submitdiv', 'cx_offline_msg', 'side'); }
/** * Remove unnecessary dashboard widgets * * @link http://www.deluxeblogtips.com/2011/01/remove-dashboard-widgets-in-wordpress.html */ function remove_dashboard_widgets() { remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); remove_meta_box('dashboard_plugins', 'dashboard', 'normal'); remove_meta_box('dashboard_primary', 'dashboard', 'normal'); remove_meta_box('dashboard_secondary', 'dashboard', 'normal'); }
/** * Rename the 'Comments' meta box to 'User Contributed Notes' for reference-editing screens. * * @param string $post_type Post type. * @param WP_Post $post WP_Post object for the current post. */ function rename_comments_meta_box($post_type, $post) { if (is_parsed_post_type($post_type)) { remove_meta_box('commentsdiv', $post_type, 'normal'); add_meta_box('commentsdiv', __('User Contributed Notes', 'wporg'), 'post_comment_meta_box', $post_type, 'normal', 'high'); } }
/** * Remove bloat */ public function remove_meta_boxes() { remove_meta_box('commentsdiv', 'wc_crm_accounts', 'normal'); remove_meta_box('woothemes-settings', 'wc_crm_accounts', 'normal'); remove_meta_box('commentstatusdiv', 'wc_crm_accounts', 'normal'); remove_meta_box('slugdiv', 'wc_crm_accounts', 'normal'); }
/** * Removes the WPSEO metabox from product listing edit screen * The title and description is managed from WPSEO settings */ function product_listing_remove_wpseo() { $id = get_product_listing_id(); if (is_admin() && isset($_GET['post']) && $_GET['post'] == $id) { remove_meta_box('wpseo_meta', 'page', 'normal'); } }
/** * Remove the default Custom Fields meta box */ function removeDefaultCustomFields($type, $context, $post) { foreach (array('normal', 'advanced', 'side') as $context) { remove_meta_box('postcustom', 'post', $context); remove_meta_box('pagecustomdiv', 'page', $context); } }
/** * Removes unnecessary metaboxes. * * @return void */ function cp_setup_meta_box() { $remove_boxes = array('authordiv', 'postexcerpt', 'revisionsdiv', 'trackbacksdiv'); foreach ($remove_boxes as $id) { remove_meta_box($id, APP_POST_TYPE, 'normal'); } }
function doModifyAdminWidgets() { // Remove Wordpress Welcome remove_action('welcome_panel', 'wp_welcome_panel'); // Normal Widgets (Left Side) remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); // Not sure remove_meta_box('dashboard_plugins', 'dashboard', 'normal'); // Plugins Widget? remove_meta_box('dashboard_secondary', 'dashboard', 'normal'); // Not sure remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); // Removes Comments Widget? remove_meta_box('dashboard_right_now', 'dashboard', 'normal'); // Removes At a Glance remove_meta_box('dashboard_activity', 'dashboard', 'normal'); // Removes Activity remove_meta_box('woocommerce_dashboard_recent_reviews', 'dashboard', 'normal'); // Remove WooCommerce Recent Reviews // Side Widgets (Right Side) remove_meta_box('dashboard_primary', 'dashboard', 'side'); // Remove WordPress News remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); // Remove Quick Draft remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side'); // Not sure }
/** * Remove unwanted metaboxes to for the mdjm-event post type. * Apply the `mdjm_event_remove_metaboxes` filter to allow for filtering of metaboxes to be removed. * * @since 1.3 * @param * @return */ function mdjm_remove_event_meta_boxes() { $metaboxes = apply_filters('mdjm_event_remove_metaboxes', array(array('submitdiv', 'mdjm-event', 'side'), array('event-typesdiv', 'mdjm-event', 'side'), array('tagsdiv-enquiry-source', 'mdjm-event', 'side'))); foreach ($metaboxes as $metabox) { remove_meta_box($metabox[0], $metabox[1], $metabox[2]); } }
/** * Removes Wordpress default metaboxes from the page * @return void */ function appthemes_remove_orders_meta_boxes() { remove_meta_box('submitdiv', APPTHEMES_ORDER_PTYPE, 'side'); remove_meta_box('postcustom', APPTHEMES_ORDER_PTYPE, 'normal'); remove_meta_box('slugdiv', APPTHEMES_ORDER_PTYPE, 'normal'); remove_meta_box('authordiv', APPTHEMES_ORDER_PTYPE, 'normal'); }
/** * Remove the default Custom Fields meta box */ function removeDefaultCustomFields( $type, $context, $post ) { foreach ( array( 'normal', 'advanced', 'side' ) as $context ) { foreach ( $this->postTypes as $postType ) { remove_meta_box( 'postcustom', $postType, $context ); } } }
/** * Register the menu and submenus for the admin area. */ public function admin_menu() { if (isset($_GET['post_type']) && $_GET['post_type'] == 'beer') { remove_meta_box('postcustom', 'beer', 'normal'); } if (isset($_GET['post_type']) && $_GET['post_type'] == 'review') { remove_action('media_buttons', 'media_buttons'); remove_meta_box('postcustom', 'review', 'normal'); } /*add_menu_page( 'Main', 'NWM Catalog', 'manage_options', 'nwm-catalog', array($this->controller, 'main'), 'dashicons-book', '23.56' ); add_submenu_page( 'nwm-catalog', 'Categories', 'Categories CRUD', 'manage_options', 'nwm-catalog-categories', array($this->controller, 'categories') ) ; add_submenu_page( 'nwm-catalog', 'About', 'About', 'manage_options', 'nwm-catalog-about', array($this->controller, 'about') );*/ }
/** * Remove unwanted metaboxes to for the mdjm_communication post type. * Apply the `mdjm_communication_remove_metaboxes` filter to allow for filtering of metaboxes to be removed. * * @since 1.3 * @param * @return */ function mdjm_remove_communication_meta_boxes() { $metaboxes = apply_filters('mdjm_communication_remove_metaboxes', array(array('submitdiv', 'mdjm_communication', 'side'))); foreach ($metaboxes as $metabox) { remove_meta_box($metabox[0], $metabox[1], $metabox[2]); } }
function cs_remove_post_meta_boxes() { //remove_meta_box( 'submitdiv', 'dcpt', 'normal' ); remove_meta_box('edit-slug-box', 'dcpt', 'side'); remove_meta_box('edit-slug-box', 'cs_design', 'side'); //edit-slug-box }
public static function meta_boxes() { global $EM_Event, $EM_Location; //decide if it's a master event, if not then hide the meta boxes if (!empty($EM_Event) && !EM_ML::is_original($EM_Event)) { //remove meta boxes for events remove_meta_box('em-event-when', EM_POST_TYPE_EVENT, 'side'); remove_meta_box('em-event-where', EM_POST_TYPE_EVENT, 'normal'); remove_meta_box('em-event-bookings', EM_POST_TYPE_EVENT, 'normal'); remove_meta_box('em-event-bookings-stats', EM_POST_TYPE_EVENT, 'side'); remove_meta_box('em-event-group', EM_POST_TYPE_EVENT, 'side'); if (get_option('dbem_attributes_enabled', true)) { remove_meta_box('em-event-attributes', EM_POST_TYPE_EVENT, 'normal'); add_meta_box('em-event-attributes', __('Attributes', 'events-manager'), 'EM_ML_Admin::event_meta_box_attributes', EM_POST_TYPE_EVENT, 'normal', 'default'); } //add translation-specific meta boxes add_meta_box('em-event-translation', __('Translated Event Information', 'events-manager'), 'EM_ML_Admin::meta_box_translated_event', EM_POST_TYPE_EVENT, 'side', 'high'); $event = EM_ML::get_original_event($EM_Event); if ($event->event_rsvp) { add_meta_box('em-event-bookings-translation', __('Bookings/Registration', 'events-manager'), 'EM_ML_Admin::meta_box_bookings_translation', EM_POST_TYPE_EVENT, 'normal', 'high'); } } //locations, decide if it's a master location, if not then hide the meta boxes if (!empty($EM_Location) && !EM_ML::is_original($EM_Location)) { //add translation-specific meta boxes add_meta_box('em-event-translation', __('Translated Event Information', 'events-manager'), 'EM_ML_Admin::meta_box_translated_location', EM_POST_TYPE_LOCATION, 'side', 'high'); //remove other meta boxes remove_meta_box('em-location-where', EM_POST_TYPE_LOCATION, 'normal'); if (get_option('dbem_location_attributes_enabled')) { remove_meta_box('em-location-attributes', EM_POST_TYPE_LOCATION, 'normal'); add_meta_box('em-location-attributes', __('Attributes', 'events-manager'), 'EM_ML_Admin::location_meta_box_attributes', EM_POST_TYPE_LOCATION, 'normal', 'default'); } } }
function team_image_box() { // Remove the orginal "Set Featured Image" Metabox remove_meta_box('postimagediv', 'team', 'side'); // Add it again with another title add_meta_box('postimagediv', __('Team Member Image', 'kula'), 'post_thumbnail_meta_box', 'team', 'side', 'low'); }
add_action('admin_enqueue_scripts', array(__CLASS__, 'register_admin_scripts')); } static function remove_dashboard_widgets() { $remove_defaults_widgets = array('dashboard_incoming_links' => array('page' => 'dashboard', 'context' => 'normal'), 'dashboard_right_now' => array('page' => 'dashboard', 'context' => 'normal'), 'dashboard_recent_drafts' => array('page' => 'dashboard', 'context' => 'side'), 'dashboard_quick_press' => array('page' => 'dashboard', 'context' => 'side'), 'dashboard_plugins' => array('page' => 'dashboard', 'context' => 'normal'), 'dashboard_primary' => array('page' => 'dashboard', 'context' => 'side'), 'dashboard_secondary' => array('page' => 'dashboard', 'context' => 'side'), 'dashboard_recent_comments' => array('page' => 'dashboard', 'context' => 'normal'), 'rg_forms_dashboard' => array('page' => 'dashboard', 'context' => 'normal')); foreach ($remove_defaults_widgets as $wigdet_id => $options) { remove_meta_box($wigdet_id, $options['page'], $options['context']);
function recipress_remove_taxonomy_boxes() { remove_meta_box('tagsdiv-ingredient', recipress_post_type(), 'side'); remove_meta_box('tagsdiv-cuisine', recipress_post_type(), 'side'); remove_meta_box('tagsdiv-course', recipress_post_type(), 'side'); remove_meta_box('tagsdiv-skill_level', recipress_post_type(), 'side'); }
function sd_remove_vc_boxes() { $post_types = get_post_types('', 'names'); foreach ($post_types as $post_type) { remove_meta_box('vc_teaser', $post_type, 'side'); } }
/** * Set dashboard widget options. */ function _mw_adminimize_dashboard_setup() { // exclude super admin if (_mw_adminimize_exclude_super_admin()) { return; } $user_roles = _mw_adminimize_get_all_user_roles(); $disabled_dashboard_option_ = array(); foreach ($user_roles as $role) { $disabled_dashboard_option_[$role] = _mw_adminimize_get_option_value('mw_adminimize_disabled_dashboard_option_' . $role . '_items'); } foreach ($user_roles as $role) { if (!isset($disabled_dashboard_option_[$role]['0'])) { $disabled_dashboard_option_[$role]['0'] = ''; } } // Get all widgets. $widgets = _mw_adminimize_get_dashboard_widgets(); // Get current user data. $user = wp_get_current_user(); foreach ($user_roles as $role) { if (is_array($user->roles) && is_array($disabled_dashboard_option_[$role]) && in_array($role, $user->roles) && _mw_adminimize_current_user_has_role($role)) { foreach ($disabled_dashboard_option_[$role] as $widget) { if (isset($widgets[$widget]['context'])) { remove_meta_box($widget, 'dashboard', $widgets[$widget]['context']); } } } } }
function folio_remove_vc_custom_teaser() { $post_types = get_post_types('', 'names'); foreach ($post_types as $post_type) { remove_meta_box('vc_teaser', $post_type, 'side'); } }
/** * add_meta_boxes function. */ public function add_meta_boxes() { add_meta_box('job_application_save', __('Save Application', 'wp-job-manager-applications'), array($this, 'job_application_save'), 'job_application', 'side', 'high'); add_meta_box('job_application_data', __('Job Application Data', 'wp-job-manager-applications'), array($this, 'job_application_data'), 'job_application', 'normal', 'high'); add_meta_box('job_application_notes', __('Application Notes', 'wp-job-manager-applications'), array($this, 'application_notes'), 'job_application', 'side', 'default'); remove_meta_box('submitdiv', 'job_application', 'side'); }
function remove_metaboxes() { /* Posts */ remove_meta_box('authordiv', 'post', 'normal'); // Author Metabox remove_meta_box('commentstatusdiv', 'post', 'normal'); // Comments Status Metabox remove_meta_box('commentsdiv', 'post', 'normal'); // Comments Metabox remove_meta_box('postexcerpt', 'post', 'normal'); // Excerpt Metabox remove_meta_box('revisionsdiv', 'post', 'normal'); // Revisions Metabox remove_meta_box('slugdiv', 'post', 'normal'); // Slug Metabox remove_meta_box('trackbacksdiv', 'post', 'normal'); // Trackback Metabox /* Pages */ remove_meta_box('postexcerpt', 'page', 'normal'); // Excerpt Metabox remove_meta_box('commentstatusdiv', 'page', 'normal'); // Comments Metabox remove_meta_box('trackbacksdiv', 'page', 'normal'); // Talkback Metabox remove_meta_box('slugdiv', 'page', 'normal'); // Slug Metabox remove_meta_box('authordiv', 'page', 'normal'); // Author Metabox }
function slider_image_box() { // Remove the orginal "Set Featured Image" Metabox remove_meta_box('postimagediv', 'slider', 'side'); // Add it again with another title add_meta_box('postimagediv', __('Slide Image', 'nash'), 'post_thumbnail_meta_box', 'slider', 'side', 'low'); }
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 remove_meta_box('wpseo-dashboard-overview', 'dashboard', 'normal'); remove_meta_box('rg_forms_dashboard', 'dashboard', 'normal'); //gravityforms remove_meta_box('auth0_dashboard_widget_age', 'dashboard', 'normal'); remove_meta_box('auth0_dashboard_widget_gender', 'dashboard', 'normal'); remove_meta_box('auth0_dashboard_widget_income', 'dashboard', 'normal'); remove_meta_box('auth0_dashboard_widget_signups', 'dashboard', 'normal'); remove_meta_box('auth0_dashboard_widget_Location', 'dashboard', 'normal'); remove_meta_box('auth0_dashboard_widget_idp', 'dashboard', 'normal'); // We're using add_meta_box() instead of wp_add_dashboard_widget() so we can set positioning // http://wordpress.stackexchange.com/questions/69729/dashboard-widget-custom-positioning add_meta_box('dashboard_proud_welcome', 'Make your city proud', array($this, 'checklist'), 'dashboard', 'normal', 'high'); add_meta_box('dashboard_proud_video', 'Player', array($this, 'video'), 'dashboard', 'side', 'high'); add_meta_box('dashboard_proud_help', 'Get help', array($this, 'help'), 'dashboard', 'side', 'high'); add_meta_box('dashboard_proud_news', 'Recent news', array($this, 'news'), 'dashboard', 'side', 'high'); }
function hide_meta_boxes() { remove_meta_box('postcustom', 'post', 'normal'); // custom fields post remove_meta_box('postcustom', 'page', 'normal'); // custom fields page //remove_meta_box('commentstatusdiv','post','normal'); // discussion post remove_meta_box('commentstatusdiv', 'page', 'normal'); // discussion page //remove_meta_box('commentsdiv','post','normal'); // comments post //remove_meta_box('commentsdiv','page','normal'); // comments page //remove_meta_box('authordiv','post','normal'); // author post remove_meta_box('authordiv', 'page', 'normal'); // author page //remove_meta_box('revisionsdiv','post','normal'); // revisions post //remove_meta_box('revisionsdiv','page','normal'); // revisions page //remove_meta_box('postimagediv','post','normal'); // featured image post remove_meta_box('postimagediv', 'page', 'normal'); // featured image page //remove_meta_box('pageparentdiv','page','normal'); // page attributes //remove_meta_box('tagsdiv-post-tag','post','normal'); // post tags //remove_meta_box('categorydiv','post','normal'); // post categories //remove_meta_box('postexcerpt','post','normal'); // post excerpt remove_meta_box('trackbacksdiv', 'post', 'normal'); // track backs }
function disable_default_dashboard_widgets() { // remove_meta_box('dashboard_right_now', 'dashboard', 'core'); // Right Now Widget remove_meta_box('dashboard_recent_comments', 'dashboard', 'core'); // Comments Widget remove_meta_box('dashboard_incoming_links', 'dashboard', 'core'); // Incoming Links Widget remove_meta_box('dashboard_plugins', 'dashboard', 'core'); // Plugins Widget // remove_meta_box('dashboard_quick_press', 'dashboard', 'core'); // Quick Press Widget remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core'); // Recent Drafts Widget remove_meta_box('dashboard_primary', 'dashboard', 'core'); // remove_meta_box('dashboard_secondary', 'dashboard', 'core'); // // removing plugin dashboard boxes remove_meta_box('yoast_db_widget', 'dashboard', 'normal'); // Yoast's SEO Plugin Widget /* have more plugin widgets you'd like to remove? share them with us so we can get a list of the most commonly used. :D https://github.com/eddiemachado/bones/issues */ }
/** Remove dashboard widgets */ function olab_remove_dashboard_widgets() { remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side'); remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); }