Created
October 5, 2020 07:55
-
-
Save hlaporthein/f761ba2716219988e043a989c93b1f43 to your computer and use it in GitHub Desktop.
post by no meta record exist in wordpres
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$query = "SELECT p.id from $wpdb->posts p WHERE p.id NOT IN ( SELECT m.post_id FROM $wpdb->postmeta m WHERE m.meta_key = 'date_taken') | |
AND post_status IN ('inherit', 'publish') | |
AND post_type IN ('galleries', 'attachment')"; //only post ids not the whole post in selection | |
$the_query = $wpdb->get_results($query); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment