]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/option.php
Wordpress 3.6
[autoinstalls/wordpress.git] / wp-includes / option.php
index 722d1f30d4992c0dc128eeb13eeb6ddef1bcd8a7..3df89c2c25cba932af7a3df7dc1e400203f79c23 100644 (file)
@@ -104,8 +104,7 @@ function get_option( $option, $default = false ) {
  * @param string $option Option name.
  */
 function wp_protect_special_option( $option ) {
-       $protected = array( 'alloptions', 'notoptions' );
-       if ( in_array( $option, $protected ) )
+       if ( 'alloptions' === $option || 'notoptions' === $option )
                wp_die( sprintf( __( '%s is a protected WP option and may not be modified' ), esc_html( $option ) ) );
 }
 
@@ -248,10 +247,10 @@ function update_option( $option, $newvalue ) {
        if ( ! defined( 'WP_INSTALLING' ) ) {
                $alloptions = wp_load_alloptions();
                if ( isset( $alloptions[$option] ) ) {
-                       $alloptions[$option] = $_newvalue;
+                       $alloptions[$option] = $newvalue;
                        wp_cache_set( 'alloptions', $alloptions, 'options' );
                } else {
-                       wp_cache_set( $option, $_newvalue, 'options' );
+                       wp_cache_set( $option, $newvalue, 'options' );
                }
        }
 
@@ -360,6 +359,10 @@ function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' )
 function delete_option( $option ) {
        global $wpdb;
 
+       $option = trim( $option );
+       if ( empty( $option ) )
+               return false;
+
        wp_protect_special_option( $option );
 
        // Get the ID, if no ID then return
@@ -512,8 +515,8 @@ function set_transient( $transient, $value, $expiration = 0 ) {
                }
        }
        if ( $result ) {
-               do_action( 'set_transient_' . $transient );
-               do_action( 'setted_transient', $transient );
+               do_action( 'set_transient_' . $transient, $value, $expiration );
+               do_action( 'setted_transient', $transient, $value, $expiration );
        }
        return $result;
 }
@@ -1049,8 +1052,8 @@ function set_site_transient( $transient, $value, $expiration = 0 ) {
                }
        }
        if ( $result ) {
-               do_action( 'set_site_transient_' . $transient );
-               do_action( 'setted_site_transient', $transient );
+               do_action( 'set_site_transient_' . $transient, $value, $expiration );
+               do_action( 'setted_site_transient', $transient, $value, $expiration );
        }
        return $result;
 }