pre_update_option_{$option} WordPress Filter Hook

The pre_update_option_{$option} hook is called before an option is updated in the database. The hook is passed the new value of the option, the old value of the option, and the option name.

apply_filters( "pre_update_option_{$option}", mixed $value, mixed $old_value, string $option ) #

Filters a specific option before its value is (maybe) serialized and updated.


Description

The dynamic portion of the hook name, $option, refers to the option name.


Top ↑

Parameters

$value

(mixed)The new, unserialized option value.

$old_value

(mixed)The old option value.

$option

(string)Option name.


Top ↑

More Information

This filter is applied to the option value before being saved to the database; this allows the overriding value to be stored. To use this filter, you will need to add filters for specific options names, such as “pre_update_option_foo” to filter the option “foo“.


Top ↑

Source

File: wp-includes/option.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.0The $option parameter was added.
2.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More