From 28b07103604c089fc64f5891178f07464b8f570e Mon Sep 17 00:00:00 2001 From: hellofromTonya Date: Tue, 21 Dec 2021 02:45:03 +0000 Subject: [PATCH] Application Passwords: Show HTTPS required message without filtering when not enabled or not in local environment. When `add_filter( 'wp_is_application_passwords_available', '__return_false' )` exists, HTTPS requirement message is shown even if HTTPS is enabled on the site. This happens because `wp_is_application_passwords_available_for_user()` first invokes `wp_is_application_passwords_available()` which is filterable. The situation could happen if the `'wp_is_application_passwords_available_for_user'` filter returns `false`. To fix this, the check for HTTPS (or if in a 'local' environment) is moved to a new function called `wp_is_application_passwords_supported()`. Then the return from this function is used as an OR condition for the Application Passwords section and for displaying the HTTPS required message. Tests are included for both `wp_is_application_passwords_supported()` and `wp_is_application_passwords_available()`. Follow-up to [51980], [51988]. Props davidbinda, SergeyBiryukov, ocean90, felipeelia, costdev, hellofromTonya. Fixes #53658. Built from https://develop.svn.wordpress.org/trunk@52398 git-svn-id: http://core.svn.wordpress.org/trunk@51990 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/user-edit.php | 4 +++- wp-includes/load.php | 2 +- wp-includes/user.php | 20 ++++++++++++++++---- wp-includes/version.php | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index 813c5eb5cd..64f81d68bc 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -733,6 +733,7 @@ endif; +

@@ -796,7 +797,7 @@ endif; $application_passwords_list_table->display(); ?>
- +

+