Make WordPress Core


Ignore:
Timestamp:
04/24/2004 09:21:19 PM (21 years ago)
Author:
saxmatt
Message:

Cleaned up unused options.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r1146 r1148  
    356356    }
    357357    return;
     358}
     359
     360function delete_option($name) {
     361    global $wpdb, $tableoptions, $tableoptiongroup_options;
     362    // Get the ID, if no ID then return
     363    $option_id = $wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = '$name'");
     364    if (!$option_id) return false;
     365    $wpdb->query("DELETE FROM $tableoptiongroup_options WHERE option_id = '$option_id'");
     366    $wpdb->query("DELETE FROM $tableoptions WHERE option_name = '$name'");
     367    return true;
    358368}
    359369
Note: See TracChangeset for help on using the changeset viewer.