_filter_query_attachment_filenames()WP 4.7.0

Deprecated from version 6.0.3. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

Filter the SQL clauses of an attachment query to include filenames.

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.


Array. The unmodified clauses.


_filter_query_attachment_filenames( $clauses );
$clauses(array) (required)
An array including WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT, fields (SELECT), and LIMITS clauses.


Since 4.7.0 Introduced.
Deprecated since 6.0.3

_filter_query_attachment_filenames() code WP 6.1.1

function _filter_query_attachment_filenames( $clauses ) {
	_deprecated_function( __FUNCTION__, '4.9.9', 'add_filter( "wp_allow_query_attachment_by_filename", "__return_true" )' );
	remove_filter( 'posts_clauses', __FUNCTION__ );
	return $clauses;