wp_edit_attachments_query() WordPress Function

The wp_edit_attachments_query function is used to modify the SQL query that is used to retrieve attachment records for the WP_List_Table class in the WordPress admin.

wp_edit_attachments_query( array|false $q = false ) #

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

$q

(array|false)(Optional) Array of query variables to use to build the query. Defaults to the $_GET superglobal.

Default value: false


Top ↑

Return

(array)


Top ↑

Source

File: wp-admin/includes/post.php

1321
1322
1323
1324
1325
1326
1327
1328
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 );
}


Top ↑

Changelog

Changelog
VersionDescription
2.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More