WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 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:

Description

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 8 years ago.
2524.diff (847 bytes) - added by robmiller 8 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 ryan8 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.

comment:2 markjaquith8 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

markjaquith8 years ago

comment:3 davidhouse8 years ago

Pros:

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

Cons:

  • 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.

comment:5 markjaquith8 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.

robmiller8 years ago

comment:6 robmiller8 years ago

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

comment:7 matt8 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.