X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/16e7b37c7914d753890c1a05a9335f3b43751eb8..refs/tags/wordpress-4.7.1:/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php index f0055ee4..8f0318ad 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php @@ -47,6 +47,11 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { } } + // Filter query clauses to include filenames. + if ( isset( $query_args['s'] ) ) { + add_filter( 'posts_clauses', '_filter_query_attachment_filenames' ); + } + return $query_args; }