Questions tagged [post-status]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
662 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('...
0
votes
1answer
18 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' => $...
5
votes
4answers
5k 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: register_post_status('my_custom_post_status'...
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 ...
1
vote
1answer
44 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
41 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
24 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
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
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
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 ...
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
426 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
4answers
2k views

WP_Query will not display draft posts

I'm trying to get WP_Query to display ALL posts in an array but only ones with status published are showing: global $wp_query; $ids = array(130, 132); $args = array( 'post_status' => array('...
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 ...
34
votes
4answers
101k views

How to Get All Posts with any post status?

I am creating a front end dashboard where I need to show all the posts by the current user. So, I need to show posts in all states, mainly published, trashed and the pending. I am now using a simple ...
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.
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
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 ...
3
votes
1answer
59 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
32 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
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
120 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
56 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 ...
-1
votes
2answers
44 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
607 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
316 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
56 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 ...
12
votes
3answers
17k 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 ...
1
vote
1answer
32 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
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, ...
1
vote
2answers
109 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
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 ...
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
55 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
2
votes
2answers
461 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 ...
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( '...
8
votes
3answers
4k views

How to Display a List of Users Who Have Made at Least 1 Post?

What I would like to do is have a list of users who have contributed at least one post. I need to show the following: [User photo] | [User Name] | [User post count] e.g. [photo] Joe Bloggs(8) I ...
2
votes
2answers
277 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
49 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 ?...
1
vote
1answer
105 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
26 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
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 ...
2
votes
3answers
3k views

Check whether a custom taxonomy term has published posts?

I'm making a magazine theme for a client and using a custom 'issue' taxonomy. There is a new issue every week, and I also have a function that get's the latest issue. But the editor creates a new ...
2
votes
2answers
2k 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 ...
0
votes
2answers
1k views

Update status of all posts in a category

For one of my project I just want to change the post status of all the posts inside a specific category from publish to pending. It is possible to change status of multiple posts at once? I want to ...