Checking if a specific post is a draft? after wp_get_recent_posts();
-
Hello,
What I’m doing is checking for the latest post(s)
I use
$recent_posts = wp_get_recent_posts();
to get the recent posts and then
foreach( $recent_posts as $post ){ $wpname = $post["post_title"]; $wplink = get_permalink( $post["ID"] ); echo ' [WP_CFG]<br> wppname="'.$wpname.'" wpplink="'.$wplink.'" wppactive="1"'; break; }
to output the latest post
but I need to check if the post is a draft or not
so if it is it will continue to the next post…But I don’t know if and if yes how to check if a post is for draft or not.
So can you check for this and if yes how?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Checking if a specific post is a draft? after wp_get_recent_posts();’ is closed to new replies.