Set Post Private if no linked Post Objects (ACF)
Set Post Private if no linked Post Objects (ACF)
Set Post Private if no linked Post Objects (ACF)
How to return a 410 code for previously published posts now set to draft?
The reason it is a draft, and what you need to do to get what you wanted is spelt out in the source code for wp_untrash_post and in the documentation for wp_untrash_post_status: https://github.com/WordPress/WordPress/blob/bbf017e550b02f5d11e409b07e689d45c984054d/wp-includes/post.php#L3668-L3685 $new_status = ( ‘attachment’ === $post->post_type ) ? ‘inherit’ : ‘draft’; /** * Filters the status that a post gets assigned when … Read more
Show Last Revision Of Post That Has A Published Status On Single Page
There is a syntax error in the add_action(). You’ve used a period . instead of a comma , to separate the action and the callback. Otherwise the callback seems to work as expected when I tested it locally. The correct syntax would be, add_action( ‘pending_to_publish’, ‘my_function’, 10, 1 ); When doing development work with WordPress … Read more
How to Add Custom Post Status in WordPress Admin
Manually adding or updating CPT automatically sets post_status of future
You can use AND and OR statements in MySQL. Try this: $count = $wpdb->get_var( “SELECT COUNT(*) FROM $wpdb->posts $where AND (post_status=”publish” OR post_status=”draft”)” );
You could use get_post_status(): function is_trash( $post_id = 0 ) { 0 == $post_id and $post_id = get_the_ID(); return ‘trash’ === get_post_status( $post_id ); } Side note: To get a list of all registered post status objects use get_post_stati() – yes, that’s wrong.
What you could do is create a metabox for the ‘People’ custom post type which would have radio values ‘Not Sponsored’ and ‘Sponsored’ (Not Sponsored b default). PayPal posts some transaction details to the notify url you have specified. Once you recieve the proper information from PayPal, like payment status is completed, then you could … Read more