WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#11729 closed enhancement (fixed)

Get rid of "default constants" in wp-settings

Reported by: nacin Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version:
Component: Performance Keywords: has-patch
Focuses: Cc:

Description

We have this block of code in wp-settings.php:

$default_constants = array( 'WP_POST_REVISIONS' => true );
foreach ( $default_constants as $c => $v )
        @define( $c, $v ); // will fail if the constant is already defined
unset($default_constants, $c, $v);

Since we haven't converted other constants in wp-settings.php over to this $default_constants convention, we should instead change this to the typical if !defined() define() we see throughout wp-settings.php.

At first, I was going to suggest we add a defined() check in that loop instead of suppressing errors, but removing it all together I think makes the most sense.

Attachments (1)

11729.diff (652 bytes) - added by nacin 4 years ago.
Improving performance is always good

Download all attachments as: .zip

Change History (2)

nacin4 years ago

Improving performance is always good

comment:1 nacin4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Long gone, now default-constants.php, see #11881.

Note: See TracTickets for help on using tickets.