Make WordPress Core


Ignore:
Timestamp:
02/02/2010 09:41:17 PM (15 years ago)
Author:
ryan
Message:

Cleanup network plugin loading. Props nacin. see #11644

File:
1 edited

Legend:

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

    r12914 r12930  
    545545
    546546/**
    547  * validate active plugins
    548  *
    549  * validate all active plugins, deactivates invalid and
    550  * returns an array of deactived ones.
     547 * Validate active plugins
     548 *
     549 * Validate all active plugins, deactivates invalid and
     550 * returns an array of deactivated ones.
    551551 *
    552552 * @since unknown
     
    555555function validate_active_plugins() {
    556556    $plugins = apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) );
    557 
    558557    // validate vartype: array
    559     if ( !is_array( $plugins ) ) {
    560         update_option('active_plugins', array());
     558    if ( ! is_array( $plugins ) ) {
     559        update_option( 'active_plugins', array() );
     560        $plugins = array();
     561    }
     562
     563    if ( is_multisite() && is_super_admin() ) {
     564        $network_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
     565        $plugins = array_merge( (array) $plugins, $network_plugins );
     566    }
     567
     568    if ( empty( $plugins ) )
    561569        return;
    562     }
    563570
    564571    $invalid = array();
     
    660667/**
    661668 * Add a top level menu page
    662  * 
     669 *
    663670 * This function takes a capability which will be used to determine whether
    664671 * or not a page is included in the menu.
    665  * 
     672 *
    666673 * The function which is hooked in to handle the output of the page must check
    667674 * that the user has the required capability as well.
    668  * 
     675 *
    669676 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
    670677 * @param string $menu_title The text to be used for the menu
     
    707714/**
    708715 * Add a top level menu page in the 'objects' section
    709  * 
     716 *
    710717 * This function takes a capability which will be used to determine whether
    711718 * or not a page is included in the menu.
    712  * 
     719 *
    713720 * The function which is hooked in to handle the output of the page must check
    714721 * that the user has the required capability as well.
    715  * 
     722 *
    716723 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
    717724 * @param string $menu_title The text to be used for the menu
     
    731738/**
    732739 * Add a top level menu page in the 'utility' section
    733  * 
     740 *
    734741 * This function takes a capability which will be used to determine whether
    735742 * or not a page is included in the menu.
    736  * 
     743 *
    737744 * The function which is hooked in to handle the output of the page must check
    738745 * that the user has the required capability as well.
    739  * 
     746 *
    740747 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
    741748 * @param string $menu_title The text to be used for the menu
     
    755762/**
    756763 * Add a sub menu page
    757  * 
     764 *
    758765 * This function takes a capability which will be used to determine whether
    759766 * or not a page is included in the menu.
    760  * 
     767 *
    761768 * The function which is hooked in to handle the output of the page must check
    762769 * that the user has the required capability as well.
    763  * 
     770 *
    764771 * @param string $parent_slug The slug name for the parent menu (or the file name of a standard WordPress admin page)
    765772 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
     
    814821/**
    815822 * Add sub menu page to the tools main menu.
    816 * 
     823*
    817824 * This function takes a capability which will be used to determine whether
    818825 * or not a page is included in the menu.
    819  * 
     826 *
    820827 * The function which is hooked in to handle the output of the page must check
    821828 * that the user has the required capability as well.
    822  * 
     829 *
    823830 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
    824831 * @param string $menu_title The text to be used for the menu
     
    833840/**
    834841 * Add sub menu page to the options main menu.
    835 * 
     842*
    836843 * This function takes a capability which will be used to determine whether
    837844 * or not a page is included in the menu.
    838  * 
     845 *
    839846 * The function which is hooked in to handle the output of the page must check
    840847 * that the user has the required capability as well.
    841  * 
     848 *
    842849 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
    843850 * @param string $menu_title The text to be used for the menu
     
    852859/**
    853860 * Add sub menu page to the themes main menu.
    854 * 
     861*
    855862 * This function takes a capability which will be used to determine whether
    856863 * or not a page is included in the menu.
    857  * 
     864 *
    858865 * The function which is hooked in to handle the output of the page must check
    859866 * that the user has the required capability as well.
    860  * 
     867 *
    861868 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
    862869 * @param string $menu_title The text to be used for the menu
     
    871878/**
    872879 * Add sub menu page to the Users/Profile main menu.
    873 * 
     880*
    874881 * This function takes a capability which will be used to determine whether
    875882 * or not a page is included in the menu.
    876  * 
     883 *
    877884 * The function which is hooked in to handle the output of the page must check
    878885 * that the user has the required capability as well.
    879  * 
     886 *
    880887 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
    881888 * @param string $menu_title The text to be used for the menu
     
    893900/**
    894901 * Add sub menu page to the Dashboard main menu.
    895 * 
     902*
    896903 * This function takes a capability which will be used to determine whether
    897904 * or not a page is included in the menu.
    898  * 
     905 *
    899906 * The function which is hooked in to handle the output of the page must check
    900907 * that the user has the required capability as well.
    901  * 
     908 *
    902909 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
    903910 * @param string $menu_title The text to be used for the menu
     
    912919/**
    913920 * Add sub menu page to the posts main menu.
    914 * 
     921*
    915922 * This function takes a capability which will be used to determine whether
    916923 * or not a page is included in the menu.
    917  * 
     924 *
    918925 * The function which is hooked in to handle the output of the page must check
    919926 * that the user has the required capability as well.
    920  * 
     927 *
    921928 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
    922929 * @param string $menu_title The text to be used for the menu
     
    931938/**
    932939 * Add sub menu page to the media main menu.
    933 * 
     940*
    934941 * This function takes a capability which will be used to determine whether
    935942 * or not a page is included in the menu.
    936  * 
     943 *
    937944 * The function which is hooked in to handle the output of the page must check
    938945 * that the user has the required capability as well.
    939  * 
     946 *
    940947 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
    941948 * @param string $menu_title The text to be used for the menu
     
    950957/**
    951958 * Add sub menu page to the links main menu.
    952 * 
     959*
    953960 * This function takes a capability which will be used to determine whether
    954961 * or not a page is included in the menu.
    955  * 
     962 *
    956963 * The function which is hooked in to handle the output of the page must check
    957964 * that the user has the required capability as well.
    958  * 
     965 *
    959966 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
    960967 * @param string $menu_title The text to be used for the menu
     
    969976/**
    970977 * Add sub menu page to the pages main menu.
    971 * 
     978*
    972979 * This function takes a capability which will be used to determine whether
    973980 * or not a page is included in the menu.
    974  * 
     981 *
    975982 * The function which is hooked in to handle the output of the page must check
    976983 * that the user has the required capability as well.
    977  * 
     984 *
    978985 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
    979986 * @param string $menu_title The text to be used for the menu
     
    988995/**
    989996 * Add sub menu page to the comments main menu.
    990 * 
     997*
    991998 * This function takes a capability which will be used to determine whether
    992999 * or not a page is included in the menu.
    993  * 
     1000 *
    9941001 * The function which is hooked in to handle the output of the page must check
    9951002 * that the user has the required capability as well.
    996  * 
     1003 *
    9971004 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
    9981005 * @param string $menu_title The text to be used for the menu
Note: See TracChangeset for help on using the changeset viewer.