Ticket #2524 (closed defect (bug): fixed)

Opened 6 years ago

Last modified 6 years ago

$table* global variables sheduled for deletion

Reported by: markjaquith Owned by: markjaquith
Priority: lowest Milestone: 2.1
Component: Administration Version: 2.0.1
Severity: trivial Keywords:
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

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

Change History

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

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

I'm making a patch for $table_prefix now

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.

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.

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

comment:7   matt6 years ago

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

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