Advertisement
bjornjohansen

Alternative wp_debug_mode()

Nov 26th, 2013
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. function wp_debug_mode() {
  2.     if ( WP_DEBUG ) {
  3.  
  4.         if ( is_defined( 'WP_DEBUG_LEVEL' ) ) {
  5.             error_reporting( WP_DEBUG_LEVEL );
  6.         } else {
  7.             error_reporting( E_ALL );
  8.         }
  9.  
  10.         if ( WP_DEBUG_DISPLAY )
  11.             ini_set( 'display_errors', 1 );
  12.         elseif ( null !== WP_DEBUG_DISPLAY )
  13.             ini_set( 'display_errors', 0 );
  14.  
  15.         if ( WP_DEBUG_LOG ) {
  16.             ini_set( 'log_errors', 1 );
  17.             ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' );
  18.         }
  19.     } else {
  20.         error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
  21.     }
  22.     if ( defined( 'XMLRPC_REQUEST' ) )
  23.         ini_set( 'display_errors', 0 );
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement