3
* Deprecated pluggable functions from past WordPress versions. You shouldn't use these
4
* functions and look for the alternatives instead. The functions will be removed in a
7
* Deprecated warnings are also thrown if one of these functions is being defined by a plugin.
10
* @subpackage Deprecated
15
* Deprecated functions come here to die.
18
if ( !function_exists('set_current_user') ) :
20
* Changes the current user by ID or name.
22
* Set $id to null and specify a name if you do not know a user's ID.
25
* @see wp_set_current_user() An alias of wp_set_current_user()
27
* @deprecated Use wp_set_current_user()
29
* @param int|null $id User ID.
30
* @param string $name Optional. The user's username
31
* @return object returns wp_set_current_user()
33
function set_current_user($id, $name = '') {
34
_deprecated_function( __FUNCTION__, '3.0', 'wp_set_current_user()' );
35
return wp_set_current_user($id, $name);
39
if ( !function_exists('get_userdatabylogin') ) :
41
* Retrieve user info by login name.
45
* @deprecated Use get_user_by('login')
47
* @param string $user_login User's username
48
* @return bool|object False on failure, User DB row object
50
function get_userdatabylogin($user_login) {
51
_deprecated_function( __FUNCTION__, '3.3', "get_user_by('login')" );
52
return get_user_by('login', $user_login);
56
if ( !function_exists('get_user_by_email') ) :
58
* Retrieve user info by email.
62
* @deprecated Use get_user_by('email')
64
* @param string $email User's email address
65
* @return bool|object False on failure, User DB row object
67
function get_user_by_email($email) {
68
_deprecated_function( __FUNCTION__, '3.3', "get_user_by('email')" );
69
return get_user_by('email', $email);
73
if ( !function_exists('wp_setcookie') ) :
75
* Sets a cookie for a user who just logged in. This function is deprecated.
79
* @deprecated Use wp_set_auth_cookie()
80
* @see wp_set_auth_cookie()
82
* @param string $username The user's username
83
* @param string $password Optional. The user's password
84
* @param bool $already_md5 Optional. Whether the password has already been through MD5
85
* @param string $home Optional. Will be used instead of COOKIEPATH if set
86
* @param string $siteurl Optional. Will be used instead of SITECOOKIEPATH if set
87
* @param bool $remember Optional. Remember that the user is logged in
89
function wp_setcookie($username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false) {
90
_deprecated_function( __FUNCTION__, '2.5', 'wp_set_auth_cookie()' );
91
$user = get_user_by('login', $username);
92
wp_set_auth_cookie($user->ID, $remember);
95
_deprecated_function( 'wp_setcookie', '2.5', 'wp_set_auth_cookie()' );
98
if ( !function_exists('wp_clearcookie') ) :
100
* Clears the authentication cookie, logging the user out. This function is deprecated.
104
* @deprecated Use wp_clear_auth_cookie()
105
* @see wp_clear_auth_cookie()
107
function wp_clearcookie() {
108
_deprecated_function( __FUNCTION__, '2.5', 'wp_clear_auth_cookie()' );
109
wp_clear_auth_cookie();
112
_deprecated_function( 'wp_clearcookie', '2.5', 'wp_clear_auth_cookie()' );
115
if ( !function_exists('wp_get_cookie_login') ):
117
* Gets the user cookie login. This function is deprecated.
119
* This function is deprecated and should no longer be extended as it won't be
120
* used anywhere in WordPress. Also, plugins shouldn't use it either.
124
* @deprecated No alternative
126
* @return bool Always returns false
128
function wp_get_cookie_login() {
129
_deprecated_function( __FUNCTION__, '2.5' );
133
_deprecated_function( 'wp_get_cookie_login', '2.5' );
136
if ( !function_exists('wp_login') ) :
138
* Checks a users login information and logs them in if it checks out. This function is deprecated.
140
* Use the global $error to get the reason why the login failed. If the username
141
* is blank, no error will be set, so assume blank username on that case.
143
* Plugins extending this function should also provide the global $error and set
144
* what the error is, so that those checking the global for why there was a
145
* failure can utilize it later.
148
* @deprecated Use wp_signon()
149
* @global string $error Error when false is returned
151
* @param string $username User's username
152
* @param string $password User's password
153
* @param bool $deprecated Not used
154
* @return bool False on login failure, true on successful check
156
function wp_login($username, $password, $deprecated = '') {
157
_deprecated_function( __FUNCTION__, '2.5', 'wp_signon()' );
160
$user = wp_authenticate($username, $password);
162
if ( ! is_wp_error($user) )
165
$error = $user->get_error_message();
169
_deprecated_function( 'wp_login', '2.5', 'wp_signon()' );
173
* WordPress AtomPub API implementation.
175
* Originally stored in wp-app.php, and later wp-includes/class-wp-atom-server.php.
176
* It is kept here in case a plugin directly referred to the class.
180
* @link https://wordpress.org/plugins/atom-publishing-protocol/
182
if ( ! class_exists( 'wp_atom_server' ) ) {
183
class wp_atom_server {
184
public function __call( $name, $arguments ) {
185
_deprecated_function( __CLASS__ . '::' . $name, '3.5', 'the Atom Publishing Protocol plugin' );
188
public static function __callStatic( $name, $arguments ) {
189
_deprecated_function( __CLASS__ . '::' . $name, '3.5', 'the Atom Publishing Protocol plugin' );
b'\\ No newline at end of file'