From acec3cc668e58b889ba52cb9695b6f7a094af7b3 Mon Sep 17 00:00:00 2001 From: Roy Date: Tue, 18 Oct 2016 14:37:43 -0400 Subject: [PATCH] Search only posts by author --- functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 33edbf1..a60b7b3 100644 --- a/functions.php +++ b/functions.php @@ -216,7 +216,7 @@ function db_filter_authors_search( $posts_search ) { if ( empty( $matching_users ) ) return $posts_search; // Take a slightly different approach than core where we want all of the posts from these authors - $posts_search = str_replace( ')))', ")) OR ( {$wpdb->posts}.post_author IN (" . implode( ',', array_map( 'absint', $matching_users ) ) . ")))", $posts_search ); + $posts_search = str_replace( ')))', ")) OR ( {$wpdb->posts}.post_author IN (" . implode( ',', array_map( 'absint', $matching_users ) ) . ") AND {$wpdb->posts}.post_type = 'post'))", $posts_search ); return $posts_search; } /**