With define('WP_DEBUG', true);
in wp-config.php, I get the following notice:
Constant EMPTY_TRASH_DAYS already defined in /wp-config.php on line 83
I have checked this file, and this constant is defined just once. I've also searched through all of the php files on the server and don't see that it's defined anywhere else. I've run a thorough search. The only other place it's defined is in default-constants.php
:
if ( !defined( 'EMPTY_TRASH_DAYS' ) )
define( 'EMPTY_TRASH_DAYS', 30 );
By commenting out the second line, the notice disappears. But it doesn't make sense to have to edit default-constants.php
in order to define the constant in the proper place, which is wp-config.php
.
How should I define this constant properly, without editing default-constants.php
, which risks being overwritten during an upgrade?
index.php
(in install root, not your theme) ->wp-blog-header.php
->wp-load.php
->wp-config.php
. That notice is telling you where it's attempting to set the constant a 2nd time. It seems very strange to see that error that early in the process where only core files have been loaded. I would start by switching to a default theme and disabling all plugins, check if error is still present, then re-enable one-by-one.default-constants.php
the notice disappears. I've edited the question to include this updated information. However, the problem still isn't fully resolved, in that I shouldn't have to editdefault-constants.php.
require_once( ABSPATH . 'wp-settings.php' );
. Is yourdefine( 'EMPTY_TRASH_DAYS', 30 );
before this line?