Include post_status check within $wpdb query
Short Answer To get the post status, you’ll need to JOIN the posts table based on the post_id you grabbed from wpm1 or wpm2 and extend your WHERE clause to use that joined data. Recommendation On the other hand, instead of going directly to the database to get your content, you could use WP_Query to … Read more