Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#5208 closed enhancement (wontfix)

New filter: pre_update_option_{option-name}

Reported by: johnbillion Owned by: westi
Milestone: Priority: normal
Severity: minor Version: 2.3
Component: General Keywords: update_option, pre_update_option, hook, filter, has-patch reporter-feedback
Focuses: Cc:


The update_option function has an action hook on it but not a filter. We like filters.

Introducing pre_update_option_{option-name}. This will mainly serve as a method for plugins to filter their own options before they get saved to the database (user input sanitising, etc).

Attachments (1)

5208.diff (432 bytes) - added by johnbillion 11 years ago.
Introducing pre_update_option_{option_name}

Download all attachments as: .zip

Change History (7)

11 years ago

Introducing pre_update_option_{option_name}

#1 @johnbillion
11 years ago

  • Keywords has-patch added


#2 @foolswisdom
11 years ago

  • Milestone changed from 2.3.1 to 2.4

#3 @Otto42
11 years ago

May as well add a pre_add_option_$option filter as well...

#4 @Otto42
11 years ago

Argh... Just saw #5209. Dangit, you beat me to the punch! ;)

#5 @westi
11 years ago

  • Keywords reporter-feedback added
  • Owner changed from anonymous to westi
  • Status changed from new to assigned

What does this give you that the filter in sanitize_option doesn't?


#6 @johnbillion
11 years ago

  • Milestone 2.4 deleted
  • Resolution set to wontfix
  • Status changed from assigned to closed

I never even realised there was a filter on sanitize_option. Hmm, this means this filter is superfluous.

Closing as RTFM.

Note: See TracTickets for help on using tickets.