In update_option(), call the update_option hook before the DB update.
Reverses a regression from [25664]. props calin. fixes #25705 for trunk. Built from https://develop.svn.wordpress.org/trunk@25925 git-svn-id: http://core.svn.wordpress.org/trunk@25884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
73ee71a239
commit
d6b436afe8
|
@ -236,6 +236,7 @@ function update_option( $option, $value ) {
|
||||||
|
|
||||||
$serialized_value = maybe_serialize( $value );
|
$serialized_value = maybe_serialize( $value );
|
||||||
|
|
||||||
|
do_action( 'update_option', $option, $old_value, $value );
|
||||||
$result = $wpdb->update( $wpdb->options, array( 'option_value' => $serialized_value ), array( 'option_name' => $option ) );
|
$result = $wpdb->update( $wpdb->options, array( 'option_value' => $serialized_value ), array( 'option_name' => $option ) );
|
||||||
if ( ! $result )
|
if ( ! $result )
|
||||||
return false;
|
return false;
|
||||||
|
@ -246,7 +247,6 @@ function update_option( $option, $value ) {
|
||||||
wp_cache_set( 'notoptions', $notoptions, 'options' );
|
wp_cache_set( 'notoptions', $notoptions, 'options' );
|
||||||
}
|
}
|
||||||
|
|
||||||
do_action( 'update_option', $option, $old_value, $value );
|
|
||||||
if ( ! defined( 'WP_INSTALLING' ) ) {
|
if ( ! defined( 'WP_INSTALLING' ) ) {
|
||||||
$alloptions = wp_load_alloptions();
|
$alloptions = wp_load_alloptions();
|
||||||
if ( isset( $alloptions[$option] ) ) {
|
if ( isset( $alloptions[$option] ) ) {
|
||||||
|
|
Loading…
Reference in New Issue