Detect and handle symlinking of plugins in plugin_basename().

props rmccue, MikeSchinkel, jdgrimes.
see #16953.


git-svn-id: https://develop.svn.wordpress.org/trunk@27158 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2014-02-10 22:59:40 +00:00
parent ef099f8082
commit b7be4e98fe
6 changed files with 62 additions and 10 deletions

View File

@@ -164,8 +164,11 @@ if ( is_multisite() ) {
// Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in.
wp_plugin_directory_constants();
$GLOBALS['wp_plugin_paths'] = array();
// Load must-use plugins.
foreach ( wp_get_mu_plugins() as $mu_plugin ) {
wp_register_plugin_realpath( $mu_plugin );
include_once( $mu_plugin );
}
unset( $mu_plugin );
@@ -173,6 +176,7 @@ unset( $mu_plugin );
// Load network activated plugins.
if ( is_multisite() ) {
foreach( wp_get_active_network_plugins() as $network_plugin ) {
wp_register_plugin_realpath( $network_plugin );
include_once( $network_plugin );
}
unset( $network_plugin );
@@ -206,8 +210,10 @@ create_initial_post_types();
register_theme_directory( get_theme_root() );
// Load active plugins.
foreach ( wp_get_active_and_valid_plugins() as $plugin )
foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
wp_register_plugin_realpath( $plugin );
include_once( $plugin );
}
unset( $plugin );
// Load pluggable functions.