mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
User Query: Cast $user_total as an int.
The `$user_total` member of `WP_User_Query`, and corresponding `get_total()` method, have always been documented as returning an `int`. `$user_total`, however, is populated by `$wpdb->get_var()`, which returns a string (containing an integer value). Casting the return value from `get_var()` as an `int` rectifies this discrepency. Props runciters. Fixes #39297. git-svn-id: https://develop.svn.wordpress.org/trunk@39915 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -612,7 +612,7 @@ class WP_User_Query {
|
||||
* @param string $sql The SELECT FOUND_ROWS() query for the current WP_User_Query.
|
||||
*/
|
||||
if ( isset( $qv['count_total'] ) && $qv['count_total'] )
|
||||
$this->total_users = $wpdb->get_var( apply_filters( 'found_users_query', 'SELECT FOUND_ROWS()' ) );
|
||||
$this->total_users = (int) $wpdb->get_var( apply_filters( 'found_users_query', 'SELECT FOUND_ROWS()' ) );
|
||||
|
||||
if ( !$this->results )
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user