Questions tagged [post-status]

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

74 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
832 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 ...
2
votes
1answer
175 views

How do I batch create revisions of all posts?

I cleaned up an old-site from pasted tags, manually created lists, etc, and I'd like to keep the old posts as "revisions", so we can easily "compare" with the old posts and retrieve/revert the ...
2
votes
1answer
670 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
37 views

Send email with custom fields after new draft is saved or new post published

I have a custom post type immobile with some custom fields created with Toolset Types. I need to send and email with the title and a custom field when a new immobile is saved as a draft or it's ...
1
vote
0answers
20 views

Featured image overlay when changing post status

I have a car brokerage in Spain with wordpress website using the MOTORS theme from Themeforest. Out of the box, the theme didn´t have all the functionality I wanted, primarily the ability to mark cars ...
1
vote
0answers
76 views

Remove 'private' and 'pending review' options from post status dropdown

I don't know how to remove these two options (private and pending review), for non admin users. This is a custom post type.
1
vote
1answer
66 views

WordPress post_status is future, manually added

My time zone is UTC+1. Now (and when the post creates the database): 2019-12-16 08:06:00 GMT (now): 2019-12-16 07:06:00 INSERT INTO `wp_posts` ( `ID`, `post_author`, `post_date`, `post_date_gmt`, `...
1
vote
0answers
108 views

transition_post_status not working via Quick Edit

I am trying to use transition_post_status with custom post statuses to update user meta each time a post status is updated. The following works when editing the post status in Edit Post Screen, but ...
1
vote
1answer
89 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
2k 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
28 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
138 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
226 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
44 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
118 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
1k 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
44 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
110 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
145 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
644 views

Restrict edit, but allow preview for custom post status

I am developing a Wordpress site with Edit Flow plugin, so I can create custom post statuses to manage author and contributor posts more easily. So I have created custom post status and I've got ...
1
vote
0answers
237 views

Wordpress capabilities on pending post status

I have user with contributor user role. In default if you publish article as contributor you can only view it and you can't delete or edit it. But when you submit new post for review, you can do all ...
1
vote
0answers
176 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
510 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
12 views

Sync Woocommerce Product Status with ACF

I have 2 websites, which use the same products/categories and stuff. On both, there is a custom field - "Display on Website", which is a True/False ACF Field. That one should be synced to &...
0
votes
0answers
25 views

How to create custom status for post and change it after x days

I'm trying to create a new custom status for WP post and custom posts to make specific queries. I used this function to achieve this but without results: // Registering custom post status function ...
0
votes
0answers
21 views

how to deregister default post status for custom post type?

I want to deregister default custom post status which is published and there for i want to register post status for custom post type. I have used "register_post_status" for register but how i ...
0
votes
0answers
40 views

Custom status is not displayed in “all” orders tab on admin interface

I've created a custom plugin that add some custom status and sync it with a backend service. But orders is not displayed, on admin interface my custom status not appear and orders is not displayed in ...
0
votes
1answer
28 views

Custom product status get filtered on all product list views

I registred a new product status with this code : function register_custom_post_status(){ register_post_status( 'invalid', array( 'label' => __( 'Not valid',...
0
votes
0answers
48 views

How to change order status based on shipping method for woocommerce subscriptions

I'm using the code below for automatically updating the order status from "processing" to "completed" if the "free_shipping" method is selected. Unfortunately this isn't working with Woocommerce ...
0
votes
0answers
11 views

WordPress Custom Post Status not Public but Viewable Through Link

I have been working on my site to bring up private posts on my site. I built a custom post status for this purpose. My goal is to exclude posts belonging to that post status from search, from Blog ...
0
votes
0answers
54 views

Show custom post status when logged out

Background: I have a few different custom post status on my installation. We use them for a workflow. Lets just say for example we have: Draft (built in) ForClient (custom) Published (built in) Now ...
0
votes
1answer
34 views

How to hide private posts even if user is admin

Even if admins, I dont want to view private posts for custom post type. Added the following code. function my_function( $query ) { if ( ! is_admin() && ( is_singular( 'my_post_type' ) || ...
0
votes
0answers
46 views

Update post status from “publish” to “trash” prior to year 2018

I want to update all posts with status from published to trashed or delete permanently. whose published date is 2018 and previous using WordPress cronjob. Example: If I have 209085 posts, 500 posts ...
0
votes
0answers
56 views

Transition_Post_Status hook not working properly

When I run this code, the $cptnumber variable doesn't receive the custom post type number when I set a published post to draft. (For example: 367) It works when I trash a post, but not when I change ...
0
votes
0answers
471 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
0answers
70 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
38 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
212 views

Hide or remove custom post status

I want to hide or remove a custom post status when it is set to a specific one. e.g. If I have a post set to status "pendingreviewf" I want to hide the option to change it to the status "shipedf" ...
0
votes
1answer
32 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
76 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
1answer
562 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
1answer
171 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
50 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
839 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
46 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
20 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
0answers
38 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
94 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 ...