Make WordPress Core


Ignore:
Timestamp:
01/11/2020 06:30:58 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: In various @return tags, list the expected type first, instead of false.

Follow-up to [46696].

See #48303.

File:
1 edited

Legend:

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

    r47042 r47060  
    601601     * @param string $cookie Optional. If used, will validate contents instead of cookie's.
    602602     * @param string $scheme Optional. The cookie scheme to use: 'auth', 'secure_auth', or 'logged_in'.
    603      * @return false|int False if invalid cookie, user ID if valid.
     603     * @return int|false User ID if valid cookie, false if invalid.
    604604     */
    605605    function wp_validate_auth_cookie( $cookie = '', $scheme = '' ) {
     
    11121112     * @param int|string $action    The nonce action.
    11131113     * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST`. Default '_wpnonce'.
    1114      * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
    1115      *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     1114     * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago,
     1115     *                   2 if the nonce is valid and generated between 12-24 hours ago.
     1116     *                   False if the nonce is invalid.
    11161117     */
    11171118    function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) {
     
    11561157     * @param bool         $die       Optional. Whether to die early when the nonce cannot be verified.
    11571158     *                                Default true.
    1158      * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
    1159      *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     1159     * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago,
     1160     *                   2 if the nonce is valid and generated between 12-24 hours ago.
     1161     *                   False if the nonce is invalid.
    11601162     */
    11611163    function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {
     
    20932095     * @param string     $nonce  Nonce value that was used for verification, usually via a form field.
    20942096     * @param string|int $action Should give context to what is taking place and be the same when nonce was created.
    2095      * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
    2096      *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     2097     * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago,
     2098     *                   2 if the nonce is valid and generated between 12-24 hours ago.
     2099     *                   False if the nonce is invalid.
    20972100     */
    20982101    function wp_verify_nonce( $nonce, $action = -1 ) {
     
    25812584     *     @type string       $extra_attr    HTML attributes to insert in the IMG element. Is not sanitized. Default empty.
    25822585     * }
    2583      * @return false|string `<img>` tag for the user's avatar. False on failure.
     2586     * @return string|false `<img>` tag for the user's avatar. False on failure.
    25842587     */
    25852588    function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args = null ) {
Note: See TracChangeset for help on using the changeset viewer.