Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#50227 closed enhancement (duplicate)

Contant for error_reporting

Reported by: hannesd's profile hannesd Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.5
Component: Bootstrap/Load Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

In wp_load.php wp_debug_mode() error_reporting is set to E_ALL, when WP_DEBUG is set to true. E_ALL is not the best choice in all situations. I would like to have a constant, where I can set a error_reporting to a different value.

if ( WP_DEBUG ) {
    if ( defined( 'WP_DEBUG_ERROR_REPORTING' ) ) {
        error_reporting( WP_DEBUG_ERROR_REPORTING );
    } else {
        error_reporting( E_ALL );
    }
    ...

The constant can then be defined in wp_config.php
define( 'WP_DEBUG_ERROR_REPORTING', E_ALL & ~E_NOTICE & ~E_DEPRECATED | E_STRICT );

Change History (1)

#1 @SergeyBiryukov
5 years ago

  • Description modified (diff)
  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi there, welcome to WordPress Trac!

Thanks for the ticket, we're already tracking this enhancement in #31839.

Note: See TracTickets for help on using tickets.