Questions tagged [post-status]

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

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

'transition_post_status' only fires when pressing “Add New”

I want to fire a function when a new post (cpt) is published. function my_publish( $new_status, $old_status, $post ) { if ( $new_status == 'publish' && 'publish' !== $old_status ) { ...
1
vote
1answer
22 views

Force Custom Post Type Status to 'Future' on first Save or Publish

I have a custom post type setup for events. I set the time/date for the event using Advance Custom Fields. I would like to set the publish date from the ACF value as well. I am very close to having ...
1
vote
1answer
661 views

change woocommerce product statut (draft ->publish // publish->draft) depends on the month

I have some seasonal products. I thought using "post expirator plugin" but this not managing the "yearly" options. So I thought doing something like this: function saison(){ $current_month = date('...
1
vote
0answers
21 views

Custom Status of Custom Post type need to EXCLUDE from Taxonomy pages

I have 400 custom post type posts saved as DRAFT which are no longer in use but it can be in future, So for SEO purpose i want now to have all those posts accessible with direct URL but not showing on ...
1
vote
0answers
111 views

Wrong post_status notice after wp_insert_post_data

I'm developing a plugin that checks the post content before publishing. If the content doesn't contain specific information, it is saved as draft instead. For this functionality I use the ...
1
vote
0answers
191 views

how to transition to custom post status on post save

I'm trying to add a custom post status "Needs Review" for posts/pages that have been updated by an editor, so that admins can easily see what has been updated and review the changes. The planned ...
1
vote
0answers
20 views

Individual post. Meta_key, taxonomy or post status for separation?

I have a posts with custom type - TOUR. Among ordinary Tours sometimes I need to create "personal" or "private" Tour, which will be shown only to assigned user. What the way is better to exclude this ...
1
vote
0answers
38 views

Allowing user to edit posts based on the post status

I have Edit Flow and User Role Editor installed on my news site and I basically wanted to do a system where editors pitch ides worth writing about to contributors. So I would want my contributors to ...
1
vote
0answers
105 views

WordPress action hooks related to scheduled posts not Fired

I have scheduled posts to publish automatically in future. I want when theses posts are published do some stuffs, so I used below code: add_action( 'publish_post', 'after_post_published' ); ...
1
vote
0answers
791 views

Posts and Attachments with “Published” status in Search

I would like the search to show only published posts and attachments (the attachments are photographs taken directly from the media library). The trouble is, when I specify that the post_status must ...
1
vote
0answers
43 views

How to use same page template if post status other than 'publish'?

Quick question about relationship between post status and template. If non-logged user tried to access a page(or a post) which status is private or draft (or anything other than publish), how do I ...
1
vote
0answers
709 views

Can not get future_to_publish to work

I'm trying to figure out why future_to_publish will not work. Here is a list of what I have checked to work: draft_to_publish future_post publish_post transition_post_status (works ...
1
vote
0answers
106 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
0answers
142 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
0answers
174 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"); } add_action('...
1
vote
0answers
1k 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
1answer
419 views

get_terms(); show private posts when logged in

Hi have a custom post type "FAQ". I got some "FAQ's" that are private, also only visible for logged in users. I used "get_terms()" funktion for a widget that is listing links to the categories of ...
0
votes
0answers
38 views

If click on Save/Publish change Post Status to Pending Review instead Publish

Here's my problem. I need following solution. If a user is in the admin area of Wordpress and is not an administrator - and creates a page or product(via WooCommerce) - that if this user clicks on ...
0
votes
1answer
22 views

What differences are there between a Privately Published post and a Draft post?

WordPress has three different post statuses: Published Pending Review Draft It also has three different visibility options: Public Password protected Private When you set a post to Published and ...
0
votes
0answers
26 views

WordPress post_status and meta_query

I created a custom post status and I would like to set auto-change (clients are filling two dates, precomming and ongoing). How can I do auto-post-status change when it is after precomming or ongoing ...
0
votes
1answer
24 views

How publish post from pending status

wp_publish_post() function not work correct, because need to generate url and define author. Post added via User Frontend Pro plugin. Posting via admin panel works correct.
0
votes
1answer
18 views

Put page on Archived statut after end of publication date

I’m looking for a way to put pages on archived statut after expiration of the publication date. First, I add archived statut to the platform (code below). This statut appear if the page is published. ...
0
votes
0answers
29 views

get_next_post() not working with future post status

I'm using in single post template simple navigation below the post content: $next_post = get_next_post(); if($next_post) { $next_title = strip_tags(str_replace('"', '', $next_post->...
0
votes
0answers
29 views

How to create and assign a post-state on page creation?

I am creating a page within a plugin, I am then trying to add a post state to this page however I seem to only be able to add the state to all pages as the filter is called before the create page ...
0
votes
1answer
119 views

Bulk edit orders to 'wc-processing' status

I searched for an answer but couldn't find any. How can I allow bulk edit orders to wc-processing status? Currently I can any other status but this one and it's making the work harder, making me go ...
0
votes
0answers
20 views

Change post visibility from the front end

I'm using Bill Erickson's excellent Display Posts plugin to show a list of posts on a page. I am trying to make a toggle switch based on a radio button or checkbox that allows me to switch a post ...
0
votes
1answer
55 views

how to change value return by _stock_status

i am finding how to change the value from _stock_status on single product. I have display the product stock status by that code: <?php echo get_post_meta( get_the_ID(), '_stock_status', true ); ?&...
0
votes
1answer
24 views

Sql Update CPT from publish to draft and particular custom field

I have: CPT: match custom field: played Is it possible by MySql to change the status from publish to draft of all posts of CPT 'match' with custom field set as '0'? A good start can be UPDATE ...
0
votes
1answer
314 views

Creating/editing custom 'post-state'

I want to be able to easily create/edit my own custom "post-state" for display in the Pages back end. I only want this text appearing after the page name - not in the status dropdown, or anywhere ...
0
votes
0answers
35 views

Custom Post Status not getting displayed after post update

I used the below code to register my post status and also to select. Everything works fine except the case when it has to display the post status after updating the post, it doesn't show at all. So, ...
0
votes
0answers
15 views

Custom status and permalinks don't work?

To satisfy a site migration from another platform, we have implemented custom statuses using the standard `register_post_status()' approach. $args = array( 'label' => _x( '...
0
votes
1answer
2k views

How to change post status from “draft” to “publish”?

My script uses code to set post content. I am also running the WP To Twitter plugin, to auto-tweet those posts. The problem is, whilst the plugin is correctly formulating its tweets using the default ...
0
votes
0answers
32 views

How to save post_status using action save_post?

I have a custom post status and i'm wondering if it's possible to save changes of post_status using action save_post? Sample codes would be great.
0
votes
0answers
76 views

How to stop post status from reverting to Published?

I have custom post types and custom statuses registered. The post status is updated from a custom drop down box that I have inserted into a metabox on the edit post screen. It works fine, however ...
0
votes
1answer
38 views

change page status with code

I am setting up a site that has online registration. Registration is only for certain months and therefore I want to create a button on the dashboard to toggle registration on/off. The way I was ...
0
votes
1answer
80 views

Modify loop to include all post statuses not just 'published'

I have third party authors and they cannot publish posts - they have to submit them for review and I then review & publish them. The posts are tied together & associated with each other, in a ...
0
votes
1answer
387 views

Submitted for Review back to a Draft page

I would like to allow a WordPress contributor to change a draft page Submitted for Review back to a draft page without giving the contributor the capability to publish pages. I have tried without ...
0
votes
0answers
310 views

Automatically move pending posts after 30 days and, update the post date, when users update the posts

I have a multi-user blog, and would like to implement two functions in WordPress 4.3.1. The first function moves publish posts in pending after 30 days. I used a add_action. My code: function ...
0
votes
0answers
142 views

Auto draft posts when scheduled date is reached

I have a plugin that allows all scheduled posts to be visible immediately... I'm looking for a function that will automatically set a post's status to "draft" when it reaches it's scheduled date and ...
0
votes
0answers
284 views

date archive future posts

Im using cpt for events and i need to display them in a calendar. most of the events are future. i managed to query the right ones by post_status at the archive, but I need to do the same at the ...
0
votes
1answer
259 views

Custom Post Status & Taxonomies

I have successfully registered my custom post types, custom post statuses and my custom taxonomies/terms. All is working fine but... It seems that both the 'categories' column within the custom post ...
0
votes
0answers
267 views

Include attachments with a custom taxonomy in search

I need to include attachments in the search. So far, I have managed this by hooking into pre_get_posts and checking if it's on the search results page, I add 'attachment' to the post_type and 'inherit'...
0
votes
1answer
111 views

How to change post status link order(priority) on cpt listing page

On a custom post type listing page the registered post statuses are listed as links above the post lists. I've a situation where custom registered post types are showing after 'trash' and I still want ...
0
votes
1answer
184 views

How to define which register_post_status goes to which register_post_type?

New to registering post types but looking at samples, and the codex not helpful here. I am not understanding how the two of these relate? This is just bare bones so someone can explain (the parameter ...
0
votes
1answer
550 views

How to update post status to draft if user role is "pending'

I'm creating a website where user pays to publish posts. If this user membership expires, the role changes from "Subscriber" to "Pending". I need a code that allows to update all posts to draft if ...
0
votes
1answer
107 views

In the Edit Post page how do I modify with jQuery the status select list?

Here is my JS: jQuery('#post_status option[value="draft"]').text('Approve'); I simply trying to modify the text inside the option element in the status select form element in the Edit Post page. ...
0
votes
0answers
134 views

Excluding certain post status's from pagination

If a user is logged in and browsing through archives, the current pagination function factors in posts that aren't yet published which can result in page numbers leading to 404 pages. How can I get ...
0
votes
1answer
425 views

Get publish post link?

Is there a way I can call a link so when clicked it publishes the post via the ID I provide? I have get_delete_post_link( $postID ) set fine, and would like to do the same to make a draft go to ...
0
votes
0answers
45 views

How to create posts with a specific date in bulk

I need to import posts with a specific date. They way I am doing it now is I import as draft, then I use php to publish, then use php to change the date. The problem is that if I make a mistake in ...
0
votes
1answer
119 views

Is it possible to cancel a post status transition?

Question I want to cancel pending_to_published actions: Posts that match certain criteria should that go from pending to published should stay pending. (Alternatively, I need a to make add an "...