wp/wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
equal deleted inserted replaced
21:48c4eec2b7e6 22:8c2e4d02f4ef
    59 		 * @param WP_REST_Request $request    The request used.
    59 		 * @param WP_REST_Request $request    The request used.
    60 		 */
    60 		 */
    61 		$query_args = apply_filters( 'rest_post_format_search_query', $query_args, $request );
    61 		$query_args = apply_filters( 'rest_post_format_search_query', $query_args, $request );
    62 
    62 
    63 		$found_ids = array();
    63 		$found_ids = array();
    64 		foreach ( $format_slugs as $index => $format_slug ) {
    64 		foreach ( $format_slugs as $format_slug ) {
    65 			if ( ! empty( $query_args['search'] ) ) {
    65 			if ( ! empty( $query_args['search'] ) ) {
    66 				$format_string       = get_post_format_string( $format_slug );
    66 				$format_string       = get_post_format_string( $format_slug );
    67 				$format_slug_match   = stripos( $format_slug, $query_args['search'] ) !== false;
    67 				$format_slug_match   = stripos( $format_slug, $query_args['search'] ) !== false;
    68 				$format_string_match = stripos( $format_string, $query_args['search'] ) !== false;
    68 				$format_string_match = stripos( $format_string, $query_args['search'] ) !== false;
    69 				if ( ! $format_slug_match && ! $format_string_match ) {
    69 				if ( ! $format_slug_match && ! $format_string_match ) {