WordPress.org

Make WordPress Core

Changeset 13204


Ignore:
Timestamp:
02/18/2010 11:17:06 PM (12 years ago)
Author:
nacin
Message:

Move deprecated pluggable functions to a new file to lower their profile. Also throw deprecated warnings if a plugin defines a deprecated pluggable function. See #11388

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r13137 r13204  
    16441644endif;
    16451645
    1646 if ( !function_exists('wp_setcookie') ) :
    1647 /**
    1648  * Sets a cookie for a user who just logged in. This function is deprecated.
    1649  *
    1650  * @since 1.5
    1651  * @deprecated 2.5
    1652  * @deprecated Use wp_set_auth_cookie()
    1653  * @see wp_set_auth_cookie()
    1654  *
    1655  * @param string  $username The user's username
    1656  * @param string  $password Optional. The user's password
    1657  * @param bool $already_md5 Optional. Whether the password has already been through MD5
    1658  * @param string $home Optional. Will be used instead of COOKIEPATH if set
    1659  * @param string $siteurl Optional. Will be used instead of SITECOOKIEPATH if set
    1660  * @param bool $remember Optional. Remember that the user is logged in
    1661  */
    1662 function wp_setcookie($username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false) {
    1663     _deprecated_function( __FUNCTION__, '2.5', 'wp_set_auth_cookie()' );
    1664     $user = get_userdatabylogin($username);
    1665     wp_set_auth_cookie($user->ID, $remember);
    1666 }
    1667 endif;
    1668 
    1669 if ( !function_exists('wp_clearcookie') ) :
    1670 /**
    1671  * Clears the authentication cookie, logging the user out. This function is deprecated.
    1672  *
    1673  * @since 1.5
    1674  * @deprecated 2.5
    1675  * @deprecated Use wp_clear_auth_cookie()
    1676  * @see wp_clear_auth_cookie()
    1677  */
    1678 function wp_clearcookie() {
    1679     _deprecated_function( __FUNCTION__, '2.5', 'wp_clear_auth_cookie()' );
    1680     wp_clear_auth_cookie();
    1681 }
    1682 endif;
    1683 
    1684 if ( !function_exists('wp_get_cookie_login') ):
    1685 /**
    1686  * Gets the user cookie login. This function is deprecated.
    1687  *
    1688  * This function is deprecated and should no longer be extended as it won't be
    1689  * used anywhere in WordPress. Also, plugins shouldn't use it either.
    1690  *
    1691  * @since 2.0.3
    1692  * @deprecated 2.5
    1693  * @deprecated No alternative
    1694  *
    1695  * @return bool Always returns false
    1696  */
    1697 function wp_get_cookie_login() {
    1698     _deprecated_function( __FUNCTION__, '2.5' );
    1699     return false;
    1700 }
    1701 endif;
    1702 
    1703 if ( !function_exists('wp_login') ) :
    1704 /**
    1705  * Checks a users login information and logs them in if it checks out. This function is deprecated.
    1706  *
    1707  * Use the global $error to get the reason why the login failed. If the username
    1708  * is blank, no error will be set, so assume blank username on that case.
    1709  *
    1710  * Plugins extending this function should also provide the global $error and set
    1711  * what the error is, so that those checking the global for why there was a
    1712  * failure can utilize it later.
    1713  *
    1714  * @since 1.2.2
    1715  * @deprecated Use wp_signon()
    1716  * @global string $error Error when false is returned
    1717  *
    1718  * @param string $username User's username
    1719  * @param string $password User's password
    1720  * @param bool $deprecated Not used
    1721  * @return bool False on login failure, true on successful check
    1722  */
    1723 function wp_login($username, $password, $deprecated = '') {
    1724     _deprecated_function( __FUNCTION__, '2.5', 'wp_signon()' );
    1725     global $error;
    1726 
    1727     $user = wp_authenticate($username, $password);
    1728 
    1729     if ( ! is_wp_error($user) )
    1730         return true;
    1731 
    1732     $error = $user->get_error_message();
    1733     return false;
    1734 }
    1735 endif;
    1736 
    17371646if ( !function_exists( 'wp_text_diff' ) ) :
    17381647/**
  • trunk/wp-settings.php

    r13159 r13204  
    177177// Load pluggable functions.
    178178require( ABSPATH . WPINC . '/pluggable.php' );
     179require( ABSPATH . WPINC . '/pluggable-deprecated.php' );
    179180
    180181// Set internal encoding.
Note: See TracChangeset for help on using the changeset viewer.