Created
August 14, 2019 09:15
-
-
Save Inzman/dc6015d2381cad0075a16fc2e69eeb17 to your computer and use it in GitHub Desktop.
Wordpress - Manage Your Media Only in admin
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
| add_filter( 'ajax_query_attachments_args', 'show_current_user_attachments' ); | |
| function show_current_user_attachments( $query ) { | |
| $user_id = get_current_user_id(); | |
| if ( $user_id ) { | |
| $query['author'] = $user_id; | |
| } | |
| return $query; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment