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

git-svn-id: https://develop.svn.wordpress.org/trunk@11883 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2009-08-26 22:46:33 +00:00
parent d43ed9f448
commit 9ba99f344c
4 changed files with 38 additions and 8 deletions
+2 -2
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'" );