You can check the value of the post_status
query variable and make sure that it’s set to trash
:
function wpse239286_trash_column( $columns ) {
// Bail if we're not looking at trash.
$status = get_query_var( 'post_status' );
if ( 'trash' !== $status ) {
return $columns;
}
return array_merge( $columns,
array( 'trash_column' => __( 'Trash Column', 'text-domain' ) )
);
}
add_filter( 'manage_posts_columns' , 'wpse239286_trash_column' );
add_filter( 'manage_pages_columns' , 'wpse239286_trash_column' );
Related Posts:
- Replacing select2 in admin backend for all selects
- Move ‘current-menu-item’ class on #adminmenu li from Posts to Pages for Taxonomy Edit Screen
- Adding fields to the “Add New User” screen in the dashboard
- How do I get the current edit page ID in the admin?
- Displaying the number of updates available in the Admin area
- What’s the difference between admin_url() and get_admin_url() functions?
- Custom column for changing post status via ajax
- How to influence the information displayed on widget inside wp-admin
- Modify Admin Bar Link
- How to override admin-bar style
- TinyMCE custom styles remove class when switching styles
- How to remove row-actions from pages table?
- Is it possible to remove the main rich Text box editor?
- How to add custom columns to Custom Post Type admin screen
- How do I create a new WP admin color scheme?
- Add admin bar link to edit author
- AJAX handler throws 400 (Bad request) – why?
- wp-admin page is blank
- Make sub menu items a main link in the admin menu using fuctions.php
- difference between add_object_page and add_menu_page
- How to fix a theme with page.php Default Template that accidentally deleted?
- echo or print_r in an admin function
- Target a certain page within wordpress backend (admin) i.e. Pages > About
- Can I remove the Rich Text box editor for a specific post?
- How can I rename the WordPress AJAX URL? [duplicate]
- Comments to only be seen by their author
- How to change menu icon which is overriden (i.e. by WooCommerce) [closed]
- How to test for Super Admin
- Custom roles can’t access to wp-admin
- password protected post policy
- Removing the main link to Jetpack from the menu
- How to select a page within admin?
- Access / Filter block variations in Gutenberg, in WordPress 5.6
- How to remove howdy dropdown menu content
- Change Admin Bar “Visit Site” URL
- Add Featured image column into wordpress admin on pages AND posts
- Selective Product Category for Carousel
- How to Display Frontend CSS for Administrator only
- Hard-coding custom menu elements for menu manager
- How to make custom column Admin>Users sortable?
- Trigger a custom function when option are saved in admin area
- How to force field validation first, then its values saved durning edit profile?
- How to auto refresh when user change postcode
- Force to use STRONG users password and implement rule to prevent REUSE [closed]
- Sections and tabs DRY – WordPress settings API
- How to install Segment on WordPress without a plugin
- Get First Child Page ID or Permalink in WordPress Admin
- Creating A New Admin Menu Tab For Theme Options
- wp-admin won’t load after setting wp-login custom url
- Wp admin – Set default value to 999 in comments
- Remove “Published On” inside wp-admin
- Where do i create my own function in wp-admin
- How to remove comment count column in Posts inside the admin dashboard?
- What is the text that appears beside the page titles in the list of pages in the WP admin?
- Sortable column (by numbers) in admin users
- error at login page in wordpress
- Logout Redirect and also WP-login.php Redirect
- what is best way to keep track of changes made in wordpress website? [closed]
- Update to functions.php not showing in dashboard
- WordPress wraps span tags into p tags
- Add element to widgetpage
- Best way to disable sidebars on posts (only)?
- “options.php” not found
- Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?
- Sorting custom post types in edit.php : Post disappear
- How to change a specific admin label
- How to change a meta value (of a published post) after X days.?
- Removing WPML Items From the WordPress Admin Bar
- sort metabox columns in listing Single
- Show metadata in users.php – wordpress
- Block all plug-ins from initiating redirection upon activation?
- How to add custom metakey to shop_order page’s searching function?
- How to display my comment count in the wordpress admin bar?
- Unable to login after registration
- Insert Modal on user first login
- Access to “My Site” is missing from the admin bar
- WP Enqueue Script Error
- DISABLE wordpress upgrade page
- HowTo: Add wrapper to columns shortcode?
- admin-ajax.php & my wp-admin folder url showing in header
- Multisite Admin Roles
- What is wrong with functions.php? Fills error log with same error
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- function to return comma separated list of meta values
- Screen Options WordPress WYSIWYG
- Show parent-child relationship for categories in the wordpress admin
- Changed functions.php file and now site is blank [closed]
- sort by date in users
- Setcookie not setting cookies anywhere except admin
- How to create thumbnails for PDF uploads?
- Creating a table from shortcode avoiding wpautop for each row
- wp_register_script not loading as expected
- How can I add an image field to BuddyPress Extended Profile Fields? [closed]
- Override a theme function in a child theme?
- Include default functions and methods
- I can’t add CSS with functions.php
- Register_Sidebar overwriting itself and doesn’t exist in global $wp_registered_sidebars;
- widgets not working
- hook for dashboard show_user_profile
- Load WP Admin scripts in a child theme functions file