diff --git a/wp-includes/user.php b/wp-includes/user.php index 17fe9fcdaf..15a20f3b98 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -473,6 +473,8 @@ class WP_User_Query { */ private $total_users = 0; + private $compat_fields = array( 'results', 'total_users' ); + // SQL clauses public $query_fields; public $query_from; @@ -928,7 +930,9 @@ class WP_User_Query { * @return mixed Property. */ public function __get( $name ) { - return $this->$name; + if ( in_array( $name, $this->compat_fields ) ) { + return $this->$name; + } } /** @@ -937,12 +941,14 @@ class WP_User_Query { * @since 4.0.0 * @access public * - * @param string $name Property to set. + * @param string $name Property to check if set. * @param mixed $value Property value. * @return mixed Newly-set property. */ public function __set( $name, $value ) { - return $this->$name = $value; + if ( in_array( $name, $this->compat_fields ) ) { + return $this->$name = $value; + } } /** @@ -955,7 +961,9 @@ class WP_User_Query { * @return bool Whether the property is set. */ public function __isset( $name ) { - return isset( $this->$name ); + if ( in_array( $name, $this->compat_fields ) ) { + return isset( $this->$name ); + } } /** @@ -967,7 +975,9 @@ class WP_User_Query { * @param string $name Property to unset. */ public function __unset( $name ) { - unset( $this->$name ); + if ( in_array( $name, $this->compat_fields ) ) { + unset( $this->$name ); + } } /** @@ -981,7 +991,10 @@ class WP_User_Query { * @return mixed|bool Return value of the callback, false otherwise. */ public function __call( $name, $arguments ) { - return call_user_func_array( array( $this, $name ), $arguments ); + if ( 'get_search_sql' === $name ) { + return call_user_func_array( array( $this, $name ), $arguments ); + } + return false; } } diff --git a/wp-includes/version.php b/wp-includes/version.php index e08627ac0b..6764b8ede4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31143'; +$wp_version = '4.2-alpha-31144'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.