Support mu-plugins for 'Must Use' autoload plugins

git-svn-id: http://svn.automattic.com/wordpress/trunk@10737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-03-07 00:03:40 +00:00
parent e70c54c967
commit 3bf4ed1758

View File

@ -355,6 +355,41 @@ if ( !defined('WP_PLUGIN_URL') )
if ( !defined('PLUGINDIR') ) if ( !defined('PLUGINDIR') )
define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat. define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.
/**
* Allows for the mu-plugins directory to be moved from the default location.
*
* @since 2.8.0
*/
if ( !defined('WPMU_PLUGIN_DIR') )
define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash
/**
* Allows for the mu-plugins directory to be moved from the default location.
*
* @since 2.8.0
*/
if ( !defined('WPMU_PLUGIN_URL') )
define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash
/**
* Allows for the mu-plugins directory to be moved from the default location.
*
* @since 2.8.0
*/
if ( !defined( 'MUPLUGINDIR' ) )
define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat.
if ( is_dir( WPMU_PLUGIN_DIR ) ) {
if ( $dh = opendir( WPMU_PLUGIN_DIR ) ) {
while ( ( $plugin = readdir( $dh ) ) !== false ) {
if ( substr( $plugin, -4 ) == '.php' ) {
include_once( WPMU_PLUGIN_DIR . '/' . $plugin );
}
}
}
}
do_action('muplugins_loaded');
/** /**
* Used to guarantee unique hash cookies * Used to guarantee unique hash cookies
* @since 1.5 * @since 1.5