Array
(
[action] => query-attachments
[post_id] => 838
[query] => Array
(
[post_mime_type] => image
[orderby] => date
[order] => DESC
[posts_per_page] => 40
[_acfuploader] => field_579b87ce88001
[paged] => 1
)
)
Array
(
[post_mime_type] => image
[orderby] => date
[order] => DESC
[posts_per_page] => 40
[paged] => 1
[post_type] => attachment
[post_status] => inherit,private
)
//$_POST['query']['_acfuploader'] holds the field key for the image field that popped up the media library.
**ACF PRO Files Field Custom Upload Directory**
https://www.ractoon.com/2016/08/wordpress-acf-pro-files-field-custom-upload-directory/
**WPSE/ How Can I Organize the Uploads Folder by Slug (or ID, or FileType, or Author)?**
https://wordpress.stackexchange.com/questions/25894/how-can-i-organize-the-uploads-folder-by-slug-or-id-or-filetype-or-author/53895#53895
**WPSE/ Restrictions on Media Library modal by ACF field**
https://stackoverflow.com/questions/38654423/different-restrictions-on-media-library-modal
**WPSE/ WordPress: Change directory upload based on user-edit page**
https://stackoverflow.com/questions/25187374/custom-meta-boxes-and-fields-for-wordpress-change-directory-upload-based-on-use
----
### Obtain Post ID or User ID
**WPSE/ How to obtain the user ID of the current profile being edited in WP-Admin?**
https://wordpress.stackexchange.com/questions/69461/how-to-obtain-the-user-id-of-the-current-profile-being-edited-in-wp-admin
**ACF support/ Getting the ID of the current post before wp_handle_upload_prefilter**
https://support.advancedcustomfields.com/forums/topic/getting-the-id-of-the-current-post-before-wp_handle_upload_prefilter/
----
### Error Logging and Debugging
**ACF support/ Error logging in posts_where filter**
https://support.advancedcustomfields.com/forums/topic/media-fields-dissapear-when-using-posts_where-and-posts_join/
**ACF support/ write attachment query to file**
https://support.advancedcustomfields.com/forums/topic/filter-gallery-items/