WordPress.org

Make WordPress Core

Changeset 49764


Ignore:
Timestamp:
12/07/2020 03:57:03 PM (3 months ago)
Author:
TimothyBlynJacobs
Message:

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].

Location:
trunk/src
Files:
2 edited

Legend:

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

    r49752 r49764  
    22892289
    22902290        if ( ! empty( $results ) ) {
    2291             update_site_option( WP_Application_Passwords::OPTION_KEY_IN_USE, 1 );
     2291            $network_id = get_main_network_id();
     2292            update_network_option( $network_id, WP_Application_Passwords::OPTION_KEY_IN_USE, 1 );
    22922293        }
    22932294    }
  • trunk/src/wp-includes/class-wp-application-passwords.php

    r49752 r49764  
    5151     */
    5252    public static function is_in_use() {
    53         return (bool) get_site_option( self::OPTION_KEY_IN_USE );
     53        $network_id = get_main_network_id();
     54        return (bool) get_network_option( $network_id, self::OPTION_KEY_IN_USE );
    5455    }
    5556
     
    9091        }
    9192
    92         if ( ! get_site_option( self::OPTION_KEY_IN_USE ) ) {
    93             update_site_option( self::OPTION_KEY_IN_USE, true );
     93        $network_id = get_main_network_id();
     94        if ( ! get_network_option( $network_id, self::OPTION_KEY_IN_USE ) ) {
     95            update_network_option( $network_id, self::OPTION_KEY_IN_USE, true );
    9496        }
    9597
Note: See TracChangeset for help on using the changeset viewer.