Skip to content

Instantly share code, notes, and snippets.

@spencermorin
Last active December 17, 2015 23:39
Show Gist options
  • Save spencermorin/5690706 to your computer and use it in GitHub Desktop.
Save spencermorin/5690706 to your computer and use it in GitHub Desktop.
<?php
global $wpdb;
$author_id = 12;
$result = $wpdb->query( $wpdb->prepare( "SELECT ID from $wpdb->posts where post_author = %d AND post_status = 'publish' AND post_type = 'post' LIMIT 10", $author_id ) );
$authors_post_ids = wp_list_pluck( $result, 'ID' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment