Problem deleting posts from trash

Technically, defining define(‘EMPTY_TRASH_DAYS’, 0 ); in wp-config.php file should delete whatever is in Trash after zero days. I just tried it, but didn’t work immediately. I may have to wait for a day to see the result.

How to change ‘Move to Trash’ to ‘Move to Draft’ for my blog’s users?

You can use add_filter() for post_row_actions to filter out the ones you don’t want, add in the functions you do want. Like so: <?php /** Plugin Name: (wpse) Draft vs. Trash Posts */ add_filter( ‘post_row_actions’, ‘my_plugin_update_actions’, 10, 2 ); function my_plugin_update_actions($actions, $post) { $capability = ‘promote_users’; $role=”Administrator”; // Choose what you want to check against. … Read more

Restore page after deleting it from trash

Unless you have a backup of your database then most probably your page is unfortunately gone forever. You could try contacting your hosting provider and ask if they have a backup stored somewhere.

Trash in WP 3.8?

If you don’t have any posts in the Trash, then there won’t be a link to go and see them. What would be the point of displaying a link to an empty page, after all? The link to Trashed posts appears on the All Posts screen at the top, right alongside All | Published | … Read more

Control whether or not to trash a custom post type

Hook onto trashed_post and use wp_untrash_post() to reverse upon meeting a condition, pseudocode example… add_action(‘trashed_post’, ‘wpse_218031_trashed_post’); function wpse_218031_trashed_post($post_id){ //use post_id to check conditions… if not met call: if ( $some_condition ) { wp_untrash_post($post_id); } } trashed_post runs after wp_trash_post and after the post is moved to trash. By the way, if the constant EMPTY_TRASH_DAYS is … Read more

wp_trash_post not firing

There are two hooks you should be considering– wp_trash_post and trashed_post. Based on your statement that you want this to work “when a post is placed into the trash” I’d suggest the latter is the better hook, since it runs after the post is successfully placed in the trash. I hate to suggest this as … Read more