Skip to content

Adds new WP_DEBUG_LEVEL constant to load.php#5494

Open
jonathan-dejong wants to merge 1 commit intoWordPress:trunkfrom
jonathan-dejong:31839
Open

Adds new WP_DEBUG_LEVEL constant to load.php#5494
jonathan-dejong wants to merge 1 commit intoWordPress:trunkfrom
jonathan-dejong:31839

Conversation

@jonathan-dejong
Copy link
Copy Markdown

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 GitHub Pull Requests for Code Review in the Core Handbook for more details.

@jonathan-dejong
Copy link
Copy Markdown
Author

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

Sign up for free to join this conversation on GitHub. 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