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.


Built from https://develop.svn.wordpress.org/trunk@39915


git-svn-id: http://core.svn.wordpress.org/trunk@39852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2017-01-16 23:24:45 +00:00
parent 458746f631
commit 1071dfb4ec
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-39914';
$wp_version = '4.8-alpha-39915';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.