Ticket #2524 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

$table* global variables sheduled for deletion

Reported by: markjaquith Assigned to: 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 (8.0 kB) - added by markjaquith on 03/02/06 11:22:20.
2524.diff (0.8 kB) - added by robmiller on 07/04/06 18:22:12.

Change History

03/02/06 11:00:27 changed by ryan

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.

03/02/06 11:06:37 changed by markjaquith

  • 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

03/02/06 11:22:20 changed by markjaquith

  • attachment table_prefix.diff added.

03/03/06 11:14:35 changed by davidhouse

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.

03/03/06 17:19:20 changed by ryan

03/04/06 00:49:55 changed by markjaquith

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.

07/04/06 18:22:12 changed by robmiller

  • attachment 2524.diff added.

07/04/06 18:22:38 changed by robmiller

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

07/04/06 18:28:09 changed by matt

  • 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