wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_edit_attachments_query › WordPress Function

Depuis2.5.0
Dépréciéen/a
› wp_edit_attachments_query ( $q = false )
Paramètres:
  • (array|false) $q Optional. Array of query variables to use to build the query. Defaults to the `$_GET` superglobal.
    Requis: Non
    Défaut: false
Retourne:
  • (array) {
    Array containing the post mime types and the available post mime types, in that order.

    @type array<string, array{0: string, 1: string, 2: array}> $0 Post mime types. See get_post_mime_types().
    @type string[] $1 Available post mime types.
    }
Défini(e) dans:
Codex:

Executes a query for attachments. An array of WP_Query arguments can be passed in, which will override the arguments set by this function.



Source

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 );
}