Index: public_html/wp-includes/plugin.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- public_html/wp-includes/plugin.php (revision 23400)
+++ public_html/wp-includes/plugin.php (revision )
@@ -787,3 +787,37 @@
return $function[0].$function[1];
}
}
+
+/**
+ * Stores array of symlinked plugins upon update of 'active_plugins' into 'symlinked_plugins' option.
+ *
+ * The array stored for 'symlinked_plugins' will be in the following form assuming that $plugin_virtual_path contained
+ * an array of full virtual plugin paths where each is in the form WP_PLUGIN_DIR . "/{plugin_slug}":
+ *
+ * array(
+ * realpath( $plugin_virtual_path[1] ) => $plugin_virtual_path[1],
+ * realpath( $plugin_virtual_path[2] ) => $plugin_virtual_path[2],
+ * realpath( $plugin_virtual_path[3] ) => $plugin_virtual_path[3],
+ * );
+ *
+ * @package WordPress
+ * @subpackage Plugin
+ * @access private
+ * @since 3.6
+ * @link http://core.trac.wordpress.org/ticket/16953
+ *
+ * @param mixed $newvalue The newly changed array of 'active_plugins' being saved.
+ * @param mixed $oldvalue The previous saved array of 'active_plugins' from wp_options.
+ * @return mixed Array of full plugin filepaths where key is realpath( $virtual_path ) and value is $virtual_path.
+ */
+function _wp_pre_update_option_active_plugins( $newvalue, $oldvalue ) {
+ $symlinked_plugins = array();
+ foreach( $newvalue as $plugin_slug ) {
+ $real_path = realpath( $virtual_path = WP_PLUGIN_DIR . "/{$plugin_slug}" );
+ if ( $real_path != $virtual_path )
+ $symlinked_plugins[$real_path] = $virtual_path;
+ }
+ update_option( 'symlinked_plugins', $symlinked_plugins );
+ return $newvalue;
+}
+add_filter( 'pre_update_option_active_plugins', '_wp_pre_update_option_active_plugins', 10, 2 );
Index: public_html/wp-includes/link-template.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- public_html/wp-includes/link-template.php (revision 23400)
+++ public_html/wp-includes/link-template.php (revision )
@@ -2060,6 +2060,11 @@
*/
function plugins_url($path = '', $plugin = '') {
+ $symlinked_plugins = get_option( 'symlinked_plugins' );
+ if ( isset( $symlinked_plugins[$plugin] ) ) {
+ $plugin = $symlinked_plugins[$plugin];
+ }
+
$mu_plugin_dir = WPMU_PLUGIN_DIR;
foreach ( array('path', 'plugin', 'mu_plugin_dir') as $var ) {
$$var = str_replace('\\' ,'/', $$var); // sanitize for Win32 installs