WordPress.org

Make WordPress Core

Changeset 10737


Ignore:
Timestamp:
03/07/09 00:03:40 (5 years ago)
Author:
ryan
Message:

Support mu-plugins for 'Must Use' autoload plugins

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-settings.php

    r10731 r10737  
    357357 
    358358/** 
     359 * Allows for the mu-plugins directory to be moved from the default location. 
     360 * 
     361 * @since 2.8.0 
     362 */ 
     363if ( !defined('WPMU_PLUGIN_DIR') ) 
     364    define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash 
     365 
     366/** 
     367 * Allows for the mu-plugins directory to be moved from the default location. 
     368 * 
     369 * @since 2.8.0 
     370 */ 
     371if ( !defined('WPMU_PLUGIN_URL') ) 
     372    define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash 
     373 
     374/** 
     375 * Allows for the mu-plugins directory to be moved from the default location. 
     376 * 
     377 * @since 2.8.0 
     378 */ 
     379if ( !defined( 'MUPLUGINDIR' ) )  
     380    define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH.  For back compat. 
     381 
     382if ( is_dir( WPMU_PLUGIN_DIR ) ) { 
     383    if ( $dh = opendir( WPMU_PLUGIN_DIR ) ) { 
     384        while ( ( $plugin = readdir( $dh ) ) !== false ) { 
     385            if ( substr( $plugin, -4 ) == '.php' ) { 
     386                include_once( WPMU_PLUGIN_DIR . '/' . $plugin ); 
     387            } 
     388        } 
     389    } 
     390} 
     391do_action('muplugins_loaded'); 
     392 
     393/** 
    359394 * Used to guarantee unique hash cookies 
    360395 * @since 1.5 
Note: See TracChangeset for help on using the changeset viewer.