wp_edit_attachments_query()
Executes a query for attachments. An array of WP_Query arguments can be passed in, which will override the arguments set by this function.
No Hooks.
Returns
Array. Array containing the post mime types and available post mime types.
Usage
wp_edit_attachments_query( $q );
- $q(array|false)
- Array of query variables to use to build the query.
Default:$_GETsuperglobal
Changelog
| Since 2.5.0 | Introduced. |
wp_edit_attachments_query() wp edit attachments query code WP 6.9.1
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 );
}