Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#2524 closed defect (bug) (fixed)

$table* global variables sheduled for deletion

Reported by: markjaquith Owned by: markjaquith
Milestone: 2.1 Priority: lowest
Severity: trivial Version: 2.0.1
Component: Administration Keywords:
Focuses: Cc:


The $table* ($tableposts, $tablecomments) etc global variables have been marked for imminent deletion in the code for something like 18 months now. Target 2.1, or are there still enough ignorant plugin develeopers using them to warrant keeping them for a while longer?

Also, we're currently using $table_prefix variable in core code... shouldn't we be using $wpdb->table_prefix?

Attachments (2)

table_prefix.diff (8.0 KB) - added by markjaquith 10 years ago.
2524.diff (847 bytes) - added by robmiller 9 years ago.

Download all attachments as: .zip

Change History (9)

#1 @ryan
10 years ago

We should definitely use the wpdb table prefix in core. I think we need to sample some plugins to see how widespread table* may be.

#2 @markjaquith
10 years ago

  • Milestone set to 2.1
  • Owner changed from anonymous to markjaquith
  • Status changed from new to assigned
  • Version changed from 1.2 to 2.0.1

I'm making a patch for $table_prefix now

#3 @davidhouse
10 years ago


  • Makes things neater
  • Forces plugins to have better code
  • Reduce our symbol space


  • Negligible speed/memory etc. benefits (I'd wager)
  • May break plugins

+1. These have been around so long that any plugins using them are so decrepid they probably break on some other major change as well.

#5 @markjaquith
10 years ago

It may be that no matter how long we wait, people will still use these. Usage may be as low now as it's ever going to be. And yeah, David is right... anyone still using these is likely still using $user_level and $single instead of is_single() and a whole host of other things that have been deprecated.

9 years ago

#6 @robmiller
9 years ago

+1 for removing them, here's a patch.

#7 @matt
9 years ago

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

(In [3951]) Another step toward removing old table vars, this is why we should be careful about naming things! Fixes #2524

Note: See TracTickets for help on using tickets.