From d6b436afe854d431de9daa6ce1a02c9f8c1a0ab6 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 26 Oct 2013 02:57:09 +0000 Subject: [PATCH] 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 --- wp-includes/option.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/option.php b/wp-includes/option.php index cee2451fde..6f7a3a6059 100644 --- a/wp-includes/option.php +++ b/wp-includes/option.php @@ -236,6 +236,7 @@ function update_option( $option, $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 ) ); if ( ! $result ) return false; @@ -246,7 +247,6 @@ function update_option( $option, $value ) { wp_cache_set( 'notoptions', $notoptions, 'options' ); } - do_action( 'update_option', $option, $old_value, $value ); if ( ! defined( 'WP_INSTALLING' ) ) { $alloptions = wp_load_alloptions(); if ( isset( $alloptions[$option] ) ) {