Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Implode with $wpdb (from: https://coderwall.com/p/zepnaw)
<?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
You can’t perform that action at this time.