Make WordPress Core


Ignore:
Timestamp:
12/05/2024 12:11:27 PM (22 months ago)
Author:
swissspidy
Message:

Plugins: Load wp-admin/includes/plugin.php earlier.

Partially reverts [59479] and [59461], which previously tried to move some functions from wp-admin/includes/plugin.php to wp-includes/functions.php so they are available early, so that get_plugin_data() can be used.

However, other functions from that file are often used by plugins without necessarily checking whether they are available, easily causing fatal errors. Requiring this file directly is a safer approach to avoid such errors.

Props peterwilsoncc, dd32, swissspidy, johnbillion.
Fixes #62244.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-settings.php

    r59466 r59488  
    519519}
    520520
     521// To make get_plugin_data() available in a way that's compatible with plugins also loading this file, see #62244.
     522require_once ABSPATH . 'wp-admin/includes/plugin.php';
     523
    521524// Load active plugins.
    522525foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
Note: See TracChangeset for help on using the changeset viewer.