Skip to content

Commit

Permalink
Add count_total=false to WP_User_Query (#781)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwiebe authored Jun 11, 2024
1 parent 0e710d0 commit a08b333
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions includes/collection/class-users.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public static function get_by_username( $username ) {
// check for 'activitypub_username' meta
$user = new WP_User_Query(
array(
'count_total' => false,
'number' => 1,
'hide_empty' => true,
'fields' => 'ID',
Expand All @@ -110,6 +111,7 @@ public static function get_by_username( $username ) {
// check for login or nicename.
$user = new WP_User_Query(
array(
'count_total' => false,
'search' => $username,
'search_columns' => array( 'user_login', 'user_nicename' ),
'number' => 1,
Expand Down

0 comments on commit a08b333

Please sign in to comment.