Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #3 from jmr06005/master
Search only posts by author
  • Loading branch information
jmr06005 committed Oct 18, 2016
2 parents aba29a3 + acec3cc commit 02b7384
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions.php
Expand Up @@ -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;
}
/**
Expand Down

0 comments on commit 02b7384

Please sign in to comment.