Following the line of code
https://core.trac.wordpress.org/browser/tags/4.9/src/wp-includes/post.php#L2467
if ( ! $force_delete && ( 'post' === $post->post_type || 'page' === $post->post_type ) && 'trash' !== get_post_status( $postid ) && EMPTY_TRASH_DAYS ) {
return wp_trash_post( $postid );
}
the $force_delete just work with ‘post’ and ‘page’, it not work with custom post type
Related Posts:
- trash_post action with Custom Post Type
- Trash bin for categories
- Error after deleting Custom Post Type with a function (no trash used)
- Can I differentiate between “Delete Post Permanently” and “Empty Trash” and do something for each accordingly?
- Why trash folder got empty automatically?
- wp_trash_post not firing
- Control whether or not to trash a custom post type
- Sort trash by date post was trashed
- How to recover permanently deleted blog posts?
- Trash in WP 3.8?
- How to cancel an action hooked to untrash_post? or any hook
- Restrict access to trash, only admin
- Restore page after deleting it from trash
- How to change ‘Move to Trash’ to ‘Move to Draft’ for my blog’s users?
- is possible to interupt a post deletion when empty the trash
- Set “move to trash” as the default bulk action
- WordPress deletes custom posts instead of trash them
- Run Jquery Script after delete post in front end
- Problem deleting posts from trash
- How to prevent users from permanently deleting a post from trash, but allow them to restore it?
- Best collection of code for your 'functions.php' file [closed]
- How to: Easily Move a WordPress Install from Development to Production?
- Is moving wp-config outside the web root really beneficial?
- Hide the fact a site is using WordPress?
- Objective Best Practices for Plugin Development? [closed]
- Organizing Code in your WordPress Theme's functions.php File?
- What does this PHP function code mean? [closed]
- similar of my posts in all over the internet sites and blogs [closed]
- When to use is_home() vs is_front_page()?
- Is there a flowchart for WordPress loading sequence?
- How to change the default registration email ? (plugin and/or non-plugin)
- Best collection of code for your .htaccess file [closed]
- MySQL Database User: Which Privileges are needed?
- Essential technical features for high-end WordPress web hosting? [closed]
- How to structure a plugin
- How to remove admin menu pages inserted by plugins?
- How to create a custom search for custom post type?
- Opinions and recommendations on the best barebones base theme [closed]
- How to put logs in WordPress
- How to filter post listing (in WP dashboard posts listing) using a custom field (search functionality)?
- Conditionally Loading JavaScript/CSS for Shortcodes
- What is your best practice to execute one-time scripts?
- How to get the Date Format and Time Format settings for use in my template?
- Database synchronization between dev/staging and production
- what is the correct way to compare dates in a WP query_posts meta_query
- Explanation of update_post_(meta/term)_cache
- How to implement a customizable free OpenID authentication?
- Should all plugins be encapsulated in a Class?
- Add validation and error handling when saving custom fields?
- Best way to eliminate xmlrpc.php?
- Nested meta_query with multiple relation keys
- How To Add Custom Form Fields To The User Profile Page?
- Add multiple custom fields to the general settings page
- What SQL Query to do a simple find and replace
- What Features would you Most Like to See Added to WordPress? [closed]
- Why have on every line
- Where are Additional CSS files stored
- How can I edit post data before it is saved?
- How do i best handle custom plugin page actions?
- add_action(), add_filter() before or after function
- is_plugin_active function doesn’t exist
- Best Practices for Regression Testing WordPress Websites?
- numberposts? showposts? posts_per_page?
- Remove wrapping div and ul from output of wp_nav_menu
- Attaching taxonomy data to post with wp_insert_post
- What Is The Use Of map_meta_cap Filter?
- How do you use a CPT as the default home page?
- How to create an API for my plugin?
- Is it ever okay to include inline CSS in plugins?
- Plugins in symlinked directories?
- get post author id outside loop
- Difference between add_filter and apply_filters
- How can I make updates to a site, on a development copy, but then move updates back without overriding live site’s evolving database?
- Custom pages with plugin
- Proper Way to Modify Plugin
- Custom Walker: how to get ID in function start_lvl
- Pass boolean value in shortcode
- How to add crossorigin and integrity to wp_register_style? (Font Awesome 5)
- Customizing a WordPress theme without changing it?
- Creative uses of WordPress [closed]
- Can a custom post type have a Parent Page?
- Restrict custom post type to only site administrator role
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- Best practices for localizing WordPress content?
- Plugin Form Submission Best Practice
- How to *remove* a parent theme page template from a child theme?
- get_the_term_list without links in 3.1
- How to make a text with hyperlink translatable in WordPress?
- Creating an Image-Centric Custom Post Type?
- Validating Custom Meta Box Values & Required Fields
- How do I make my child theme re-apply the settings that were customised when its parent was active?
- Integrate WordPress and bbpress profiles?
- get_template_directory() vs bloginfo( ‘template_directory’ ) vs TEMPLATEPATH
- Is there a action hook for the “Empty Trash” button?
- Multiple Inputs in a Customizer Control
- New WP_Customize API – how does it work under the hood?
- Embedding a SOAP Client into a WordPress Plugin?
- Delete tables from database when deleting plugin
- Best way to abort plugin in case of insufficient PHP version?
- Is there anything that Joomla or Drupal can do that can’t be done in WordPress? [closed]