WordPress.org

Make WordPress Core

Changeset 45822


Ignore:
Timestamp:
08/17/2019 01:22:26 PM (5 weeks ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for wp_set_auth_cookie() and related functions.

Props arafat, SergeyBiryukov.
Fixes #47886.

File:
1 edited

Legend:

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

    r45778 r45822  
    593593     * @global int $login_grace_period
    594594     *
    595      * @param string $cookie Optional. If used, will validate contents instead of cookie's
    596      * @param string $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in
    597      * @return false|int False if invalid cookie, User ID if valid.
     595     * @param string $cookie Optional. If used, will validate contents instead of cookie's.
     596     * @param string $scheme Optional. The cookie scheme to use: 'auth', 'secure_auth', or 'logged_in'.
     597     * @return false|int False if invalid cookie, user ID if valid.
    598598     */
    599599    function wp_validate_auth_cookie( $cookie = '', $scheme = '' ) {
     
    698698if ( ! function_exists( 'wp_generate_auth_cookie' ) ) :
    699699    /**
    700      * Generate authentication cookie contents.
     700     * Generates authentication cookie contents.
    701701     *
    702702     * @since 2.5.0
    703703     * @since 4.0.0 The `$token` parameter was added.
    704704     *
    705      * @param int    $user_id    User ID
     705     * @param int    $user_id    User ID.
    706706     * @param int    $expiration The time the cookie expires as a UNIX timestamp.
    707      * @param string $scheme     Optional. The cookie scheme to use: auth, secure_auth, or logged_in
    708      * @param string $token      User's session token to use for this cookie
     707     * @param string $scheme     Optional. The cookie scheme to use: 'auth', 'secure_auth', or 'logged_in'.
     708     *                           Default 'auth'.
     709     * @param string $token      User's session token to use for this cookie.
    709710     * @return string Authentication cookie contents. Empty string if user does not exist.
    710711     */
     
    748749if ( ! function_exists( 'wp_parse_auth_cookie' ) ) :
    749750    /**
    750      * Parse a cookie into its components
     751     * Parses a cookie into its components.
    751752     *
    752753     * @since 2.7.0
    753754     *
    754      * @param string $cookie
    755      * @param string $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in
    756      * @return array|false Authentication cookie components
     755     * @param string $cookie Authentication cookie.
     756     * @param string $scheme Optional. The cookie scheme to use: 'auth', 'secure_auth', or 'logged_in'.
     757     * @return array|false Authentication cookie components.
    757758     */
    758759    function wp_parse_auth_cookie( $cookie = '', $scheme = '' ) {
     
    797798if ( ! function_exists( 'wp_set_auth_cookie' ) ) :
    798799    /**
    799      * Log in a user by setting authentication cookies.
     800     * Sets the authentication cookies based on user ID.
    800801     *
    801802     * The $remember parameter increases the time that the cookie will be kept. The
     
    806807     * @since 4.3.0 Added the `$token` parameter.
    807808     *
    808      * @param int    $user_id  User ID
    809      * @param bool   $remember Whether to remember the user
     809     * @param int    $user_id  User ID.
     810     * @param bool   $remember Whether to remember the user.
    810811     * @param mixed  $secure   Whether the admin cookies should only be sent over HTTPS.
    811      *                         Default is_ssl().
     812     *                         Default is the value of is_ssl().
    812813     * @param string $token    Optional. User's session token to use for this cookie.
    813814     */
Note: See TracChangeset for help on using the changeset viewer.