Last active
December 17, 2015 23:39
-
-
Save spencermorin/5690706 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
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