Make WordPress Core

Opened 11 years ago

Closed 9 years ago

#33958 closed enhancement (fixed)

All Options Filter

Reported by: sebastian.pisula Owned by: pento
Priority: normal Milestone: 4.9
Component: Options, Meta APIs Version:
Severity: normal Keywords: has-patch has-unit-tests
Cc: Focuses: performance

Description

Add filter for all options

Attachments (2)

33958.patch (491 bytes ) - added by sebastian.pisula 11 years ago.
33958.1.patch (4.7 KB ) - added by keesiemeijer 10 years ago.
Add filters and unit tests

Download all attachments as: .zip

Change History (19)

#1 @sc0ttkclark
11 years ago

Can you describe your use-case? Usually when a patch is submitted, we require an explanation of how you would use it and an example of why it's needed.

#2 @johnbillion
11 years ago

  • Keywords reporter-feedback added

#3 @netweb
11 years ago

This looks like a duplicate of your previous ticket #33858 @sebastian.pisula, how is this ticket different?

#4 @johnbillion
11 years ago

#34337 was marked as a duplicate.

#5 @johnbillion
11 years ago

  • Keywords close added

@sebastian.pisula Can you provide some more info about your use-case and why this filter is needed? Thanks.

#6 @sebastian.pisula
11 years ago

for example ACF Pro, options page. when I use get_field('field', 'options'); then I send request to MySQL for each get_field. I will be can use filter to merge Options and I will be use get_option to get Options From ACF Options Page.

#7 @johnbillion
11 years ago

#34337 was marked as a duplicate.

This ticket was mentioned in Slack in #core by sebastian.pisula. View the logs.


11 years ago

#9 @pento
10 years ago

  • Focuses performance added
  • Keywords has-patch needs-refresh needs-unit-tests added; reporter-feedback close removed
  • Milestone Awaiting Review4.8
  • Owner set to pento
  • Status newassigned

A similar filter is used on WP.com, before the wp_cache_add() in wp_load_alloptions(), to ensure that $alloptions isn't too big for the cache to handle.

A pre_cache_alloptions along with the proposed alloptions filter would be valuable.

@keesiemeijer
10 years ago

Add filters and unit tests

#10 @keesiemeijer
10 years ago

  • Keywords has-unit-tests added; needs-refresh needs-unit-tests removed

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


9 years ago

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


9 years ago

#13 @jbpaul17
9 years ago

  • Milestone 4.84.8.1

Punting to 4.8.1 per today's bug scrub.

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


9 years ago

#15 @pento
9 years ago

  • Milestone 4.8.14.9

Punting to 4.9.

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


9 years ago

#17 @pento
9 years ago

  • Resolutionfixed
  • Status assignedclosed

In 41627:

Options: Add new alloptions and pre_cache_alloptions filters.

pre_cache_alloptions is run before the alloptions array is inserted into the cache, and is valuable for sanity checking the options, particularly if your caching scheme has size limitations.

alloptions is run before returning the alloptions array, and is useful for when you have extra information that alloptions should return.

Props sebastian.pisula, keesiemeijer.
Fixes #33958.

Note: See TracTickets for help on using tickets.