[wp-trac] [WordPress Trac] #63627: General: Only override `$table_prefix` if not defined

WordPress Trac noreply at wordpress.org
Sat Mar 7 17:12:29 UTC 2026


#63627: General: Only override `$table_prefix` if not defined
----------------------------+--------------------------------
 Reporter:  Ninos Ego       |       Owner:  SergeyBiryukov
     Type:  enhancement     |      Status:  closed
 Priority:  normal          |   Milestone:  7.0
Component:  Bootstrap/Load  |     Version:  6.9
 Severity:  normal          |  Resolution:  fixed
 Keywords:  has-patch       |     Focuses:  php-compatibility
----------------------------+--------------------------------

Comment (by westonruter):

 @ninos-ego thank you. I see in your bootstrap code that you explicitly are
 already doing `global $table_prefix;`

 So is the `if` statement actually executing for you?

 {{{
 if ( ! isset( $GLOBALS['table_prefix'] ) ) {
         $GLOBALS['table_prefix'] = $table_prefix;
 }
 }}}

 To me it seems it will already be a global so it will already be set.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63627#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list