* @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 ) ) );
}
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' );
}
}
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
}
}
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;
}
}
}
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;
}