[wp-trac] [WordPress Trac] #48693: Silence ini_set caused error or check if function_exists first
WordPress Trac
noreply at wordpress.org
Tue Nov 19 04:58:24 UTC 2019
#48693: Silence ini_set caused error or check if function_exists first
----------------------------+------------------------------
Reporter: drazon | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bootstrap/Load | Version: 5.3
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
----------------------------+------------------------------
Comment (by autotutorial):
I'll answer you here and not in your other topic, add_filter or
apply_filter is not available in the context of wp-config.php.
I customized the debug based on my preferences, if ini_set works set
WP_DEBUG_DISPLAY, default to false, check reserved words in WP_DEBUG_LOG
and react.
Create a folder in /wp-content/plugins/testsuper/
add a testsuper.php file to this folder
the plugin name is located at the beginning of the php file.
See if you solve it?
{{{#!php
<?php
/**
* Plugin Name: testsuper
* Plugin URI: http://www.mywebsite.com/testsuper
* Description: The very first plugin that I have ever created.
* Version: 1.0
* Author: Your Name
* Author URI: http://www.mywebsite.com
*/
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
add_filter( 'enable_wp_debug_mode_checks', function(){ return false;} );
if ( WP_DEBUG ) {
error_reporting( E_ALL );
$display_conf = 0;
if ( defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY == true )
$display_conf = 1;
if ( !in_array(strtolower( (string) WP_DEBUG_LOG ), array( 'true', '1',
'on', 'false', '0', 'off' ), true ) ) {
if( is_string( WP_DEBUG_LOG ) ) {
$log_path = WP_DEBUG_LOG;
} elseif (!empty( WP_DEBUG_LOG) && (string) WP_DEBUG_LOG != 'false' )
{
$log_path = WP_CONTENT_DIR . '/debug.log';
}
@ini_set( 'log_errors', 1 );
if( !@ini_set( 'error_log', $log_path ) )
error_log('error unknow'."\n",3,$log_path);
}
} else {
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 );
}
if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || (
defined( 'WP_INSTALLING' ) && WP_INSTALLING ) || wp_doing_ajax() ||
wp_is_json_request() )
$display_config = 0;
@ini_set( 'display_startup_errors', $display_conf );
@ini_set( 'display_errors', $display_conf );
}}}
Hi guys I hope you are okay, sorry I believe that null! ==
WP_DEBUG_DISPLAY confuses ideas, when I think of null I believe in an
undefined constant, frankly there is not the first WP_DEBUG_DISPLAY
control.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48693#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list