barzik

get_users_futures

Oct 25th, 2014
162
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×