SHARE
TWEET

Untitled

a guest Apr 20th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * Only Show Current User's Media Attachments
  3.  */
  4. function show_current_user_attachments( $query ) ) {
  5.     $user_id = get_current_user_id();
  6.  
  7.     if ( $user_id ) {
  8.         $query[ 'author' ] = $user_id;
  9.     }
  10.  
  11.     return $query;
  12. }
  13. add_filter( 'ajax_query_attachments_args', 'show_current_user_attachments', 10, 1 );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top