Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [post-status]

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

0
votes
1answer
18 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.
1
vote
1answer
13 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 ...
4
votes
1answer
47 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
25 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
14 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
25 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
17 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
31 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
19 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
28 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
23 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
26 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
vote
3answers
411 views

update_post_meta() not working when used with WordPress action

I am trying to update the field when post status changes to published. It is getting the values properly but not updating when I check the what update field is returning. It shows some number. ...
0
votes
1answer
178 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 ...
1
vote
1answer
50 views

Workflow for attachments in Wordpress

I was searching for a way to enable/use a workflow for uploaded files (in my case pictures). Users with specific roles/capabilities should be able to upload files that are connected to a post. The ...
1
vote
1answer
28 views

Add Post Status to Body Class

I have added a custom post status of rejected, working just fine. I want to add the post status to the body of the post when it is being previewed. In order to style a front end information box seen ...
0
votes
0answers
28 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, ...
1
vote
1answer
468 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
2answers
83 views

wp_transition_post_status does not change the status of the post

For some reason, I have to unpublish certain posts every time wordpress loads. This is my code: function af_change_post_status() { $notpayed_posts = new WP_Query( array( 'meta_key' ...
0
votes
0answers
19 views

Hidden particular post_status in edit.php

In the edit.php, is it possible to hide a particular post_status?
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 ...
2
votes
1answer
43 views

1 day after custom date change post status to draft

1 day after koncerter_start_date all posts with custom-post-type koncert have to get the status draft
0
votes
0answers
14 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( '...
2
votes
2answers
248 views

How do I check if a posts status is set to draft or pending?

I would like to check a posts status, in particular I want to know if a post is set to draft or is privately published. I have the following code: if ('draft' != get_post_status() || ...
0
votes
1answer
41 views

wp_dropdown_pages : choose post status to list in dropdown

I would like to create a dropdown of all schedule and publish CPT posts. I seems function wp_dropdown_pages only displays list of publish posts, is it possible to choose which post states to display ?...
0
votes
1answer
1k 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 ...
1
vote
1answer
103 views

Update postmeta Parent when post_status child change

I have custom status = completed. I want to set automatically when child post update status 'completed'. their parent's postmeta also change. here my code: add_action('save_post', '...
0
votes
2answers
25 views

$post->post_type not working

I have this simple piece of code that is not working: if ( 'publish' != $post->post_status ) { return; } When I use this in my code, it blocks posts that should have a status of 'publish'....
0
votes
0answers
31 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
72 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
546 views

wp_insert_post() creates duplicates with 'post_status' => 'publish'

I am trying to add posts of a custom post-type in bulk from a .csv file. Everything works except that it adds the post twice. They are exactly the same in the database except one has author 1 and the ...
0
votes
1answer
260 views

Why transition_post_type hook is called twice for the same post?

I need to do a curl request every time a new post is created. In order to achieve that, i used the following code, very similar to the one provided in the Codex. add_action('transition_post_status', ...
0
votes
2answers
240 views

Auto-generated posts not showing in backend (but being counted!)

I have a custom post type with a custom backend page. I'm creating posts of that type using this code: $postarr = array( "post_type" => "product_settings", "post_status" => "...
2
votes
1answer
244 views

Error after deleting Custom Post Type with a function (no trash used)

I'm using a function which I built to delete all posts from a user after a specific post is deleted. In my case I'm using a Custom Post Type called company. And additional Custom Post Types like jobs ...
1
vote
2answers
187 views

How to update all posts but the current one (post__not_in not working?)

I'm trying to unpublish (set post_status to draft) all posts when a new one (with specific conditions that don't really matter right now) is published. Here's what I currently have: function ...
0
votes
1answer
126 views

transition_post_status doesn't work with bulk updates

I have successfully setup an action that executes when a custom post type is moved from "pending" to "publish" status. Everything works as expected when you change the post status individually (press ...
1
vote
0answers
93 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
170 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 ...
0
votes
2answers
534 views

Custom post status filter links always show a count of all posts in the site with that status, not the logged in users count

I have a custom post status and the issue I have is that the filter option for it that automatically appears above the post listings on the edit.php page of the WP admin shows a total count of all the ...
2
votes
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
37 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 ...
0
votes
1answer
33 views

wordpress post status inquery

I am working on a local server to create wordpress website. I check in database every post which i made after publish its create 2 post in database. One with Inherit post status second with publish ...
0
votes
4answers
1k views

how can i allow users to view their own pending posts in a front-end page

i want to allow users to view their own pending posts in a front end page but when i access the links created for pending post in the database the links doesn't work until the post is approved If I ...
0
votes
1answer
36 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 ...
2
votes
1answer
1k views

Custom Post Status not showing in Custom Post Type ALL view

I've created a simple plugin for our WP site to allow us to enter in our products that we despatch. To do this I've created a new Post Type called 'order_packing' and within that 2 new Post Statuses: ...
0
votes
1answer
92 views

Is there a before_save_post hook or something similar

I need to check the value of a post status before is changed during a post update or even bulk update. And then depending on that value, adjust other values of the post Example: Lets say I have a ...
1
vote
0answers
100 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
1answer
224 views

Change sticky status of posts from phpMyAdmin

I have many sticky posts in my database. Is there any SQL function which I could use from phpMyAdmin to change (remove) sticky status of posts, if post is sticky to change it to not sicky.
1
vote
3answers
4k views

Automatically remove a canceled order in Woocommerce

Been looking around on this website and the internet but can't seem to find a solution. My client wants every order which has the order status cancelled to be completely removed out of WooCommerce ...
0
votes
1answer
75 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 ...