WordPress 4.7.1
[autoinstalls/wordpress.git] / wp-includes / rest-api / endpoints / class-wp-rest-attachments-controller.php
index f0055ee4b33d39f18562d6833f68ead5e0652fee..8f0318adbee83298e4f68de8f411bedd9411237f 100644 (file)
@@ -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;
        }