Questions tagged [trash]

The tag has no usage guidance.

16 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
1answer
268 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 : ...
1
vote
0answers
27 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, ...
1
vote
0answers
139 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 ...
1
vote
1answer
487 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 ...
1
vote
0answers
73 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 ...
0
votes
0answers
20 views

Cancelled orders move to Trash automatically in Woocommerce - how to disable?

I have a Wordpress 5.4.1. website, with Woocommerce 4.1.1. installed. It seems that orders which have the status "Cancelled" move to Trash automatically after one month passes (from the order date). ...
0
votes
0answers
85 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, '...
0
votes
0answers
37 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 ...
0
votes
1answer
141 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 ) { ...
0
votes
0answers
66 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 ...
0
votes
0answers
143 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, ...
0
votes
1answer
276 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 ...
0
votes
1answer
111 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. ...
0
votes
1answer
23 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 ...
0
votes
0answers
610 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 ...
0
votes
1answer
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 = ...