Make WordPress Core

Changeset 38589


Ignore:
Timestamp:
09/12/2016 01:49:46 AM (8 years ago)
Author:
pento
Message:

Bootstrap: Use dirname() when loading class-wp-hook.php from plugin.php.

To allow plugin.php to be loaded before the rest of WordPress is loaded, it cannot rely on WordPress constants, such as ABSPATH and WPINC.

Instead, we can assume that class-wp-hook.php will be in the same directory as plugin.php, so dirname( __FILE__ ) will give us the correct path to load from.

Props pento, dd32.
Fixes #37707.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/plugin.php

    r38571 r38589  
    2323
    2424// Initialize the filter globals.
    25 require( ABSPATH . WPINC . '/class-wp-hook.php' );
     25require( dirname( __FILE__ ) . '/class-wp-hook.php' );
    2626
    2727/** @var WP_Hook[] $wp_filter */
Note: See TracChangeset for help on using the changeset viewer.