Ticket #22802: wp-load-plugin.patch
File wp-load-plugin.patch, 3.7 KB (added by , 12 years ago) |
---|
-
public_html/wp-admin/plugins.php
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8
144 144 @ini_set('display_errors', true); //Ensure that Fatal errors are displayed. 145 145 // Go back to "sandbox" scope so we get the same errors as before 146 146 function plugin_sandbox_scrape( $plugin ) { 147 include( WP_PLUGIN_DIR . '/' . $plugin );147 wp_load_plugin( WP_PLUGIN_DIR . '/' . $plugin ); 148 148 } 149 149 plugin_sandbox_scrape( $plugin ); 150 150 do_action('activate_' . $plugin); -
public_html/wp-settings.php
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8
156 156 157 157 // Load must-use plugins. 158 158 foreach ( wp_get_mu_plugins() as $mu_plugin ) { 159 include_once( $mu_plugin);159 wp_load_plugin( $mu_plugin, 'mu-plugin' ); 160 160 } 161 161 unset( $mu_plugin ); 162 162 163 163 // Load network activated plugins. 164 164 if ( is_multisite() ) { 165 165 foreach( wp_get_active_network_plugins() as $network_plugin ) { 166 include_once( $network_plugin);166 wp_load_plugin( $network_plugin, 'network-plugin' ); 167 167 } 168 168 unset( $network_plugin ); 169 169 } … … 192 192 193 193 // Load active plugins. 194 194 foreach ( wp_get_active_and_valid_plugins() as $plugin ) 195 include_once( $plugin );195 wp_load_plugin( $plugin ); 196 196 unset( $plugin ); 197 197 198 198 // Load pluggable functions. -
public_html/wp-admin/includes/plugin.php
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8
859 859 update_option('uninstall_plugins', $uninstallable_plugins); 860 860 unset($uninstallable_plugins); 861 861 862 include WP_PLUGIN_DIR . '/' . $file;862 wp_load_plugin( WP_PLUGIN_DIR . '/' . $file ); 863 863 864 864 add_action( 'uninstall_' . $file, $callable ); 865 865 do_action( 'uninstall_' . $file ); -
public_html/wp-includes/load.php
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8
759 759 760 760 $wp_locale = new WP_Locale(); 761 761 } 762 763 /** 764 * Load plugin while setting $wp_plugin_file during the loading of the plugin 765 * 766 * @global string $wp_plugin_file Full filename for the currently loading plugin. 767 * @global string $wp_plugin_type One of 'plugin', 'mu-plugin' or 'network-plugin' 768 * @global string $wp_plugin_slug The 'slug' WordPress will store to identify this plugin 769 * 770 * @since 3.6 771 * 772 * @param string $plugin_file Full path and filename of plugin's entry point file. 773 * @param string $plugin_type Type of plugin loaded; plugin, mu-plugin or network-plugin. 774 */ 775 function wp_load_plugin( $plugin_file, $plugin_type = 'plugin' ) { 776 global $wp_plugin_file, $wp_plugin_type, $wp_plugin_slug; 777 $wp_plugin_type = $plugin_type; 778 /* 779 * @todo: Verify next 2 lines is correct logic for plugin slug for 100% of use-cases. 780 */ 781 $dir = preg_quote( 'mu-plugin' == $plugin_type ? WPMU_PLUGIN_DIR : WP_PLUGIN_DIR ); 782 $wp_plugin_slug = preg_replace( "#^{$dir}/(.+)$#", '$1', str_replace( '\\', '/', $plugin_file ) ); 783 include_once( $wp_plugin_file = $plugin_file ); 784 unset( $wp_plugin_file, $wp_plugin_type, $wp_plugin_slug ); 785 } 786