From 6098b84f76217f31c58101f660f8b6db9b5d5898 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 26 Oct 2013 02:58:09 +0000 Subject: [PATCH] In update_option(), call the update_option hook before the DB update. Merges [25925] to the 3.7 branch. Reverses a regression from [25664]. props calin. fixes #25705. Built from https://develop.svn.wordpress.org/branches/3.7@25926 git-svn-id: http://core.svn.wordpress.org/branches/3.7@25885 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] ) ) {