Make WordPress Core

Ticket #60792: multisite_flag2.patch

File multisite_flag2.patch, 2.3 KB (added by bennimack, 2 years ago)

Variant 2 - the PHP constant is not mandatory anymore, but if actively set to "false" the network tab is not shown anymore

  • src/wp-admin/menu.php

    diff --git a/src/wp-admin/menu.php b/src/wp-admin/menu.php
    index a756fa40f3..b7175b0134 100644
    a b $menu[75] = array( __( 'Tools' ), 'edit_posts', 'tools.php', 
    380380if ( is_multisite() && ! is_main_site() ) {
    381381        $submenu['tools.php'][35] = array( __( 'Delete Site' ), 'delete_site', 'ms-delete-site.php' );
    382382}
    383 if ( ! is_multisite() && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
     383if ( ! is_multisite() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || WP_ALLOW_MULTISITE ) ) {
    384384        $submenu['tools.php'][50] = array( __( 'Network Setup' ), 'setup_network', 'network.php' );
    385385}
    386386
  • src/wp-admin/network.php

    diff --git a/src/wp-admin/network.php b/src/wp-admin/network.php
    index 99638dabc3..af32967c54 100644
    a b if ( is_multisite() ) { 
    2626        }
    2727
    2828        if ( ! defined( 'MULTISITE' ) ) {
    29                 wp_die( __( 'The Network creation panel is not for WordPress MU networks.' ) );
     29                wp_die( __( 'The Network creation panel is not for WordPress Multisite networks.' ) );
    3030        }
    3131}
    3232
    foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) { 
    3737        $wpdb->$table = $prefixed_table;
    3838}
    3939
    40 if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) ) {
     40if ( ! network_domain_check() && ( defined( 'WP_ALLOW_MULTISITE' ) && ! WP_ALLOW_MULTISITE ) ) {
    4141        wp_die(
    4242                printf(
    4343                        /* translators: 1: WP_ALLOW_MULTISITE, 2: wp-config.php */
  • src/wp-admin/network/menu.php

    diff --git a/src/wp-admin/network/menu.php b/src/wp-admin/network/menu.php
    index 73cc86b234..35019033ea 100644
    a b $submenu['plugins.php'][10] = array( __( 'Add New Plugin' ), 'install_plugins', 
    107107$submenu['plugins.php'][15] = array( __( 'Plugin File Editor' ), 'edit_plugins', 'plugin-editor.php' );
    108108
    109109$menu[25] = array( __( 'Settings' ), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' );
    110 if ( defined( 'MULTISITE' ) && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
     110if ( defined( 'MULTISITE' ) ) {
    111111        $submenu['settings.php'][5]  = array( __( 'Network Settings' ), 'manage_network_options', 'settings.php' );
    112112        $submenu['settings.php'][10] = array( __( 'Network Setup' ), 'setup_network', 'setup.php' );
    113113}