mirror of
git://develop.git.wordpress.org/
synced 2025-03-19 11:29:48 +01:00
App Passwords: Store the "in use" option in the main network options.
Whether App Passwords are being used is a global featurel, not a per-network feature. This fixes issues on Multi Network installs if App Passwords are used on a different network from where they were created. Props spacedmonkey. Fixes #51939. See [49752]. Merges [49764] to the 5.6 branch. git-svn-id: https://develop.svn.wordpress.org/branches/5.6@49765 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
409cc911aa
commit
a07a61986a
@ -2288,7 +2288,8 @@ function upgrade_560() {
|
||||
);
|
||||
|
||||
if ( ! empty( $results ) ) {
|
||||
update_site_option( WP_Application_Passwords::OPTION_KEY_IN_USE, 1 );
|
||||
$network_id = get_main_network_id();
|
||||
update_network_option( $network_id, WP_Application_Passwords::OPTION_KEY_IN_USE, 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,8 @@ class WP_Application_Passwords {
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_in_use() {
|
||||
return (bool) get_site_option( self::OPTION_KEY_IN_USE );
|
||||
$network_id = get_main_network_id();
|
||||
return (bool) get_network_option( $network_id, self::OPTION_KEY_IN_USE );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -89,8 +90,9 @@ class WP_Application_Passwords {
|
||||
return new WP_Error( 'db_error', __( 'Could not save application password.' ) );
|
||||
}
|
||||
|
||||
if ( ! get_site_option( self::OPTION_KEY_IN_USE ) ) {
|
||||
update_site_option( self::OPTION_KEY_IN_USE, true );
|
||||
$network_id = get_main_network_id();
|
||||
if ( ! get_network_option( $network_id, self::OPTION_KEY_IN_USE ) ) {
|
||||
update_network_option( $network_id, self::OPTION_KEY_IN_USE, true );
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user