[wp-trac] [WordPress Trac] #36210: $table_prefix should default to "wp_"

WordPress Trac noreply at wordpress.org
Sat Mar 12 00:22:12 UTC 2016


#36210: $table_prefix should default to "wp_"
-------------------------+-----------------------------
 Reporter:  Shelob9      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 Currently failing to specify a table prefix causes WordPress to not load.
 Since users of all levels are often encouraged to edit wp-config.php, it
 could get accidentally removed. In fact, since everything else in wp-
 config is a constant, the variable definition there looks wrong.

 So, I propose that "wp_" be used as a default prefix, since it effectively
 is already. If the site doesn't have any wp_ prefixed tables, then they
 will still get the same errors, but this could prevent a lot of sites
 breaking for a simple reason.

 I am attaching a patch that, inside of `WPDB::set_prefix()`, resets the
 value of the `$prefix` argument to "wp_" if it is empty and we are not in
 multisite.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36210>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list