Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR correctly supports the PHP error handler chain.
When the previous error handler is not null, the QM error handler should call it accordingly to make the chain work. In my plugin KAGG Compatibility, the PHP error handler is set in the mu-plugin created at the plugin activation. Even though QM is loaded as the first plugin, the previous handler already exists.
I implemented a similar error handler in the WPForms Development plugin and, partially, in the WPForms plugin. In the presence of QM, I am setting my error handler again on the
plugin_loaded
hook and making the QM error handler work as a fallback.An error handler in the mu-plugin aimed to suppress annoying deprecated errors by PHP 8.0+ in different plugins or libraries. Letting the previous handler do its work and showing only meaningful errors in the QM would be good.
Testing steps
kagg-compatibility-error-handler.php
is added to themu-plugins
folder.kagg-compatibility-error-handler.php
comment out the lineadd_action( 'plugin_loaded', [ $this, 'plugin_loaded' ], 500 )
.