Make WordPress Core

Opened 16 years ago

Closed 14 years ago

#4915 closed enhancement (fixed)

Deprecate get_alloptions()

Reported by: mdawaffe's profile mdawaffe Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9
Component: Optimization Keywords: has-patch commit
Focuses: Cc:


These seem to be near duplicates. One has some filters, one has some caching.

It'd be a strange plugin that used either. Can we deprecate one or the other?

Also note get_alloptions_110().

Attachments (2)

4915.patch (2.6 KB) - added by hakre 14 years ago.
4915.diff (2.7 KB) - added by nacin 14 years ago.
Deprecate for wp_load_alloptions()

Download all attachments as: .zip

Change History (18)

#1 @markjaquith
16 years ago

We have one plugin in the repository that is still using get_alloptions().

The methods that use it are doing manual manipulation of the options table, and thus would be incompatible with any WP install using an options cache... so it needs updating anyway.

I say we yank this for 2.4, and notify the author of InScript so he can update his plugin to use the options API.

#2 @DD32
16 years ago

Whats the consensus?

dump get_alloptions() as its not used?

Move to depreciated and return wp_load_alloptions()?

#3 @DD32
15 years ago

  • Keywords dev-feedback added

#4 @Denis-de-Bernardy
15 years ago

  • Keywords needs-patch added

+1 to dumping get_alloptions(). the consensus probably is needs-patch though. :-)

#5 @Denis-de-Bernardy
15 years ago

  • Keywords dev-feedback removed

#6 @hakre
14 years ago

According to the plugins homepage the plugin is only compatible up to WordPress 2.5. Therefore if it once was an argument on how to handle things it is now an argument to remove get_alloptions().

14 years ago

#7 @hakre
14 years ago

  • Keywords has-patch added; needs-patch removed
  • Summary changed from get_alloptions() v. wp_load_alloptions() to Deprecate get_alloptions()

wp_load_alloptions() is not a 100% suitable replacement so it's not suggested. No occurences wihtin the codebase. The named plugin is not for 2.8 / 2.9 therefore no prolems to patch any longer. If this gets commited early, the plugin author - if still interested - can then update against the latest version before 2.9 will be released.

#8 @hakre
14 years ago

Cross-Referencing another deprecated patch: #4968

#9 @ryan
14 years ago

  • Milestone changed from 2.9 to Future Release

#10 @Denis-de-Bernardy
14 years ago

  • Component changed from General to Optimization
  • Keywords commit added
  • Milestone changed from Future Release to 3.0
  • Type changed from defect (bug) to enhancement
  • Version set to 2.9

#11 @nacin
14 years ago

Why aren't we deprecating in favor of wp_load_alloptions()? Just because we don't want wp_getalloptions() to return wp_load_alloptions() once it is deprecated, the favored replacement should still be named.

And I'm not sure why we're completely clearing out the function instead of returning wp_load_alloptions(). It isn't an exact replacement but both end up returning the same thing.

#12 @Denis-de-Bernardy
14 years ago

It's not used at all in WP, the ticket has been opened for 2 years...

14 years ago

Deprecate for wp_load_alloptions()

#13 @nacin
14 years ago

Replying to Denis-de-Bernardy:

It's not used at all in WP, the ticket has been opened for 2 years...

Sure, but there's been no sign of deprecation. The codex and wp_load_alloptions() inline docs even denote the difference between the two, which means a plugin author might still use it, even choosing to use it over wp_load_alloptions() due to the difference. While the repository is a good guideline, not all plugins out there are on

Best I can tell, wp_load_alloptions() should be a named replacement. Generally, it seems we run down this checklist:

  1. Is the functionality and return value of the replacement (if applicable) roughly compatible? If yes, return the replacement. If no:
  1. Does the deprecated function still perform an action? If it still does something: leave it as is and only name the replacement (if applicable). If no:
  1. The function no longer provides any functionality, so strip it down to nothing. (See get_autotoggle() as an example.)

Seems the first one applies here.

#14 @Denis-de-Bernardy
14 years ago

works too, yeah.

#15 @westi
14 years ago

I am going to contact the inscript plugin author to let him know.

Also looks like the cricket-moods plugin used to use it too but doesn't anymore

#16 @westi
14 years ago

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

(In [12656]) Deprecate get_alloptions(). Fixes #4915 props nacin.

Note: See TracTickets for help on using tickets.