| 1 |
<?php |
| 2 |
// Exit if accessed directly. |
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
/** |
| 8 |
* Disable Application Passwords. |
| 9 |
* |
| 10 |
* If the 'ns_shield_app_passwords' option is enabled, this function disables |
| 11 |
* the Application Passwords feature by hooking into 'wp_is_application_passwords_available' |
| 12 |
* and returning false. |
| 13 |
* |
| 14 |
* @return void |
| 15 |
*/ |
| 16 |
function ns_shield_disable_app_passwords() { |
| 17 |
if ( get_option( 'ns_shield_app_passwords' ) ) { |
| 18 |
add_filter( 'wp_is_application_passwords_available', '__return_false' ); |
| 19 |
} |
| 20 |
} |
| 21 |
add_action( 'init', 'ns_shield_disable_app_passwords' ); |
| 22 |
|