Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#11729 closed enhancement (fixed)

Get rid of "default constants" in wp-settings

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

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 17 years ago.
Improving performance is always good

Download all attachments as: .zip

Change History (2)

@nacin
17 years ago

Improving performance is always good

#1 @nacin
17 years ago

  • Resolution → fixed
  • Status new → closed

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

Note: See TracTickets for help on using tickets.