WordPress allows you to set a workflow status of the content.

learn more… | top users | synonyms

13
votes
3answers
25k views

How to Get All Posts with any post status?

i am creating a frontend dashboard where i need to show all the post by the current user. So i need to show posts with all post status. Mainly published, trashed and the pending. I am now using ...
10
votes
2answers
392 views

Is it possible to have more “levels” of draft/published statuses?

Is there any way to have more post statuses other than just draft or published? For example, if you write a lot of posts, you may wish to type up all the content, and set the status of these posts as ...
6
votes
1answer
530 views

Changing post status in one click

I want to add custom button "Send for correction" somewhere near the "Publish" button. This custom button must change a post status from "Pending" to my own created status named "On correction". For ...
5
votes
1answer
693 views

how to assign a status/mark to post?

I want to mark some posts to include them in a featured content slider. For that purpose, I want to include a check box on the new post page, so that if the checkbox is selected the post is marked as ...
5
votes
2answers
3k views

New post status for custom post type

I have a custom post type recipes. I am using a cron script to automatically aggregate news into the database. It is currently being imported and saved as 'Pending Review'. Is it possible to create ...
4
votes
2answers
232 views

What is a “protected” post status?

I noticed in the register_post_status function in core that there is an arg for 'protected'. The following post statuses: 'future', 'draft', and 'pending' all have this set to true. I'm not talking ...
4
votes
1answer
138 views

WP_Query by post ID doesn't work if post is in custom post_status

I want to display a single post by its ID using WP_Query(). To do this, I use the following argument: $args = array( 'p' => 61202); That should work, but does not seem to work if the post is ...
4
votes
1answer
97 views

Restrict a Post Types Post Status

I have a custom post type and a completely custom user interface to access it, and would like these posts to have a publish status. I know how to make them skip trash and be deleted immediately, but ...
4
votes
1answer
346 views

Using get_post_meta with new_to_publish

I'm trying to read the custom fields set by the user when publishing a new post: function doSomething($post) { $meta = get_post_meta($post->ID); error_log("post meta: ".print_r($meta, ...
4
votes
1answer
120 views

Using arbitrary post status without registering it

I want to use an additional, arbitrary post status on one of my custom post types. I'm calling it "limbo", and it's assigned to a post which has been deleted by the user, but one that I still want to ...
3
votes
1answer
1k views

Custom column for changing post status via ajax

I'm currently trying to implent a new custom column at the page manage screen that will let me change the status (published/pending) of the different pages via an easy toggle link. From what I've ...
3
votes
2answers
2k views

register_post_status and show_in_admin_all_list

I have a custom post status which should be public visible but not displayed in the "all" list of the edit screen. This is how I register the post status: ...
2
votes
1answer
655 views

How can I run custom function when post status is changed?

I can hook custom function to each of trash_post, edit_post, private_to_publish etc. to meet some of my requirements, but I need also to check for more possible transitions like 'pending to draft', ...
2
votes
3answers
2k views

How to 301 private posts rather than 404?

How do I 301 redirect private pages, rather than 404 them? If a post is private, WordPress filters it out in the SQL query, so there are no $post variables to work with. I'd like for this code to ...
2
votes
1answer
580 views

WP_Post_List_Table::get_views - Have post counts account for filters?

Toward the top of the edit.php screens there is a list that displays post statuses along with the post count. I believe this is generated by WP_Post_List_Table::get_views. For example All (7) | ...
2
votes
1answer
99 views

Change scheduled posts to published

I wrote the following function to change scheduled posts to published (I've got about 1000 of them). When I run the code below, the date change, but the status does not... Can anyone shed some light ...
2
votes
1answer
340 views

Getting the different post statuses + count like in edit.php, in a custom submenu page

I'm trying to create a submenu page for reordering posts/pages. Right now I'm trying to include the list that display the different post statuses, for example: All (5) | Published (4) | Draft (1) I ...
2
votes
1answer
163 views

Get images only if parent status is publish

I have a site which uses a custom template page for each image, and users can favorite an image. I am then pulling a page of most favorited images: $args = array( 'post_type' => 'attachment', ...
2
votes
1answer
1k views

What action is called when drafts are saved?

I would like to add a metadata field to the current post based on a checkbox in a custom meta box to be able to toggle my custom plugin on a post by post basis. For this I coded the following things ...
2
votes
1answer
756 views

Custom post status and preview

I am using wordpress 3.4 (the last before 3.5) and I have declared a post status type, and a custom user role called agent. It is for a custom post type, property. register_post_status( ...
2
votes
1answer
566 views

Create front end link to save post (or unpublish post) as draft

I have created a front-end posting and dashboard system for my users to add and edit their own posts. In the dashboard area, I have a list of their posts and the following options for each post: View ...
2
votes
1answer
182 views

Problem duplicated shortlinks bitly

I've this plugin to create shortlink using the bitly API, but there's a problem! function yoast_bitly_shortlink($url, $id, $context, $allow_slugs) { if ( ( is_singular() && !is_preview() ...
1
vote
2answers
9k views

How to update page status from publish to draft and draft to publish

I am trying to figure out how to write the code that will allow me to do the following with pages of a WordPress blog? "To change a post status, you get the post, change its status field, then call ...
1
vote
1answer
1k views

Show scheduled posts in archive page

I'd like my archive.php page's daily view (is_day) to display scheduled posts (post_status=future). For example, if I go to mysite.com/2011/05/20 I would see all posts scheduled to appear on May 20. ...
1
vote
1answer
109 views

Setting post meta data to random value during post status transition / on publish

Upon publishing an unpublished draft, I'd like the custom meta value "post views count" to be set to a random variable between 829 and 1013. I am using the code below, which doesn't always work. It ...
1
vote
1answer
182 views

Update post status from “publish” to “trash” for half of posts

I want to update half of all posts with status from published to trashed. Example: if I have 10000 posts, 5000 post to trash If I have 6000 posts, 3000 posts to trash If I have 7000 posts, 3500 ...
1
vote
1answer
146 views

Modify Post Status Arguments

Is it possible to edit existing registered post statuses? I am using the Edit Flow plugin to create custom statuses, however, the plugin does not offer the option to set whether the statuses are ...
1
vote
1answer
333 views

Custom Post Status Posts viewable to the public

I am using EditFlow's "custom status" feature for an event calendar plugin I am writing for a client. I've created a status called "previous events", when a date has happened the events post_status ...
1
vote
2answers
876 views

Additional page and post status types

I have a site where pages will often move from draft to published and then to legacy. I would like to create another status type similar to draft or published titled "legacy". Wherein the page exists ...
1
vote
1answer
848 views

wordpress function to change post status [duplicate]

I'm running the YouTube Video Fetcher plugin at . It fetches videos using the youtube api and displays them on your website. Within the plugin script, there is the following sequence: if ...
1
vote
1answer
130 views

Add new post with predefined / preset date

The current situation The plugin I'm currently working on is an additional post list view: A calendar, as you can see in the following screenshot. Admin calendar view with MP6 and handheld screen ...
1
vote
1answer
392 views

Schedule future post to custom post status instead of publish?

I've been doing some research into custom post statuses and scheduling posts and I had a question: I was wondering if it were possible to schedule a post to got from future to a custom post status ...
1
vote
1answer
260 views

Detect type of post status transition

I have a function on my site that it supposed to run when a new post is published (email push notification), with the exception of the same article updated (i.e publish_to_publish transition, I don't ...
1
vote
1answer
775 views

Pending status by default for a specific role

I would like to prevent users from one specific role from publishing directly their articles. Only administrators should be able to approve these. The only choice they would ever have is to put their ...
1
vote
1answer
577 views

Custom date changer post_date => future - missed schedule error

I'm working on a custom event scheduler for my website that allows people to easily go in and set the article to post in the future. The reason I'm overriding the normal Wordpress functionality is ...
1
vote
1answer
2k views

Save author posts as in pending review - block users updating their posts

How can I let the users (author, editor, contributor etc) to edit their own posts but not to update them, just keep them as in "pending for review" so I can decide if it's ok to publish or not. By ...
1
vote
1answer
291 views

Why does get_post_status display published when attachment is in trash?

Is there a reason why using get_post_status() on an attachment page returns 'published' when the media item is actually in the trash? I'm trying to figure out if this is a bug or if not how to ...
1
vote
1answer
1k views

Setting a title on a Custom Post Type that doesn't support titles

I have a CPT called "profile" that only supports the editor and thumbnail. Each user is limited to posting just 1 profile. I'm looking for a way to prefill the title and slug fields with the display ...
1
vote
2answers
526 views

How to change post status from frontend?

I'd like to add the posts in my loop the ability to toggle them between different post statuses (e.g. publish/draft). What's the best way to do it? Thanks in advance!
1
vote
0answers
43 views

Add custom post type drafts to RSS feed

I have an RSS feed setup for my custom post types, but I'm trying to add in all posts with the status 'draft'. Here's what I've tried that doesn't seem to be working at the moment : function ...
1
vote
2answers
391 views

How to display future posts - modified query still yields 404

I have a very strange problem and I am stuck. I want the single page to display posts with the post_status of publish and future. So I added this code to my functions.php in my theme: function ...
1
vote
0answers
65 views

How to change custom post type status when non-admin updates post?

I allow users to submit posts (as a custom post type, "tribe_events") to my website. Is there a snippet I can add to my functions.php file that would change a post's status from "published" to ...
1
vote
1answer
1k views

Override private status - Enable users to read private posts

Hidden private posts for not logged in users The private posts are by default only visible when logged in. Override, show private posts for everyone Is there a clever way to override this? Make it ...
1
vote
2answers
680 views

How can a guest view the “Pending Review” Post?

When a user creates a new post it will have "pending" status. So I want the visitor (guest - not logged user) to be able to view "Pending" posts and vote it to "Publish" if enough "X Votes". Google ...
1
vote
1answer
607 views

Count posts by type including drafts and pending posts

I had this function that counts posts number by type (taken from wordpress codex) function count_user_posts_by_type($userid, $post_type) { global $wpdb; $where = ...
1
vote
0answers
136 views

Changing status of Published posts which have less Content to “Draft”

function draftpost(){ global $wpdb; $prefix = $wpdb->prefix; $wpdb->query("UPDATE ".$prefix."posts SET post_status='draft' WHERE LENGTH( post_content ) <500"); } ...
1
vote
0answers
441 views

Does the WP_Query 'private' argument for post status only apply to privately published content?

The only peice of code that I can find that applies to this is on line 2430 in query.php in WP 3.4.1 foreach ( get_post_stati() as $status ) { if ( in_array( $status, $q_status ) ) { if ( ...
1
vote
2answers
308 views

Include Drafts or Future posts with count_user_posts?

I'm use the code below to get the number of posts by a user and it works fine but it only includes published posts. How can I modify this code or use different code to have it include "future" ...
1
vote
4answers
1k views

change a post status when users update posts?

Is there an efficient way to change a post status from 'published' to 'draft' when a user of a certain type tries to update their posts. I tried something along these lines function ...
0
votes
1answer
318 views

Enable commenting on front-end preview page for pending posts

We are in the process of allowing authors to collaboratively be a part of the editorial process. They will have access to all pending posts' preview pages (not post-edit pages). I want to allow these ...