Cleanup network plugin loading. Props nacin. see #11644
git-svn-id: http://svn.automattic.com/wordpress/trunk@12930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -544,23 +544,30 @@ function delete_plugins($plugins, $redirect = '' ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* validate active plugins
|
||||
* Validate active plugins
|
||||
*
|
||||
* validate all active plugins, deactivates invalid and
|
||||
* returns an array of deactived ones.
|
||||
* Validate all active plugins, deactivates invalid and
|
||||
* returns an array of deactivated ones.
|
||||
*
|
||||
* @since unknown
|
||||
* @return array invalid plugins, plugin as key, error as value
|
||||
*/
|
||||
function validate_active_plugins() {
|
||||
$plugins = apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) );
|
||||
|
||||
// validate vartype: array
|
||||
if ( !is_array( $plugins ) ) {
|
||||
update_option('active_plugins', array());
|
||||
return;
|
||||
if ( ! is_array( $plugins ) ) {
|
||||
update_option( 'active_plugins', array() );
|
||||
$plugins = array();
|
||||
}
|
||||
|
||||
if ( is_multisite() && is_super_admin() ) {
|
||||
$network_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
|
||||
$plugins = array_merge( (array) $plugins, $network_plugins );
|
||||
}
|
||||
|
||||
if ( empty( $plugins ) )
|
||||
return;
|
||||
|
||||
$invalid = array();
|
||||
|
||||
// invalid plugins get deactivated
|
||||
@@ -659,13 +666,13 @@ function uninstall_plugin($plugin) {
|
||||
|
||||
/**
|
||||
* Add a top level menu page
|
||||
*
|
||||
*
|
||||
* This function takes a capability which will be used to determine whether
|
||||
* or not a page is included in the menu.
|
||||
*
|
||||
*
|
||||
* The function which is hooked in to handle the output of the page must check
|
||||
* that the user has the required capability as well.
|
||||
*
|
||||
*
|
||||
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
|
||||
* @param string $menu_title The text to be used for the menu
|
||||
* @param string $capability The capability required for this menu to be displayed to the user.
|
||||
@@ -706,13 +713,13 @@ function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $func
|
||||
|
||||
/**
|
||||
* Add a top level menu page in the 'objects' section
|
||||
*
|
||||
*
|
||||
* This function takes a capability which will be used to determine whether
|
||||
* or not a page is included in the menu.
|
||||
*
|
||||
*
|
||||
* The function which is hooked in to handle the output of the page must check
|
||||
* that the user has the required capability as well.
|
||||
*
|
||||
*
|
||||
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
|
||||
* @param string $menu_title The text to be used for the menu
|
||||
* @param string $capability The capability required for this menu to be displayed to the user.
|
||||
@@ -730,13 +737,13 @@ function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $fu
|
||||
|
||||
/**
|
||||
* Add a top level menu page in the 'utility' section
|
||||
*
|
||||
*
|
||||
* This function takes a capability which will be used to determine whether
|
||||
* or not a page is included in the menu.
|
||||
*
|
||||
*
|
||||
* The function which is hooked in to handle the output of the page must check
|
||||
* that the user has the required capability as well.
|
||||
*
|
||||
*
|
||||
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
|
||||
* @param string $menu_title The text to be used for the menu
|
||||
* @param string $capability The capability required for this menu to be displayed to the user.
|
||||
@@ -754,13 +761,13 @@ function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $f
|
||||
|
||||
/**
|
||||
* Add a sub menu page
|
||||
*
|
||||
*
|
||||
* This function takes a capability which will be used to determine whether
|
||||
* or not a page is included in the menu.
|
||||
*
|
||||
*
|
||||
* The function which is hooked in to handle the output of the page must check
|
||||
* that the user has the required capability as well.
|
||||
*
|
||||
*
|
||||
* @param string $parent_slug The slug name for the parent menu (or the file name of a standard WordPress admin page)
|
||||
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
|
||||
* @param string $menu_title The text to be used for the menu
|
||||
@@ -813,13 +820,13 @@ function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability,
|
||||
|
||||
/**
|
||||
* Add sub menu page to the tools main menu.
|
||||
*
|
||||
*
|
||||
* This function takes a capability which will be used to determine whether
|
||||
* or not a page is included in the menu.
|
||||
*
|
||||
*
|
||||
* The function which is hooked in to handle the output of the page must check
|
||||
* that the user has the required capability as well.
|
||||
*
|
||||
*
|
||||
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
|
||||
* @param string $menu_title The text to be used for the menu
|
||||
* @param string $capability The capability required for this menu to be displayed to the user.
|
||||
@@ -832,13 +839,13 @@ function add_management_page( $page_title, $menu_title, $capability, $menu_slug,
|
||||
|
||||
/**
|
||||
* Add sub menu page to the options main menu.
|
||||
*
|
||||
*
|
||||
* This function takes a capability which will be used to determine whether
|
||||
* or not a page is included in the menu.
|
||||
*
|
||||
*
|
||||
* The function which is hooked in to handle the output of the page must check
|
||||
* that the user has the required capability as well.
|
||||
*
|
||||
*
|
||||
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
|
||||
* @param string $menu_title The text to be used for the menu
|
||||
* @param string $capability The capability required for this menu to be displayed to the user.
|
||||
@@ -851,13 +858,13 @@ function add_options_page( $page_title, $menu_title, $capability, $menu_slug, $f
|
||||
|
||||
/**
|
||||
* Add sub menu page to the themes main menu.
|
||||
*
|
||||
*
|
||||
* This function takes a capability which will be used to determine whether
|
||||
* or not a page is included in the menu.
|
||||
*
|
||||
*
|
||||
* The function which is hooked in to handle the output of the page must check
|
||||
* that the user has the required capability as well.
|
||||
*
|
||||
*
|
||||
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
|
||||
* @param string $menu_title The text to be used for the menu
|
||||
* @param string $capability The capability required for this menu to be displayed to the user.
|
||||
@@ -870,13 +877,13 @@ function add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $fun
|
||||
|
||||
/**
|
||||
* Add sub menu page to the Users/Profile main menu.
|
||||
*
|
||||
*
|
||||
* This function takes a capability which will be used to determine whether
|
||||
* or not a page is included in the menu.
|
||||
*
|
||||
*
|
||||
* The function which is hooked in to handle the output of the page must check
|
||||
* that the user has the required capability as well.
|
||||
*
|
||||
*
|
||||
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
|
||||
* @param string $menu_title The text to be used for the menu
|
||||
* @param string $capability The capability required for this menu to be displayed to the user.
|
||||
@@ -892,13 +899,13 @@ function add_users_page( $page_title, $menu_title, $capability, $menu_slug, $fun
|
||||
}
|
||||
/**
|
||||
* Add sub menu page to the Dashboard main menu.
|
||||
*
|
||||
*
|
||||
* This function takes a capability which will be used to determine whether
|
||||
* or not a page is included in the menu.
|
||||
*
|
||||
*
|
||||
* The function which is hooked in to handle the output of the page must check
|
||||
* that the user has the required capability as well.
|
||||
*
|
||||
*
|
||||
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
|
||||
* @param string $menu_title The text to be used for the menu
|
||||
* @param string $capability The capability required for this menu to be displayed to the user.
|
||||
@@ -911,13 +918,13 @@ function add_dashboard_page( $page_title, $menu_title, $capability, $menu_slug,
|
||||
|
||||
/**
|
||||
* Add sub menu page to the posts main menu.
|
||||
*
|
||||
*
|
||||
* This function takes a capability which will be used to determine whether
|
||||
* or not a page is included in the menu.
|
||||
*
|
||||
*
|
||||
* The function which is hooked in to handle the output of the page must check
|
||||
* that the user has the required capability as well.
|
||||
*
|
||||
*
|
||||
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
|
||||
* @param string $menu_title The text to be used for the menu
|
||||
* @param string $capability The capability required for this menu to be displayed to the user.
|
||||
@@ -930,13 +937,13 @@ function add_posts_page( $page_title, $menu_title, $capability, $menu_slug, $fun
|
||||
|
||||
/**
|
||||
* Add sub menu page to the media main menu.
|
||||
*
|
||||
*
|
||||
* This function takes a capability which will be used to determine whether
|
||||
* or not a page is included in the menu.
|
||||
*
|
||||
*
|
||||
* The function which is hooked in to handle the output of the page must check
|
||||
* that the user has the required capability as well.
|
||||
*
|
||||
*
|
||||
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
|
||||
* @param string $menu_title The text to be used for the menu
|
||||
* @param string $capability The capability required for this menu to be displayed to the user.
|
||||
@@ -949,13 +956,13 @@ function add_media_page( $page_title, $menu_title, $capability, $menu_slug, $fun
|
||||
|
||||
/**
|
||||
* Add sub menu page to the links main menu.
|
||||
*
|
||||
*
|
||||
* This function takes a capability which will be used to determine whether
|
||||
* or not a page is included in the menu.
|
||||
*
|
||||
*
|
||||
* The function which is hooked in to handle the output of the page must check
|
||||
* that the user has the required capability as well.
|
||||
*
|
||||
*
|
||||
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
|
||||
* @param string $menu_title The text to be used for the menu
|
||||
* @param string $capability The capability required for this menu to be displayed to the user.
|
||||
@@ -968,13 +975,13 @@ function add_links_page( $page_title, $menu_title, $capability, $menu_slug, $fun
|
||||
|
||||
/**
|
||||
* Add sub menu page to the pages main menu.
|
||||
*
|
||||
*
|
||||
* This function takes a capability which will be used to determine whether
|
||||
* or not a page is included in the menu.
|
||||
*
|
||||
*
|
||||
* The function which is hooked in to handle the output of the page must check
|
||||
* that the user has the required capability as well.
|
||||
*
|
||||
*
|
||||
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
|
||||
* @param string $menu_title The text to be used for the menu
|
||||
* @param string $capability The capability required for this menu to be displayed to the user.
|
||||
@@ -987,13 +994,13 @@ function add_pages_page( $page_title, $menu_title, $capability, $menu_slug, $fun
|
||||
|
||||
/**
|
||||
* Add sub menu page to the comments main menu.
|
||||
*
|
||||
*
|
||||
* This function takes a capability which will be used to determine whether
|
||||
* or not a page is included in the menu.
|
||||
*
|
||||
*
|
||||
* The function which is hooked in to handle the output of the page must check
|
||||
* that the user has the required capability as well.
|
||||
*
|
||||
*
|
||||
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
|
||||
* @param string $menu_title The text to be used for the menu
|
||||
* @param string $capability The capability required for this menu to be displayed to the user.
|
||||
|
||||
Reference in New Issue
Block a user