WordPress.org

Ready to get started?Download WordPress

Forums

Disable some screen option widgets (5 posts)

  1. Dave Redfern
    Member
    Posted 3 years ago #

    Hello,

    Is it possible to disable some widgets/boxes on the edit pages such as custom fields?

    I know I can do the following to disable widgets on the dashboard and was wondering whether there was something similar for the ones of the edit/add page views.

    function remove_dashboard_widgets() {
    	global $wp_meta_boxes;
    	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
    	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
    	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
    	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
    	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
    	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
    	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
    }
    add_action('wp_dashboard_setup', 'remove_dashboard_widgets');

    Thanks in advance.

    Dave.

  2. carmeljune
    Member
    Posted 3 years ago #

    Sorry, I don't know about the code but this plugin works well for controlling widgets: TS Custom Widgets v2.0 WP Plugin

  3. Mark / t31os
    Moderator
    Posted 3 years ago #

    See the codex entry for remove_meta_box.
    http://codex.wordpress.org/Function_Reference/remove_meta_box

    Examples are given on the page above.

  4. Dave Redfern
    Member
    Posted 3 years ago #

    Excellent. Thank you very much Mark :)

  5. Mark / t31os
    Moderator
    Posted 3 years ago #

    You're welcome.. :)

Topic Closed

This topic has been closed to new replies.

About this Topic