fauzanjeg

Give User to Access All Media

Dec 20th, 2020 (edited)
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1. /* For Show ALl Media */
  2. if ( is_admin() ) { /* If can access admin dashboard */
  3.     /* For Show ALl Media in Grid View */
  4.     function show_all_media($query)
  5.     {
  6.         $query['author'] = '';
  7.         return $query;
  8.     }
  9.     add_filter('ajax_query_attachments_args', 'show_all_media', 99);
  10.  
  11.     /* For Show ALl Media in List View */
  12.     remove_action( 'pre_get_posts', array( JNews\AccountPage::getInstance(), 'users_own_attachments' ) );
  13.  
  14.     /* For Delete Attachment */
  15.     remove_action( 'delete_attachment', array( JNews\AccountPage::getInstance(), 'disable_delete_attachment' ) );
  16. }
Add Comment
Please, Sign In to add comment