I don’t think there exist one, but you could create your own, wpse_empty_trash
, with something like this:
/**
* Add a custom hook 'wpse_empty_trash'
*/
add_action( 'load-edit.php', function()
{
add_action( 'before_delete_post', function ( $post_id )
{
if (
'trash' === get_post_status( $post_id )
&& filter_input( INPUT_GET, 'delete_all' )
&& 1 === did_action( 'before_delete_post ' )
)
do_action( 'wpse_empty_trash' );
} );
} );
Then you can use it with your code. Example:
add_action( 'wpse_empty_trash', 'myFunction' );
function myFunction() {
// My code
}
Hopefully you can adjust this to your needs.
Related Posts:
- how “manage_posts_custom_column” action hook relate to “manage_${post_type}_columns” filter hook?
- Get post id in wordpress action?
- Adding custom fields to bbpress reply form
- Adding buttons to Add New Post and Add New Page
- Hook To Get All Posts Deleted
- Remove Categories / Tags From Admin Menu
- Function to execute when a post is moved to trash .
- How to validate XML-RPC post creation and cancel when needed?
- Find out who deleted a page or post?
- Setting Custom Sort Order of Posts within a Category
- Custom permalink structure only for default posts
- Replace image attributes for lazyload plugin (data-src)
- Exclude drafts in all() view of edit.php
- How to publish a post with empty title and empty content?
- Any way to create a revision of a post ONLY with a new button in the Meta Box?
- How to display comments and comment form on custom post type?
- adding a custom css class to post
- Prevent duplicate posts in wp_insert_post using custom fields
- Add default content to post (for specific category)
- Custom post type single (permalink) throws a 404 error
- display order of connections
- same template for multiple custom post type single
- if custom post type exist
- How to place HTML below the title of the (custom) post overview
- How to get a nofication when post submitted
- Check Title Unique Or Not and If not error message and dont save
- .current-menu-item class on custom post type children pages – again?
- add_action not using ‘delete_post’ action with wp_delete_post
- Display page content AFTER a loop of posts
- Run a function when post is deleted?
- How can I create custom button in post.php
- how to replace embedded “full” sized images within a post with the “large” ones
- Downgrade user from role that allows post creation
- Create cron job without a plugin?
- Remove slashes (both before and after) in relative post url
- Animated gif for a thumbs
- Edit custom post type admin menu link
- I am unable to publish/update post
- How to include a post type in the admin/backend?
- Get posts of ONE taxonomy term of custom post type
- WordPress Custom Fields (Checkboxes with multiple values)
- Using custom post template
- Custom Post Archive Page not working
- WordPress custom Query for Posts in Category display posts multiple times
- Editing the default page to show all posts, rather than most recent ones
- Permission issue with custom post type – not added to menu – by plugin
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- WP Admin register taxonomy and post type performance
- Add a custom meta box in the post options that loads some html code in the header
- Static posts page with home.php
- Custom post types related to same custom post type?
- Is it possible to customize the post according to post format in single.php?
- Using setup_postdata() with multi-dimensional array
- Check if a custom post type has already been created
- How to check in functions.php if there is data in a WP_Query?
- Display the 2nd category name of a custom post type without error if its null?
- Querying another post category to match current post and display in loop
- datepicker value in mysql
- Simple Custom Metabox Not Saving
- How to restore deleted post related with deleted users
- Custom Post Type Single Loop Outputting Wrong Post
- Organization of time insensitive content
- How to output all taxonomy links from a custom post type in a menu?
- Can I style single post that are in multiple catergories?
- WordPress Post Deletion Issue
- How Can I Always Display A Particular Post First Using WP_Query?
- MySQL: Possible to replace all of wp_posts.post_content(id#) via UPDATE + REPLACE + SELECT?
- Change modified date to current date when title updated automatically
- How to put the author of the post in the comments?
- Run a function when a custom post is update?
- the wp_post_update isn’t working all the time
- Send email to user when I publish a new post
- How to add a custom class attribute into code wrapper? [duplicate]
- Redirecting wordpress search query to archive page
- Is update_post_meta used when save_post action hook is invoked?
- How to create custom search form function including post “tags”
- How to invoke a HTML custom button based on a HTML dropdownlist menu
- Please I want to prefix my WP posts title according to each category
- insert post fails after multiple postings
- Custom Post Type Rewrite URL
- Dev and prod on the same database- dev version active for IOS
- Custom Post Types and Broken Permalinks
- The first post appears twice
- Customizing URL slugs of Custom Post Type and Taxonomy make posts/pages 404
- Append a random string to a post permalink
- Show Posts By Custom Field
- Is it possible to completely replace a post with an action/filter?
- Custom Post Type doesn’t use single.php or single-{custom_post_type}.php
- How to retrieve custom field values and save again as array
- Is there a Standard Format for Clean URLs for Archives of Custom Posts?
- Customize search results to include custom posts and display in a specific template page
- Custom permalink based on custom post type fields
- Checking if some condition is matched before inserting post into database
- How to only allow post to be deleted if custom field doesn’t exist
- Custom Post Title as search term
- adding custom meta as well as looping through posts
- Best way to enable sorting by 3 criteria on a page of listings
- How remove “recent comments” title without modifying code? [closed]
- How edit footer copyright info? [closed]
- Need to show birthday of custom post type(Famous people in this case) in elementor. Date of birth set in custom fields