ajax_query_attachments_args

ajax_query_attachments_args

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.4.3

apply_filters('ajax_query_attachments_args') is found 1 times:

  • /wp-admin/includes/ajax-actions.php line 3068
    	 * @see WP_Query::parse_query()
    	 *
    	 * @param array $query An array of query variables.
    	 */
    	$query             = apply_filters( 'ajax_query_attachments_args', $query );
    	$attachments_query = new WP_Query( $query );
    	update_post_parent_caches( $attachments_query->posts );
    
    	$posts       = array_map( 'wp_prepare_attachment_for_js', $attachments_query->posts );
    	$posts       = array_filter( $posts );
    	$total_posts = $attachments_query->found_posts;
    

See this hook used in plugins: