Add the proper access modifier to _init_caps() in WP_User. Add __call() for BC.
See #32444. Built from https://develop.svn.wordpress.org/trunk@32731 git-svn-id: http://core.svn.wordpress.org/trunk@32702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -630,6 +630,23 @@ class WP_User {
|
||||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make private/protected methods readable for backwards compatibility.
|
||||
*
|
||||
* @since 4.3.0
|
||||
* @access public
|
||||
*
|
||||
* @param callable $name Method to call.
|
||||
* @param array $arguments Arguments to pass when calling.
|
||||
* @return mixed|false Return value of the callback, false otherwise.
|
||||
*/
|
||||
public function __call( $name, $arguments ) {
|
||||
if ( '_init_caps' === $name ) {
|
||||
return call_user_func_array( array( $this, $name ), $arguments );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic method for checking the existence of a certain custom field
|
||||
*
|
||||
@@ -761,7 +778,7 @@ class WP_User {
|
||||
*
|
||||
* @param string $cap_key Optional capability key
|
||||
*/
|
||||
function _init_caps( $cap_key = '' ) {
|
||||
protected function _init_caps( $cap_key = '' ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( empty($cap_key) )
|
||||
|
||||
Reference in New Issue
Block a user