From 738367d88ef5388c8c89556d15f86d32fb465dee Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sat, 7 Mar 2009 00:03:40 +0000 Subject: [PATCH] Support mu-plugins for 'Must Use' autoload plugins git-svn-id: https://develop.svn.wordpress.org/trunk@10737 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-settings.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/wp-settings.php b/wp-settings.php index a2d3b59cab..082ef00b8c 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -355,6 +355,41 @@ if ( !defined('WP_PLUGIN_URL') ) if ( !defined('PLUGINDIR') ) 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 * @since 1.5