From 6f44d8c2dd282de44745f1f412a4f9cf21167710 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Fri, 19 Aug 2016 04:09:55 +0000 Subject: [PATCH] Bootstrap/Load: Include Plugin API via `require_once` Currently, auto-prepended files need to directly modify the globals in order to add filters and actions. This is a bad idea. Globals are bad. You should never directly interact with the Plugin globals. Fixes #37707. git-svn-id: https://develop.svn.wordpress.org/trunk@38282 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/plugin.php | 2 ++ src/wp-settings.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/plugin.php b/src/wp-includes/plugin.php index ca4985f1f0..bdb9ebd17d 100644 --- a/src/wp-includes/plugin.php +++ b/src/wp-includes/plugin.php @@ -14,6 +14,8 @@ * Also see the {@link https://codex.wordpress.org/Plugin_API Plugin API} for * more information and examples on how to use a lot of these functions. * + * This file should have no external dependencies. + * * @package WordPress * @subpackage Plugin * @since 1.5.0 diff --git a/src/wp-settings.php b/src/wp-settings.php index dc3b25a7cb..7f136159c2 100644 --- a/src/wp-settings.php +++ b/src/wp-settings.php @@ -20,7 +20,7 @@ define( 'WPINC', 'wp-includes' ); // Include files required for initialization. require( ABSPATH . WPINC . '/load.php' ); require( ABSPATH . WPINC . '/default-constants.php' ); -require( ABSPATH . WPINC . '/plugin.php' ); +require_once( ABSPATH . WPINC . '/plugin.php' ); /* * These can't be directly globalized in version.php. When updating,