The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
0answers
19 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 ...
0
votes
0answers
13 views

How do I get my comments back after trashing a post (and undoing the 'trashing')?

I accidentally hit the trash icon under my latest post. A message came up that asked if I wanted to undo the action. I clicked on 'undo'. My post was restored, but all my comments disappeared. I ...
0
votes
0answers
39 views

How to allow a contributor user role can only trash the comment in wordpress?

I want to allow the 'Trash Comment' permission for Contributor role user on his/her uploaded post.
0
votes
2answers
41 views

How to cancel an action hooked to untrash_post? or any hook

I want to do the following in a plugin: - hook to untrash_postwith a custom function - do some checking inside custom function - cancel actual post restoring (untrashing) I've tried with ...
1
vote
1answer
48 views

Wordpress has a trash for users? (Wrong result for count_user, greater than expected)

I am using count_users() function to count users on my wordpress sites. In my administration area -> 'Users' I can see 7 users, but the function returns 9. After some time, searching for errors in my ...
1
vote
1answer
83 views

Control whether or not to trash a custom post type

I need to have control over the trash / delete action on a custom post type. I need to check for some conditions and decide if i should trash the CPT or not. The wp_trash_action hook that is fired ...
0
votes
0answers
23 views

WP-4.3-trash not deleting automatically after specified days

I am using wordpress ver-4.3.1. I want to delete the trash automatically after specified days. For this in my wp-config.php file I have applied code - define('EMPTY_TRASH_DAYS', 1); to empty the ...
0
votes
1answer
143 views

How can I hook into existing WordPress Bulk actions?

I am creating a plugin which syncs both standard WP data and custom fields within a custom meta box on post edit pages, to an external resource using SQL queries. However my functions are currently ...
0
votes
1answer
58 views

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

I want that only Admin and Editor roles can use the 'Move to Trash' option in my blog, and other users will get the 'Move to Draft' option instead. Like inside of the 'Quick Edit' / 'Bulk Actions' ...
0
votes
1answer
26 views

Nonce for Trashing Item

I have a custom admin page. On it, I have created a filtered list of the custom post type based on postmeta data. I have to create a link to delete that post. I am trying to figure out how to ...
1
vote
1answer
124 views

How can I trash multiple posts at once from the front end?

I took a peek at the code in edit.php and am now generating links with this code: wp_nonce_url("/wp-admin/edit.php?doaction=trash&post_type=post&ids=postIds", "bulk-posts") The ...
-1
votes
1answer
33 views

Post deleted in trash [closed]

I need a plugin or some method to recover deleted post of trash.
0
votes
2answers
236 views

Undelete post (untrash)?

Which function should be used to move post from trash to published pages? i.e. is there wp_undelete_post or something like?
1
vote
0answers
37 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
1answer
123 views

Missing 'Move to Trash' option from bulk select box

I seem to be missing the bulk select option for moving multiple items to the trash. This happens when all plugins are deactivated as well. Has anyone come across this before? http://i.stack.imgur.com/...
0
votes
2answers
128 views

Changing a post status name

How do I change the status name "Trash" to "Archive". I don't want to change the functionality of the status or make a new status. I have tried Edit Flow custom status but I get some conflicts with ...
0
votes
1answer
199 views

How to retrieve the date on which a post was moved to trash?

I need to retrieve a list of posts that are in trash based on the date on which they were trashed. The following code allows me to retrieve posts that are in trash, but how to filter them by date? ...
0
votes
1answer
142 views

wp.getPosts with status = 'trash' using node.js

I was wondering how to set the filter option for wp.getPosts. I want to get posts with a status of 'trash'. filter is currently blank, and returns all posts other than trash. I am using the xmlrpc ...
0
votes
1answer
251 views

Restrict access to trash, only admin

I'm new in WordPress. I have to restrict access to the Trash for all users except the administrator. All users CAN move to the Trash, but only admin can delete permanently or restored. I do not know ...
0
votes
1answer
280 views

Custom Role can't trash Custom Post Type

I have a post type that I set up some capabilities for and I attached them to a new Role, however, the role can not trash them. I'm not sure why though. Here is the portion of my array for the ...
0
votes
0answers
51 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
3answers
171 views

Deleted pages showing up when querying for child pages

I'm using the following code to display the featured image, post_title and custom field data from relevant child pages. <? $child_pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE ...
0
votes
0answers
80 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
99 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
483 views

Dynamically create/remove terms in taxonomy when custom post type is published/trashed

Am struggling a bit with creating & removing terms based on when a custom post type is published and trashed. Ideally, I would like to create a new term in my custom taxonomy when a custom post ...
0
votes
1answer
85 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. ...
1
vote
1answer
149 views

When trashing a post, also trash related comments

As it is now, when I trash a post, the related comments get deleted at once. Is this standard? Instead I'd like them to be moved to the trash bin, when I trash the post. How can I achieve this? I ...
1
vote
1answer
60 views

Deleting the attached “comment replies” when trashing a comment

When sending a comment to the bin, the attached "comment replies" does not get trashed or deleted. How can you configure wordpress so that when you trash a comment, the comment replies automatically ...
0
votes
1answer
37 views

Conditionally process comments while ignoring replies

I use a WordPress theme that awards users points (kept track of in user meta-data) for posting comments. However, they are not awarded points for replying to a comment. When I move a comment to the ...
0
votes
1answer
56 views

What's the difference with trash_comment and wp_trash_comment?

I don't understand when I'm suppose to use trash_comment over wp_trash_comment. What's the difference?
0
votes
1answer
134 views

get_option('sticky_posts') returns stickies that are in trash

The value of get_option('sticky_posts') includes those that are in the trash. How can I get a value minus stickies that are in the trash? var $stickies = count(get_option('sticky_posts'));
0
votes
1answer
22 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
194 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 ...
1
vote
1answer
277 views

How to use update_post_meta inside wp_trash_post

I have some metadata on my post edit page that saves perfectly using the hook and function below: add_action('save_post', 'save_meta_data'); function save_meta_data($post_id){ if(isset($...
2
votes
1answer
286 views

wp_trash_post not firing

I want to call a function when a post is placed into the trash. I want to do something more complicated than the following, but have simplified to what's below just to see if it'll work and it doesn't....
1
vote
1answer
697 views

Add frontend “Restore” link

I am using get_delete_posts_link($postid) to let users send their posts to the trash from the frontend. Now I'm trying to replicate the same functionality for them to "untrash" or restore the posts as ...
0
votes
1answer
223 views

Comments screen in backend, how to disable Quick Edit | Edit | History | Spam | for non admins

I'm trying to adjust the comments screen for non admins to my project. Right now I'd like to disable Quick Edit | Edit | History | Spam under any comment left for any post created by the user. ...
0
votes
1answer
169 views

How to restore all items from trash

I have accidentally deleted a WP user. By deleting it, WP removed all the media files, pages etc. I could retrieve pages and posts from trash. But I could not restore media items. Is there a way to ...
2
votes
2answers
105 views

Is there an action that is called when a post is restored from the trash?

I'm looking at the wordpress list of actions and trying to find an action that is called when a post is restored from the trash but cannot find one. Does anyone know if it exists?
1
vote
1answer
349 views

Restrict access to the Trash folder in Posts

I want to restrict users from deleting posts permanently. How do I restrict access to the Trash folder in Posts? This is the only page were the users can delete their posts permanently. The only ...
10
votes
1answer
574 views

How do I programatically empty trash?

I need to create an "Empty Trash" button inside my plugin. How would I do it using PHP code?
2
votes
1answer
2k views

How to use wp_nonce_url() in a link?

I am creating a plugin to display all posts from all custom post type. It is something like in edit.php, but instead of displaying single post type,I would like to display all posts in one page from ...
0
votes
1answer
740 views

Problem deleting posts from trash

My clients has recently had a problem with spam posts being added to their blog, under various usernames. The users have been deleted, but Wordpress is not able to remove the posts from the trash. ...
0
votes
1answer
533 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 = ...
3
votes
1answer
607 views

How to change redirect after moving a page to trash?

How could I change the redirect location after a user trashes a page? Right now they go to all pages here:....wp-admin/edit.php?post_type=page I want them to go here:......wp-admin/edit.php?...
3
votes
2answers
2k views

trash_post action with Custom Post Type

I have a Custom Post Type "empresa" and would like to send email when a post type is deleted (moved to trash). I have this function below for my POSTS, How can I use with my Post Type "empresa"? ...
2
votes
0answers
603 views

Posts mysteriously disappearing/deleted [closed]

I'm looking for help about this issue I've been having on one of my client's sites (http://revistero.mx it's in spanish) The problem is that somehow, every once in a while the last published posts (...
0
votes
1answer
124 views

Conditional tag-like function to tell if post is in trash?

What could I put in my theme to tell if a post is in the trash or not? For example: <?php if (is_trash) echo 'This post is in the trash!' ?>
3
votes
2answers
3k views

Turn Off Automatic Trash Deletion?

I have a client who wants to use the trash feature, but keep items in there indefinitely (I have no idea why, but they insist on it). From reading this codex article on the trash status, I see that ...
1
vote
1answer
658 views

Comment Spammed vs Trashed

What's the difference between marking a comment as spam and trashing it?