Make WordPress Core

Changeset 49139


Ignore:
Timestamp:
10/13/2020 08:08:23 PM (4 years ago)
Author:
ocean90
Message:

Users: Enable Application Passwords for local development environments, even if HTTPS is not available.

This will make testing the new feature easier since the local development environment is only accessible via HTTP by default.
Also update docs to link to the relevant filters.

See #42790.
Fixes #51503.

File:
1 edited

Legend:

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

    r49109 r49139  
    40984098 * Checks if Application Passwords is globally available.
    40994099 *
    4100  * By default, Application Passwords is available to all sites using SSL, but this function is
    4101  * filterable to adjust its availability.
     4100 * By default, Application Passwords is available to all sites using SSL or to local environments.
     4101 * Use {@see 'wp_is_application_passwords_available'} to adjust its availability.
    41024102 *
    41034103 * @since 5.6.0
     
    41064106 */
    41074107function wp_is_application_passwords_available() {
     4108    $available = is_ssl() || 'local' === wp_get_environment_type();
     4109
    41084110    /**
    41094111     * Filters whether Application Passwords is available.
     
    41134115     * @param bool $available True if available, false otherwise.
    41144116     */
    4115     return apply_filters( 'wp_is_application_passwords_available', is_ssl() );
     4117    return apply_filters( 'wp_is_application_passwords_available', $available );
    41164118}
    41174119
     
    41194121 * Checks if Application Passwords is enabled for a specific user.
    41204122 *
    4121  * By default all users can use Application Passwords, but this function is filterable to restrict
    4122  * availability to certain users.
     4123 * By default all users can use Application Passwords. Use {@see 'wp_is_application_passwords_available_for_user'}
     4124 * to restrict availability to certain users.
    41234125 *
    41244126 * @since 5.6.0
Note: See TracChangeset for help on using the changeset viewer.