Questions tagged [trash]

The tag has no usage guidance.

19 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
1 answer
308 views

Restore trashed posts with comments

When a WordPress post is trashed, all the comments are trashed as well. I would expect the "undo" button to restore both the post and the comments. However, all the comments seem to just disappear : ...
user avatar
  • 21
1 vote
0 answers
220 views

How can Reusable Blocks be fully deleted?

All of the reusable blocks on one of my sites were deleted last week. Not just deleted, but the trash emptied. I've already had a security vendor audit the site, and they concluded there was no hack, ...
user avatar
  • 8,746
1 vote
0 answers
212 views

posts comments goes to trash

My website was working fine until today, I just discovered that all comments made goes straight to trash. I did not install new plugins, I don't have akismet. It just started. I have deactivated all ...
user avatar
  • 41
1 vote
1 answer
761 views

How to cancel the trash action inside wp_trash_post

I need to restrict the button "EMPTY TRASH" and make it delete only the posts only if the logged in user is the creator. I tried to use the wp_trash_post and i need to decide in the function if i ...
user avatar
  • 409
1 vote
0 answers
86 views

Sort trash by date post was trashed

Is it possible to sort the trash for post by the last post added to trash. EG: I trash post 4,2,1,3,5 I would like these post to be sorted in trash by the last post trashed, so they would appear in ...
user avatar
0 votes
0 answers
11 views

Prevent users to delete comments from trash

As told in the title, I am looking for a way to prevent users to delete comments from the trash. Only admins should be able to. I tested the scripts at: Function to prevent users from trashing ...
user avatar
  • 1
0 votes
0 answers
20 views

How to display "Trash" in my custom post type?

what does it take to display the Recycle Bin in my own Custom Post Type? function my_custom_post_specialist() { $labels = array( 'name' => _x( 'Terapeuci', 'post type ...
user avatar
0 votes
0 answers
21 views

is possible to interupt a post deletion when empty the trash

it is possible once called a before_delete_post action not to allow WP to delete post on certain condition? something like e this: add_action( 'before_delete_post', 'my_custom_delete', 10); function ...
user avatar
0 votes
0 answers
32 views

Set "move to trash" as the default bulk action

I need only "move to trash" bulk action and I want to set it as the default bulk action. Then, I will hide the select field with css. To delete a post, I will just put a tick in a checkbox ...
user avatar
  • 1
0 votes
0 answers
175 views

Bulk trashing post 'fails'

I want to bulk delete child posts of a custom post type, and I've made it work. I'm in class context: // In a register method which registers all hooks. add_action( 'wp_trash_post', [ $this, '...
user avatar
  • 1,944
0 votes
0 answers
44 views

WordPress deletes custom posts instead of trash them

I need to trash some custom posts, under certain conditions, via code (it's a plugin self-written) The theme used is a children I don't shutdown the ability to trash the post; In config.php there ...
user avatar
  • 141
0 votes
1 answer
185 views

How can i take all ids from untrash_post action?

When the user chooses to restore a post ( from "Trash" folder ) with the following way, through the action untrash_post, i get the id of the posts. function my_untrash_post_type( $post_id ) { ...
user avatar
0 votes
0 answers
69 views

Run Jquery Script after delete post in front end

I have a list of posts on a page on the front end. With each post I have created a delete button with get_delete_post_link. This works fine but I now need to execute some jQuery after the post is ...
user avatar
0 votes
0 answers
147 views

wp_trash_post retrashes already trashed comments?

I have a few mail- and update_user_meta functions that fires when a post, comment or child comment gets thrashed. So when I trash a comment with trash_comment, a mail get sent to the author: "Hey, ...
user avatar
  • 141
0 votes
1 answer
370 views

transition_comment_status gets called when untrashing comments

I can't seem to figure out why untrashing a comment, calls my "approve_comment_callback"-action. Any ideas? I just don't want it to send two emails at the same time, when I untrash a comment. Here ...
user avatar
  • 141
0 votes
1 answer
130 views

Trash a post, send associated comments into the trash bin (change status)

When trashing a post, all comments associated with this post get the status "post-trashed". They do not end up in the trash bin. In my theme the author gets a point for posting a post or a comment. ...
user avatar
  • 141
0 votes
1 answer
24 views

WP Posts Not Adding Up

My WP is hosted at Yahoo I am running WP 3.5.2 and the Posts Page does not add up All (4,356) | Published (629) | Sticky (1) | Drafts (265) | Private (88) WP seems to have an extra 3373 posts. I ...
user avatar
0 votes
0 answers
674 views

How to hook in to bulk trash posts

I am trying to hook into the trash post function in the bulk menu. I've managed to hook into an item when I trash it by it self by using the wp_trash_post hook, but this does not work when doing it ...
user avatar
  • 153
0 votes
1 answer
1k views

Create action running on trashed_post hook to modify post_meta value

I have a custom post type that always do math operation to its post_meta and other custom post type post_meta. For example: post-type 1 = cpt_product_order post-type 1 post_meta = ...
user avatar