Skip to content

Adds new WP_DEBUG_LEVEL constant to load.php #5494

New issue

Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.

By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on ? Sign in to your account

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

jonathan-dejong
Copy link

My proposal is to add a new constant used in wp-includes/load.php changing the setting of error_reporting.

This would introduce the constant WP_DEBUG_LEVEL which developers can use to set their own level of error reporting in wp-config.php while defaulting back to the same value it has always been in WordPress.

  • It would not cause issues with any existing WordPress install.

  • It would allow developers that want to upgrade to PHP 8 while still being able to use WP_DEBUG in their development environment.

  • It would overall support the use of a single constant for a WordPress install to use for determining the desired error reporting level. This means that plugin developers can also use this constant to set their desired log level in their code. An example of a valid case of such can be found in the WP Sentry plugin where there's a constant called WP_SENTRY_ERROR_TYPES used. This could default to using WP_DEBUG_LEVEL if that is set.

Trac ticket: https://core.trac.wordpress.org/ticket/31839


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See Pull Requests for Code Review in the Core Handbook for more details.

@jonathan-dejong
Copy link
Author

Note that the failing check is welcoming new contributor 😅
https://.com/WordPress/wordpress-develop/actions/runs/6531361467/job/17732454001?pr=5494

Sign up for free to join this conversation on . Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
@jonathan-dejong