App Passwords: Unify availability language.

Previously App Passwords used a mix of "enabled" and "available". We've now standardized on using "available".

Additionally, we now use a 501 status code when indicating that App Passwords is not available.

Props SergeyBiryukov, ocean90, TimothyBlynJacobs.
Fixes #51513.


git-svn-id: https://develop.svn.wordpress.org/trunk@49617 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Timothy Jacobs
2020-11-16 22:40:11 +00:00
parent 56ffe940b0
commit ba8de96fc6
5 changed files with 18 additions and 12 deletions

View File

@@ -90,15 +90,16 @@ if ( is_wp_error( $is_valid ) ) {
if ( ! wp_is_application_passwords_available_for_user( $user ) ) {
if ( wp_is_application_passwords_available() ) {
$message = __( 'Application passwords are not enabled for your account. Please contact the site administrator for assistance.' );
$message = __( 'Application passwords are not available for your account. Please contact the site administrator for assistance.' );
} else {
$message = __( 'Application passwords are not enabled.' );
$message = __( 'Application passwords are not available.' );
}
wp_die(
$message,
__( 'Cannot Authorize Application' ),
array(
'response' => 501,
'link_text' => __( 'Go Back' ),
'link_url' => $reject_url ? add_query_arg( 'error', 'disabled', $reject_url ) : admin_url(),
)