Make WordPress Core

Ticket #55432: 55432.2.diff

File 55432.2.diff, 2.8 KB (added by SergeyBiryukov, 2 years ago)
  • src/wp-admin/includes/plugin.php

     
    12471247                update_option( 'uninstall_plugins', $uninstallable_plugins );
    12481248                unset( $uninstallable_plugins );
    12491249
    1250                 wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $file );
    1251                 include_once WP_PLUGIN_DIR . '/' . $file;
     1250                wp_load_plugin_file( WP_PLUGIN_DIR . '/' . $file );
    12521251
    12531252                add_action( "uninstall_{$file}", $callable );
    12541253
     
    22992298                define( 'WP_SANDBOX_SCRAPING', true );
    23002299        }
    23012300
    2302         wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
    2303         include_once WP_PLUGIN_DIR . '/' . $plugin;
     2301        wp_load_plugin_file( WP_PLUGIN_DIR . '/' . $plugin );
    23042302}
    23052303
    23062304/**
  • src/wp-admin/update.php

     
    9797
    9898                        error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
    9999                        ini_set( 'display_errors', true ); // Ensure that fatal errors are displayed.
    100                         wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
    101                         include WP_PLUGIN_DIR . '/' . $plugin;
     100
     101                        wp_load_plugin_file( WP_PLUGIN_DIR . '/' . $plugin );
    102102                }
    103103                iframe_footer();
    104104        } elseif ( 'install-plugin' === $action ) {
  • src/wp-includes/plugin.php

     
    772772}
    773773
    774774/**
     775 * Loads a plugin's file.
     776 *
     777 * @since 6.0.0
     778 *
     779 * @param string $file Path to the plugin file.
     780 */
     781function wp_load_plugin_file( $file ) {
     782        wp_register_plugin_realpath( $file );
     783        include_once $file;
     784}
     785
     786/**
    775787 * Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in.
    776788 *
    777789 * @since 2.8.0
  • src/wp-settings.php

     
    362362// Load network activated plugins.
    363363if ( is_multisite() ) {
    364364        foreach ( wp_get_active_network_plugins() as $network_plugin ) {
    365                 wp_register_plugin_realpath( $network_plugin );
    366                 include_once $network_plugin;
     365                wp_load_plugin_file( $network_plugin );
    367366
    368367                /**
    369368                 * Fires once a single network-activated plugin has loaded.
     
    414413
    415414// Load active plugins.
    416415foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
    417         wp_register_plugin_realpath( $plugin );
    418         include_once $plugin;
     416        wp_load_plugin_file( $plugin );
    419417
    420418        /**
    421419         * Fires once a single activated plugin has loaded.