[wp-trac] [WordPress Trac] #11729: Get rid of "default constants" in wp-settings

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 5 18:54:15 UTC 2010

#11729: Get rid of "default constants" in wp-settings
 Reporter:  nacin        |       Owner:           
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:  3.0      
Component:  Performance  |     Version:           
 Severity:  normal       |    Keywords:  has-patch
 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.

Ticket URL: <http://core.trac.wordpress.org/ticket/11729>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list