Make WordPress Core


Ignore:
Timestamp:
02/04/2010 06:50:36 PM (14 years ago)
Author:
ryan
Message:

Sitewide plugins cleanup. Props nacin. see #11644

File:
1 edited

Legend:

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

    r12930 r12947  
    260260 */
    261261function is_plugin_active( $plugin ) {
    262     return in_array( $plugin, apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) ) );
     262    return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || is_plugin_active_for_network( $plugin );
    263263}
    264264
     
    271271 * @return bool True, if active for the network, otherwise false.
    272272 */
    273 function is_plugin_active_for_network( $plugin ){
     273function is_plugin_active_for_network( $plugin ) {
    274274    if ( !is_multisite() )
    275275        return false;
     
    554554 */
    555555function validate_active_plugins() {
    556     $plugins = apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) );
     556    $plugins = get_option( 'active_plugins', array() );
    557557    // validate vartype: array
    558558    if ( ! is_array( $plugins ) ) {
     
    563563    if ( is_multisite() && is_super_admin() ) {
    564564        $network_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
    565         $plugins = array_merge( (array) $plugins, $network_plugins );
     565        $plugins = array_merge( $plugins, $network_plugins );
    566566    }
    567567
Note: See TracChangeset for help on using the changeset viewer.