WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 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:

Description

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 7 years ago.
Introducing pre_update_option_{option_name}

Download all attachments as: .zip

Change History (7)

johnbillion7 years ago

Introducing pre_update_option_{option_name}

comment:1 johnbillion7 years ago

  • Keywords has-patch added

Patch

comment:2 foolswisdom7 years ago

  • Milestone changed from 2.3.1 to 2.4

comment:3 Otto427 years ago

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

comment:4 Otto427 years ago

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

comment:5 westi7 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?

sanitize_option_{$option}

comment:6 johnbillion7 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.