Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#7233 closed defect (bug) (fixed)

add filter to update_option to allow modifications to option prior to saving

Reported by: DD32 Owned by:
Milestone: 2.6 Priority: normal
Severity: normal Version: 2.6
Component: Administration Keywords: has-patch
Focuses: Cc:


At present, Its impossible to filter an option being updated, While there is an action which can be hooked to notify the option has changed, it cannot be modified directly.

Attached is a patch which adds 'pre_update_option_<option_name>', It can be used in combination with a filter on get_option() to seemingly hide various portions of options to the rest of the WordPress admin (or theme, etc), and then add them back in if the option is modified.

Attachments (1)

7233.diff (476 bytes) - added by DD32 13 years ago.

Download all attachments as: .zip

Change History (3)

13 years ago

#1 @DD32
13 years ago

(For an example of how i'm using this: http://trac.wordpress.org/ticket/4280#comment:39 )

#2 @ryan
13 years ago

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

(In [8247]) pre_update_option_* filter from DD32. fixes #7233

Note: See TracTickets for help on using tickets.