Questions tagged [post-status]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
40 views

retrieve post details in loop

I have written a function to loop through the users posts, and im trying to display each of the posts by their status, with a different message for each status group. for some reason - get_post_status ...
0
votes
1answer
10 views

How can I specify the post status of an untrashed post?

By default Wordpress assigns the draft status to a post that has been untrashed. I would like to assign the pending status to posts that are untrashed. This seems to be possible with ...
0
votes
0answers
12 views

How can I add the Post Status option to the Admin for Media Library posts? I want to be able to set their Status to Private,

Is there a way to add the Post Status option to the Admin for Media Library posts (as with Posts and Pages)? I want to be able to set the Status of individual Media Library items to Private. My ...
0
votes
0answers
9 views

How can I display a category page with future sub categories?

In a recent project I had to build a custom category page. On this parent category, I display sub categories.(just thumbnail and title) Some of these subcategories'posts will be published in future. ...
0
votes
1answer
35 views

How can I style future post?

I'm showing published and future posts on a category page. I need to make future posts unclickable and add a special class to them in order to add a gray overlay, meaning the post is upcoming.. trying ...
0
votes
1answer
38 views

How to set a Post's default visibility to 'Private' in Gutenberg?

I am trying to set a Post's default visibility to 'Private' when a user first creates the post. They should then have the ability to manually select 'published' from the sidebar dropdown once they are ...
0
votes
0answers
9 views

Fetch ids of live posts only (not posts with other statuses) and change status with a button in candidate dashboard

I have added a button in posts list in candidate dashboard that changes status of all posts to "offline" first, then updates the current post to "publish". I want to do this: fetch ...
0
votes
0answers
12 views

Change post status based on taxonomy

Need help with this code. I want to change status of a post if a taxonomy is Y value. The code I have, based on other I saw for meta fields. //add_action('init','my_hourly_event'); function ...
1
vote
0answers
22 views

how to do a processing Orders into Complete after x Minutes or x hour in WooCommerce [closed]

I have tried this code its works only one time. help me and check where I am wrong. code goes in child theme function.php add_action( 'woocommerce_order_status_changed', '...
1
vote
0answers
6 views

Can't schedule post for another time

Very odd thing happening - suddenly, I can't click on the "Edit" link under the Publish options. That is, I can hit "Publish" but if I want to change the publishing date/time or ...
0
votes
0answers
11 views

Multi-dimensional Order status?

I am not looking for a way to edit the Order Status list of WooCommerce, I, however, looking for a way to create a multi-dimensional list of statuses. The direct example (which is available natively ...
0
votes
0answers
36 views

wp_update_post() doesn't update post_status

First of all, I've already checked the solution for this question: Why doesn't wp_update_post() update the post_status field? I am having trouble with updating post_status of products and ...
0
votes
0answers
20 views

Change user's posts to draft upon user role change

I want to change a user's posts (in a custom post type) from published to draft upon a change in their user role. Anyone know how I can do that programmatically?
0
votes
2answers
41 views

get_comments with post_status 'public' retrieves NULL result

This is my loop: <?php $comments = get_comments(array( 'status' => 'approve', 'type' => 'comment', 'number' => 10, 'post_status' => 'public' )); ?> <ul class=&...
0
votes
1answer
33 views

Any way to change post/page status when editing page?

Pre-Gutenberg, in the “Status & Visibility” panel, there used to be a way to change a Post’s status from “Published” to “Draft” or “Pending Review” – is that just gone now? The only way I can see ...
0
votes
0answers
30 views

Updating post status via rest api

I am attempting to remove/hide a post via the REST API and having issues. Currently, I have tried sending the payload as: { 'status':'private' } And I send the request to: /wp/v2/posts/<id ...
0
votes
0answers
30 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 &...
1
vote
1answer
101 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
26 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 ...
0
votes
1answer
36 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
1answer
646 views

Accessing private posts through REST API, same code that works in remote doesn't in local

I am capable of fetching private posts through the wp rest api by calling mydomain/wp-json/wp/v2/posts?status=private&slug=whatever I am authenticating well and receiving a valid token, no ...
1
vote
1answer
42 views

Second transition_post_status hook fired instead of the first

I'm using transition_post_status to move a post into another post type based on the $new_status, I had made two hooks but the second one always firing first even though the $new_status is 'publish'. I ...
1
vote
0answers
297 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
226 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`, `...
0
votes
0answers
57 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
2answers
479 views

Published post auto change status to pending after 90 days

I registered a custom post type "job" to create job board site. Without a plugin, how can I make the posts auto change status to pending after 90 days? I am new in WordPress & PHP. I tried some ...
0
votes
1answer
109 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
1answer
151 views

Woocommerce - Remove cart button depending product (post) status

I created (copied) a custom post status for my old/discontinued product in my function.php and everything is working fine. Now, I want to make those old product unpurchasable by removing the cart ...
1
vote
1answer
63 views

Custom post type suppress transition from future to publish

I've scheduled a custom post type to a future datetime. Now I won't that it will be published automatically, instead it should switch the status to draft. We use this to pulish the webinars, so we ...
0
votes
0answers
101 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 ...
1
vote
0answers
208 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 ...
0
votes
0answers
169 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 ...
1
vote
1answer
101 views

How can I set a Post's default visibility to private and pending review checked

there are 2 things I'd like to do: 1. set a post's visibility to private by default. I've been looking around the web for a code or even a plugin that lets me do this. The problem I've run into is ...
0
votes
1answer
199 views

edit.php all post not working

i am using publish press plugin to create a custom post status i changed the all post status into public, using this register_post_status( $status->slug, [ 'label' => $...
1
vote
1answer
106 views

How to limit post of custom post status?

I have a custom post type 'Commercials' and custom post status 'Featured'. Now I want only one featured post. What I mean is right now I can make all posts as Featured, but I want only one to be ...
0
votes
0answers
885 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
2answers
102 views

Include future posts in tags and in search

I am using something like this to query and display future or scheduled posts on my homepage: <?php query_posts('post_status=future&posts_per_page=10&order=ASC'); while ( have_posts() ) : ...
0
votes
3answers
3k 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
116 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
55 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
666 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" ...
1
vote
1answer
210 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 ...
3
votes
1answer
87 views

Get a list of ALL Statuses both registered and built-in

I have been searching high and low for a way to get ALL statuses, the built-ins, and the customs registered. But i have only been able to retrieve a few of other registered statuses of an installed ...
1
vote
1answer
923 views

Which is the better way to get the status of a post?

Which is the better way to get the current status of a post and why? A: $post_id = get_the_ID(); //999 $current_post_status = get_post_status($post_id); echo $current_post_status; //publish B: $...
0
votes
1answer
42 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
173 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
914 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
347 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
73 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 ...
-1
votes
2answers
253 views

Change post status by custom fields

I'd like to update my post status (of my own CPT) based on custom field "played". If played is 1 i want that the post shall be published, but if the custom field played is 0 the post shall be draft ...

1
2 3 4 5 6