Make option_name the primary key for the options table. Props Denis-de-Bernardy. fixes #2699

git-svn-id: http://svn.automattic.com/wordpress/trunk@11883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2009-08-26 22:46:33 +00:00
parent 476a750167
commit 4064e1cb6c
4 changed files with 38 additions and 8 deletions

View File

@@ -621,8 +621,8 @@ function delete_option( $name ) {
// Get the ID, if no ID then return
// expected_slashed ($name)
$option = $wpdb->get_row( "SELECT option_id, autoload FROM $wpdb->options WHERE option_name = '$name'" );
if ( is_null($option) || !$option->option_id )
$option = $wpdb->get_row( "SELECT autoload FROM $wpdb->options WHERE option_name = '$name'" );
if ( is_null($option) )
return false;
// expected_slashed ($name)
$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name = '$name'" );