WordPress.org

Make WordPress Core

Ticket #40462: 40462.3.patch

File 40462.3.patch, 5.8 KB (added by ramiy, 3 years ago)

Add phpDocs @since entry

  • wp-includes/general-template.php

     
    362362 * The login format HTML is echoed by default. Pass a false value for `$echo` to return it instead.
    363363 *
    364364 * @since 3.0.0
     365 * @since 2.8.0 $placeholder_username and placeholder_password arguments added.
    365366 *
    366367 * @param array $args {
    367368 *     Optional. Array of options to control the form output. Default empty array.
    368369 *
    369  *     @type bool   $echo           Whether to display the login form or return the form HTML code.
    370  *                                  Default true (echo).
    371  *     @type string $redirect       URL to redirect to. Must be absolute, as in "https://example.com/mypage/".
    372  *                                  Default is to redirect back to the request URI.
    373  *     @type string $form_id        ID attribute value for the form. Default 'loginform'.
    374  *     @type string $label_username Label for the username or email address field. Default 'Username or Email Address'.
    375  *     @type string $label_password Label for the password field. Default 'Password'.
    376  *     @type string $label_remember Label for the remember field. Default 'Remember Me'.
    377  *     @type string $label_log_in   Label for the submit button. Default 'Log In'.
    378  *     @type string $id_username    ID attribute value for the username field. Default 'user_login'.
    379  *     @type string $id_password    ID attribute value for the password field. Default 'user_pass'.
    380  *     @type string $id_remember    ID attribute value for the remember field. Default 'rememberme'.
    381  *     @type string $id_submit      ID attribute value for the submit button. Default 'wp-submit'.
    382  *     @type bool   $remember       Whether to display the "rememberme" checkbox in the form.
    383  *     @type string $value_username Default value for the username field. Default empty.
    384  *     @type bool   $value_remember Whether the "Remember Me" checkbox should be checked by default.
    385  *                                  Default false (unchecked).
     370 *     @type bool   $echo                 Whether to display the login form or return the form HTML code.
     371 *                                        Default true (echo).
     372 *     @type string $redirect             URL to redirect to. Must be absolute, as in
     373 *                                        "https://example.com/mypage/". Default is to redirect back to the
     374 *                                        request URI.
     375 *     @type string $form_id              ID attribute value for the form. Default 'loginform'.
     376 *     @type string $label_username       Label for the username or email address field. Default
     377 *                                        'Username or Email Address'.
     378 *     @type string $label_password       Label for the password field. Default 'Password'.
     379 *     @type string $label_remember       Label for the remember field. Default 'Remember Me'.
     380 *     @type string $label_log_in         Label for the submit button. Default 'Log In'.
     381 *     @type string $id_username          ID attribute value for the username field. Default 'user_login'.
     382 *     @type string $id_password          ID attribute value for the password field. Default 'user_pass'.
     383 *     @type string $id_remember          ID attribute value for the remember field. Default 'rememberme'.
     384 *     @type string $id_submit            ID attribute value for the submit button. Default 'wp-submit'.
     385 *     @type string $placeholder_username Placeholder attribute value for the username field. Default empty.
     386 *     @type string $placeholder_password Placeholder attribute value for the password field. Default empty.
     387 *     @type bool   $remember             Whether to display the "rememberme" checkbox in the form.
     388 *     @type string $value_username       Default value for the username field. Default empty.
     389 *     @type bool   $value_remember       Whether the "Remember Me" checkbox should be checked by default.
     390 *                                        Default false (unchecked).
    386391 *
    387392 * }
    388393 * @return string|void String when retrieving.
     
    401406                'id_password' => 'user_pass',
    402407                'id_remember' => 'rememberme',
    403408                'id_submit' => 'wp-submit',
     409                'placeholder_username' => '',
     410                'placeholder_password' => '',
    404411                'remember' => true,
    405412                'value_username' => '',
    406413                // Set 'value_remember' to true to default the "Remember me" checkbox to checked.
     
    460467                        ' . $login_form_top . '
    461468                        <p class="login-username">
    462469                                <label for="' . esc_attr( $args['id_username'] ) . '">' . esc_html( $args['label_username'] ) . '</label>
    463                                 <input type="text" name="log" id="' . esc_attr( $args['id_username'] ) . '" class="input" value="' . esc_attr( $args['value_username'] ) . '" size="20" />
     470                                <input type="text" name="log" id="' . esc_attr( $args['id_username'] ) . '" class="input" placeholder="' . esc_attr( $args['placeholder_username'] ) . '" value="' . esc_attr( $args['value_username'] ) . '" size="20" />
    464471                        </p>
    465472                        <p class="login-password">
    466473                                <label for="' . esc_attr( $args['id_password'] ) . '">' . esc_html( $args['label_password'] ) . '</label>
    467                                 <input type="password" name="pwd" id="' . esc_attr( $args['id_password'] ) . '" class="input" value="" size="20" />
     474                                <input type="password" name="pwd" id="' . esc_attr( $args['id_password'] ) . '" class="input" placeholder="' . esc_attr( $args['placeholder_password'] ) . '" value="" size="20" />
    468475                        </p>
    469476                        ' . $login_form_middle . '
    470477                        ' . ( $args['remember'] ? '<p class="login-remember"><label><input name="rememberme" type="checkbox" id="' . esc_attr( $args['id_remember'] ) . '" value="forever"' . ( $args['value_remember'] ? ' checked="checked"' : '' ) . ' /> ' . esc_html( $args['label_remember'] ) . '</label></p>' : '' ) . '