Make WordPress Core

Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#58332 closed enhancement (wontfix)

Replace require with require_once in wp-settings.php

Reported by: beardcat's profile beardcat Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.3
Component: Bootstrap/Load Keywords: has-patch
Focuses: Cc:


It would be nice for users/plugin-devs to be able to load certain core files before the core actually bootstraps them.

This may sound a bit weird but hear me out: In the case of the plugin its about a error tracking plugin which registers a custom exception handler via set_exception_handler

This plugin needs to be loaded/bootstraped as early as possible to register that exception handler to send possible exceptions in the wordpress bootstrapping process to wherever it is needed.

To make this possible nothing to major has to happen in the wordpress core. Its just about the difference between require and require_once.
I'll provide a PR which replaces all the require with require_once in the wp-settings.php

Looking forward to your feedback!

Attachments (1)

58332.patch (29.7 KB) - added by beardcat 14 months ago.

Download all attachments as: .zip

Change History (5)

This ticket was mentioned in PR #4462 on WordPress/wordpress-develop by LordSimal.

14 months ago

  • Keywords has-patch added

14 months ago

#2 @SergeyBiryukov
14 months ago

Hi there, welcome to WordPress Trac! Thanks for the ticket.

Just noting that this was previously discussed in #19921 and #20298.

This comment specifically explains why it has not been implemented: comment:4:ticket:20298.

On a related note, making it possible for plugins to override core files was also a concern when discussing an autoloader implementation, for example in comment:117:ticket:36335.

Last edited 14 months ago by SergeyBiryukov (previous) (diff)

#3 @beardcat
14 months ago

  • Resolution set to wontfix
  • Status changed from new to closed

Thanks @SergeyBiryukov for the quick reply!

I expected this was probably already discussed but couldn't find any related tickets myself.

Anyways I will close this ticket as this clearly won't change from WordPress and we will find another solution on our side.

#4 @SergeyBiryukov
14 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.