WP 3.5 Media Library items limit
-
Hi everyone.
My understanding of the new WP 3.5 Modal Uploader Media Library Tab (wp.media.frames.file_frame) contents is that it queries wordpress via Ajax and admin-ajax.php and executes the function wp_ajax_query_attachments. I want to limit media showing on the Media Library tab modal to its specific author, meaning images in that said tab should only be visible to the one who uploads it.
I tried several suggestions including pre_get_posts, where filter, etc but did’nt seem to do it.
My solution is to add an action with the tag “wp_ajax_query_attachments” and put the priority to 999 but it doesnt override the core function. I tried removing the action via hooks (admin_init and init) and add my own function via add_action but to no avail.
Hope anyone can help me out.
Thanks,
MattPS. for the meantime, I edited core file ajax-actions.php and added $query[‘author’] = get_current_user_id(); to the query. I know this is bad practice but it leaves me no choice ??
- The topic ‘WP 3.5 Media Library items limit’ is closed to new replies.