Tag Info

Hot answers tagged

24

Another solution is to add the columns setting back to the settings. function wpse126301_dashboard_columns() { add_screen_option( 'layout_columns', array( 'max' => 2, 'default' => 1 ) ); } add_action( 'admin_head-index.php', 'wpse126301_dashboard_columns' ); There is a related Trac ...


14

No need to use one or two plugins for such small task... To remove the Help Tab use add_filter( 'contextual_help', 'mytheme_remove_help_tabs', 999, 3 ); function mytheme_remove_help_tabs($old_help, $screen_id, $screen){ $screen->remove_help_tabs(); return $old_help; } Or add_action('admin_head', 'mytheme_remove_help_tabs'); function ...


11

What you need is in global $wp_meta_boxes indexed by get_current_screen()->id. Removing the screen options will also remove the metaboxes which you can do just before screen options are displayed using the 'in_admin_header' hook. So let's assume you want to get rid of the "Send Trackbacks" screen option which you see in this screenshot: Drop the ...


7

What you need is to modify the $columns variable that is used during list display which you can modify using the 'manage_posts_columns' and 'manage_pages_columns' hooks for post_type='post' and post_type='page', respectively. If you want to ignore custom post types you can inspect the 2nd parameter passed to 'manage_posts_columns' as I did in my example to ...


7

Go to Screen Options at the top, and change the number to something like 200. I don't think it will survive much more than that.


7

This happens because of the new media queries. A very unfortunate change … Anyway, you can change it by setting a custom width for .postbox-container. Use 50% for two columns and 100 % for just one column. add_action( 'admin_head-index.php', function() { ?> <style> .postbox-container { min-width: 100% !important; } ...


6

Whenever we find ourselves in the situation "there must be a way to overcome this hard-code", jQuery comes to rescue... The Result The Code The following code must be pasted at the end of the active Theme functions.php file. Or it can be used in a custom plugin, which will make the code "theme-independent". add_action('admin_head-index.php', ...


5

Go to edit/create a page or post in wp-admin at the top is a "Screen Options" panel link, here you can enable custom fields for that particular page or post. The number of metaboxes displayed by default was reduced in 3.1. If you want to change the default for all users you can hook into the default_hidden_meta_boxes filter.


4

The meta box order gets stored in the user meta and is basically an array of "priority" and meta box id. I didn't check if this meta key gets generated upon user setup or when the first manual reordering occurs. To see how this array looks, and how the native WP metaboxes IDs on a page (post, cpt) are, you can var_dump the following: ...


3

You need to use the filter 'manage_' . $screen->id . '_columns' to add a column and manage_users_custom_column to display its value. add_filter( 'manage_users_columns', 'column_register_wpse_101322' ); add_filter( 'manage_users_custom_column', 'column_display_wpse_101322', 10, 3 ); function column_register_wpse_101322( $columns ) { $columns['uid'] ...


3

You don’t need to invent a new screen option row. Just use proper metaboxes. Currently, you are drawing pseudo-metaboxes: <!-- Post status start--> <div class = "postbox"> <div class = "handlediv"> <br> </div> <h3 class = "hndle"><span><?php _e("By Post Status", 'bulk-delete'); ...


3

You can remove (turn-off) the Welcome screen by using any of these two options: Single: add_action( 'load-index.php', 'hide_welcome_screen' ); function hide_welcome_screen() { $user_id = get_current_user_id(); if ( 1 == get_user_meta( $user_id, 'show_welcome_panel', true ) ) update_user_meta( $user_id, 'show_welcome_panel', 0 ); } ...


3

They do work across many computers, as long as you're logged in with the same username. If they don't, try clearing your browser cache.


3

It won't be very hard to do. Just add this to your functions.php or into your plugin: function my_edit_per_page( $result, $option, $user ) { if ( (int)$result < 1 ) return 20; // or whatever you want } add_filter( 'get_user_option_edit_page_per_page', 'my_edit_per_page', 10, 3 ); // for pages add_filter( 'get_user_option_edit_post_per_page', ...


3

I don't know exactly what you are trying to accomplish but you seem to be dealing with meta boxes. If so there are a number of meta box specific hooks. do_action('add_meta_boxes', $post_type, $post); do_action('add_meta_boxes_' . $post_type, $post); do_action('do_meta_boxes', $post_type, 'normal', $post); do_action('do_meta_boxes', $post_type, 'advanced', ...


3

For WordPress 3.5+, adding remove_action( 'welcome_panel', 'wp_welcome_panel' ); to your functions.php removes the Welcome Panel from the Dashboard as well as its Screen Options menu. See http://codex.wordpress.org/Plugin_API/Action_Reference/welcome_panel.


3

There is no way, at least to my knowledge to unset an option from the screen options panel without unsetting the actual metabox itself. My suggestion would be to target these screen options item via your CSS and hide it from view. Add this to your plugin or functions file. Don't forget to update 'METABOXIDNAME' with the ID name of your metabox. ...


3

You can use the capabilities API to conditionally set screen options: if ( current_user_can( 'manage_options' ) ) { // Administrator, add some options } else { // Other roles, do something different }


2

I assume, you need something like editors can't see the category column or something like this. This snippet might help you: /** Remove "Options"-Panel, when User is not admin **/ add_filter( 'manage_posts_columns', 'change_columns_for_user', 10, 2 ); function change_columns_for_user( $columns, $post_type ){ if( 'post' != $post_type ) return ...


2

I have accepted the @websupporter answer according to my question. However I would like add few codes to specific question I have faced earlier. I need to remove Yoast SEO plugin extra columns from the non admin users. In that specific case Yoast SEO provide the hook to disable the columns. So I used that as below. /** Remove SEO columns when User is not ...


2

Yes, it is too early. Check http://codex.wordpress.org/Function_Reference/get_current_screen for examples of usage.


2

It's a bug: http://core.trac.wordpress.org/ticket/18958


2

Per default some meta boxes are hidden. These boxes are stored in an array which you can find in wp-admin/includes/template.php#get_hidden_meta_boxes(). There is a filter, and therefore a chance for a plugin: <?php # -*- coding: utf-8 -*- /* Plugin Name: Enable Custom Fields per Default Version: 1.0 Required: 3.1 Author: Thomas Scholz Author ...


2

You can hide the Welcome checkbox using some simple CSS: [for="wp_welcome_panel-hide"] { display: none !important; } To add the CSS code to your WP-ADMIN pages, simply add this in your theme's functions.php file before the last ?>: function my_custom_admin_head() { echo '<style>[for="wp_welcome_panel-hide"] {display: none ...


2

This option is stored in the wp_usermeta table with the meta_key name of metaboxhidden_nav-menus. If we hide all the boxes, this is the meta_value of the option: array( "nav-menu-theme-locations", "add-custom-links", "add-post", "add-page", "add-portfolio", "add-category", "add-post_tag", "add-post_format", ...


2

You can remove the panel and the checkbox for it by getting rid of the 'welcome_panel' action. add_action( 'wp_dashboard_setup', 'remove_welcome_panel' ); function remove_welcome_panel() { global $wp_filter; unset( $wp_filter['welcome_panel'] ); }


2

You can do it, by using the proper filter inside the \WP_Screen class. Just make sure that you don't switch it on per default: How to show or hide the tab The following filter shows how to show or hide the tab. Actually, as there is a better filter, the following way is of more use if you need to force hide the tab when it already exists: add_filter( ...


1

Screen options are server side admin options, not client side. Use different WP accounts to vary the screen options displayed.


1

Based on this Answer by t31os. Here, all meta boxes are being set to invisible, so simply remove from the array the ones that are meant to be visible. add_action('user_register', 'wpse_58645_set_user_metaboxes'); function wpse_58645_set_user_metaboxes( $user_id ) { update_user_meta( $user_id, 'metaboxhidden_post', array( ...


1

Thanks @guiniveretoo, perfect :) Finally this is how I did (this code is used for the menu page screen options): /* Just use to find your screen_id */ add_filter('current_screen', 'the_current_screen' ); function the_current_screen($screen) { if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) return $screen; print_r($screen); return $screen; ...



Only top voted, non community-wiki answers of a minimum length are eligible