On this page
wp_edit_attachments_query( array|false $q = false ): array
Executes a query for attachments. An array of WP_Query arguments can be passed in, which will override the arguments set by this function.
Parameters
$qarray|false Optional-
Array of query variables to use to build the query.
Defaults to the$_GETsuperglobal.Default:
false
Return
array
Source
File: wp-admin/includes/post.php. View all references
function wp_edit_attachments_query( $q = false ) {
wp( wp_edit_attachments_query_vars( $q ) );
$post_mime_types = get_post_mime_types();
$avail_post_mime_types = get_available_post_mime_types( 'attachment' );
return array( $post_mime_types, $avail_post_mime_types );
}
Related
Uses
| Uses | Description |
|---|---|
| wp_edit_attachments_query_vars() wp-admin/includes/post.php | Returns the query variables for the current attachments request. |
| get_available_post_mime_types() wp-includes/post.php | Gets all available post MIME types for a given post type. |
| wp() wp-includes/functions.php | Sets up the WordPress query. |
| get_post_mime_types() wp-includes/post.php | Gets default post mime types. |
Used By
| Used By | Description |
|---|---|
| media_upload_library_form() wp-admin/includes/media.php | Outputs the legacy media upload form for the media library. |
| WP_Media_List_Table::prepare_items() wp-admin/includes/class-wp-media-list-table.php |
Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_edit_attachments_query