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?
- Multiple Inputs in a Customizer Control
- Embedding a SOAP Client into a WordPress Plugin?
- How to set a default format for a custom post type?
- Remove WordPress theme from a specific page
- Where should I use get_option in a plugin
- How to keep a WordPress site synchronized between two servers?
- Which to use to execute code during the saving of a plugin settings page?
- Redirect After Delete User in Backend
- add_rewrite_rule and custom variable
- Converting primary keys from autoincrement integers to UUIDs
- Is there a WordPress Event Manager that links with your user database?
- Post from front-end only by logged in users, form posts as “posted by:
- Should we localize custom-made themes / plugins?
- How can i customize the comment list
- Fast way to add countries as a custom taxonomy term?
- clean wp_options table unused rows
- Passing page url into a custom field via the Press-This bookmarklet
- Using transients to store captchas
- How to extend nav-menu-item-control data in Appearance > Customize?
- How to correctly add JQuery in a WP theme?
- Video to stretch across the entire homepage [closed]
- How can I allow access to multiple users, using the same login, at the same time?
- Placeholder in HTML editor text area?
- Multiple Category Search
- Only show search results with if current date is between two dates?
- Function to allow “Anyone can register”?
- database interactions using OOP
- TwentyFifteen: How can it show a different color on every post page?
- Extending the WP_Widget_Text class
- How to recover deleted site in WordPress Multisite?
- Enumerating over a category of links
- Problem with meta box in Links
- query usermeta from custom field
- Disable woocommerce cookies and delete cart data automatically
- user_profile_update_errors hook not executing
- wp_query get post custom taxonomy in search.php
- Insert image in WordPress with HTML5 tag and caption function
- Custom login with external provider iframe and data object
- Cannot save using register_setting
- Allow users to create posts without logging in?
- Best Practices for a Completely Customizable Homepage – without plugins
- wp_editor not modify html tags of initial content
- Users can only view their content from the front end
- Localization: I want the backend: english and frontend in defined language
- Theme compression/ minifying or W3 Total Cache – which should I use? [closed]
- How to check for images before echo
- How do I reclaim either deleted pages or their permalinks?
- How to make universal gallery and improve admin side of managing galleries?
- Sticky menu for WP custom menubars
- More tag – how do I remove preceding ?
- Salesforce lead tracking with contact forms plugins [closed]
- When I try to de-activate any plugin it gives error “Warning: call_user_func_array() [function.call-user-func-array]”
- Add or Create Custom Structure Tags to Permalink
- Setup database structure with books, authors, languages etc. for publishing house [closed]
- How to remove admin menu pages inserted by plugins and themes in the top admin bar?
- WordPress custom dropdown listings
- Help customising admin bar, removing buddypress links from dropdown
- Action on WordPress Install
- WordPress in a Subdirectory
- What is the best way to make a custom page from a plugin?
- Hook save_post_cpt not triggered when custom fields are modified
- javascript file not working in a plugin template file
- How do I know if the user is a customer?
- Custom post type defaults to index.php for archive page
- customize Dokan multi vendor: how can i set every Dokan as child of another dokan?
- how can custom permalink structure use for specify custom post type
- Add button to My Sites dashboard page (multisite)?
- How to use custom footer template in a site-plugin?
- Add Categories To Custom Post
- How to define a static Home page
- Remove all link title attributes
- how to display wordpress navbar with top menu outside wordpress system
- Change the search results header from plugin
- Logged in only custom page
- Make Terms Under Custom Taxonomy Use Specific Single.php Template
- Problem Locating and Changing Alt Attribute Of Link
- URL to an image in a post is changing when permalink is set to custom. Can I avoid this?
- Adding css and js to a blank page created with custom template
- Img alt tag showing different value then entered
- Create Custom Coupon Type