Skip to content

Commit

Permalink
Merge pull request #531 from TheCrowned/fix/530-remove-action_pre_use…
Browse files Browse the repository at this point in the history
…r_query

Removed function action_pre_user_query and its hooks
  • Loading branch information
sboisvert authored Jun 6, 2018
2 parents 4602090 + c5c9d43 commit c3a4e65
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions co-authors-plus.php
Original file line number Diff line number Diff line change
Expand Up @@ -1176,9 +1176,7 @@ public function search_authors( $search = '', $ignored_authors = array() ) {
),
'fields' => 'all_with_meta',
);
add_action( 'pre_user_query', array( $this, 'action_pre_user_query' ) );
$found_users = get_users( $args );
remove_action( 'pre_user_query', array( $this, 'action_pre_user_query' ) );

foreach ( $found_users as $found_user ) {
$term = $this->get_author_term( $found_user );
Expand Down Expand Up @@ -1223,17 +1221,6 @@ public function search_authors( $search = '', $ignored_authors = array() ) {
return (array) $found_users;
}

/**
* Modify get_users() to search display_name instead of user_nicename
*/
function action_pre_user_query( $user_query ) {

if ( is_object( $user_query ) ) {
$user_query->query_where = str_replace( 'user_nicename LIKE', 'display_name LIKE', $user_query->query_where );
}

}

/**
* Modify get_terms() to LIKE against the term description instead of the term name
*
Expand Down

0 comments on commit c3a4e65

Please sign in to comment.