Advertisement
barzik

get_users_futures

Oct 25th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. /**
  2.  * Retrieve the user's future posts.
  3.  *
  4.  * @param int $user_id User ID.
  5.  * @return array
  6.  */
  7. function get_users_futures( $user_id ) {
  8.     global $wpdb;
  9.     $query = $wpdb->prepare("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'future' AND post_author = %d ORDER BY post_modified DESC", $user_id);
  10.  
  11.     /**
  12.      * Filter the user's drafts query string.
  13.      *
  14.      * @param string $query The user's drafts query string.
  15.      */
  16.     $query = apply_filters( 'get_users_futures', $query );
  17.     return $wpdb->get_results( $query );
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement