set role specific screen options in post summary page

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 $columns; if( current_user_can( ‘manage_options’ ) ) return $columns; … Read more

Hide some items from Screen options in dashboard for products

The best option would be to use CSS to hide these columns and fields. Add this in your admin.css file to hide the SKU column table.wp-list-table .column-sku { width: 10% } To hide options in Screen Options add the following CSS in admin.css .metabox-prefs label:nth-child(2), .metabox-prefs label:nth-child(11), .metabox-prefs label:nth-child(12) { display: none; } FYI to … Read more

check for the current screen

Those variables and functions only exist in the admin area, and aren’t for frontend use. You will need to use a different mechanism for the frontend. Additionally: the docs say that you have to call this after the admin_init hook, calling on that hook will always return null the function is not loaded on all … Read more

Change default screen option value for posts per page

Just an addiction to @KrzysiekDróżdż answer. When viewing a specific post status the url query string variable ‘post_status’, is set to the name of the status, so you can use $_GET[‘post_status’] to narrow the effect of @KrzysiekDróżdż code only for pending posts: function my_edit_per_page( $result, $option, $user ) { $status = filter_input( INPUT_GET, ‘post_status’, FILTER_SANITIZE_STRING … Read more

How to set default metaboxes on user creation?

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( ‘authordiv’, ‘categorydiv’, ‘commentstatusdiv’, ‘formatdiv’, ‘postcustom’, ‘postexcerpt’, ‘postimagediv’, ‘slugdiv’, ‘tagsdiv-post_tag’, ‘trackbacksdiv’, ) ); } For registered … Read more

Showing user ID on user main page from screen options

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’] = ‘ID’; return $columns; } function column_display_wpse_101322( $empty, $column_name, $user_id ) { if ( ‘uid’ != $column_name ) … Read more

Remove Category description textarea

/*remove term descriptions from post editor */ function wpse_hide_cat_descr() { ?> <style type=”text/css”> .term-description-wrap { display: none; } </style> <?php } add_action( ‘admin_head-term.php’, ‘wpse_hide_cat_descr’ ); add_action( ‘admin_head-edit-tags.php’, ‘wpse_hide_cat_descr’ ); If you need to target it to category editor only – in other words leave description for other taxonomies, then easiest will be to position the … Read more

techhipbettruvabetnorabahisbahis forumutaraftarium24edueduedueduedusedueduseduseduedus