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:
parent
458746f631
commit
1071dfb4ec
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue