Custom Post Status not getting displayed after post update
Custom Post Status not getting displayed after post update
Custom Post Status not getting displayed after post update
You’ll have to use JOIN to achieve this: UPDATE wp_posts p INNER JOIN wp_postmeta pm ON p.ID = pm.post_id SET p.post_status=”draft” WHERE p.post_type=”match” AND pm.meta_key = ‘played’ AND pm.meta_value = 0;
You can use the code update_post_meta( get_the_ID(), ‘_stock_status’,$value) to change the value of the meta. Please place the above line in the code where you want to change the status value and remember $value is the variable/array/object you can place any string/array/object in it.
This code works to change to order status to processing: $order = new WC_Order( $order_id ); if ( ! empty( $order ) ) { $order->update_status( ‘processing’ ); } So you’ll need to query all orders by ID and use that code in a loop, like so: $query = new WC_Order_Query( array( ‘limit’ => -1, ‘return’ … Read more
get_next_post() not working with future post status
You could create a function with a query that gets all posts older than a certain date, loop through the posts and set your archive variable. If you call that function with a custom action hook like this add_action( ‘my_daily_archive_cronjob’, ‘archive_old_pages’ ) you can trigger it daily with this plugin: WP Crontrol.
I found the solution i was looking for, if anyone in the future has the same question i am posting the answer. To make a post with lets say “Status1” to show only “Status2” and hides other statuses like “Status3 and Status4” (with css): function hidepoststatus() { $post=”Status1″; global $post; if ( $post->post_status == ‘Status1’ … Read more
When WordPress gives you errors such as that the post needs an author and permalink, it is best to figure out a way to provide these. Otherwise you are asking for trouble further down the line. You might find a way to force it, but it would be an uphill battle. WordPress is like a … Read more
WordPress post_status and meta_query
If click on Save/Publish change Post Status to Pending Review instead Publish