WordPress.org

Make WordPress Core

Changeset 27815


Ignore:
Timestamp:
03/28/2014 01:56:44 PM (7 years ago)
Author:
ocean90
Message:

Introduce pre_update_option filter.

Filter is available in update_option() and allows to filter any option before its value is (maybe) serialized and updated.

see #27504.
props westonruter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/option.php

    r27719 r27815  
    255255     */
    256256    $value = apply_filters( 'pre_update_option_' . $option, $value, $old_value );
     257
     258    /**
     259     * Filter an option before its value is (maybe) serialized and updated.
     260     *
     261     * @since 3.9.0
     262     *
     263     * @param mixed  $value     The new, unserialized option value.
     264     * @param string $option    Name of the option.
     265     * @param mixed  $old_value The old option value.
     266     */
     267    $value = apply_filters( 'pre_update_option', $value, $option, $old_value );
    257268
    258269    // If the new and old values are the same, no need to update.
Note: See TracChangeset for help on using the changeset viewer.