Ticket #7233 (closed defect: fixed)

Opened 5 months ago

Last modified 5 months ago

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

Reported by: DD32 Assigned to: anonymous
Priority: normal Milestone: 2.6
Component: Administration Version: 2.6
Severity: normal Keywords: has-patch
Cc:

Description

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

7233.diff (476 bytes) - added by DD32 on 07/03/08 15:13:27.

Change History

07/03/08 15:13:27 changed by DD32

  • attachment 7233.diff added.

07/03/08 15:21:43 changed by DD32

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

07/03/08 15:51:53 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

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