Created
January 30, 2014 17:24
-
-
Save alexkingorg/8713859 to your computer and use it in GitHub Desktop.
Implode with $wpdb (from: https://coderwall.com/p/zepnaw)
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
<?php | |
$results = $wpdb->get_results( | |
$wpdb->prepare(" | |
SELECT ID, post_title, post_name, post_parent | |
FROM $wpdb->posts | |
WHERE post_parent IN (".implode(',', array_map('intval', $post_ids)).") | |
") | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment