WordPress.org

Make WordPress Core

Ticket #10533: 10533-deprecated-only.patch

File 10533-deprecated-only.patch, 1.2 KB (added by nacin, 8 years ago)

No E_DEPRECATED warnings when WP_DEBUG.

  • wp-settings.php

     
    198198}
    199199timer_start();
    200200
    201 // Add define('WP_DEBUG',true); to wp-config.php to enable display of notices during development.
    202 if ( defined('WP_DEBUG') && WP_DEBUG == true ) {
    203         error_reporting(E_ALL);
     201// Add define('WP_DEBUG', true); to wp-config.php to enable display of notices during development.
     202if ( defined('WP_DEBUG') && WP_DEBUG ) {
     203        if ( defined('E_DEPRECATED') )
     204                error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
     205        else
     206                error_reporting(E_ALL);
    204207        // Add define('WP_DEBUG_DISPLAY', false); to wp-config.php to use the globally configured setting for display_errors and not force it to On
    205         if ( ! defined('WP_DEBUG_DISPLAY') || WP_DEBUG_DISPLAY == true )
     208        if ( ! defined('WP_DEBUG_DISPLAY') || WP_DEBUG_DISPLAY )
    206209                ini_set('display_errors', 1);
    207210        // Add define('WP_DEBUG_LOG', true); to enable php debug logging to WP_CONTENT_DIR/debug.log
    208         if ( defined('WP_DEBUG_LOG') && WP_DEBUG_LOG == true ) {
     211        if ( defined('WP_DEBUG_LOG') && WP_DEBUG_LOG ) {
    209212                ini_set('log_errors', 1);
    210213                ini_set('error_log', WP_CONTENT_DIR . '/debug.log');
    211214        }