mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Users: Deprecate the get_currentuserinfo() pluggable function.
It encourages an ugly pattern like `global $userdata; get_currentuserinfo();` in plugins/themes. `wp_get_current_user()` should be used instead, e.g. `$current_user = wp_get_current_user();`. Props scribu for initial patch. Fixes #19615. git-svn-id: https://develop.svn.wordpress.org/trunk@36311 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -35,6 +35,23 @@ function set_current_user($id, $name = '') {
|
||||
}
|
||||
endif;
|
||||
|
||||
if ( !function_exists('get_currentuserinfo') ) :
|
||||
/**
|
||||
* Populate global variables with information about the currently logged in user.
|
||||
*
|
||||
* @since 0.71
|
||||
* @deprecated 4.5.0 Use wp_get_current_user()
|
||||
* @see wp_get_current_user()
|
||||
*
|
||||
* @return bool|WP_User False on XMLRPC Request and invalid auth cookie, WP_User instance otherwise.
|
||||
*/
|
||||
function get_currentuserinfo() {
|
||||
_deprecated_function( __FUNCTION__, '4.5', 'wp_get_current_user()' );
|
||||
|
||||
return wp_get_current_user();
|
||||
}
|
||||
endif;
|
||||
|
||||
if ( !function_exists('get_userdatabylogin') ) :
|
||||
/**
|
||||
* Retrieve user info by login name.
|
||||
@@ -188,4 +205,4 @@ if ( ! class_exists( 'wp_atom_server', false ) ) {
|
||||
_deprecated_function( __CLASS__ . '::' . $name, '3.5', 'the Atom Publishing Protocol plugin' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user