Cleaned up unused options.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt
2004-04-24 21:21:19 +00:00
parent 530307015a
commit c226bd74b0
9 changed files with 40 additions and 55 deletions

View File

@@ -357,6 +357,16 @@ function add_option($name, $value='') {
return;
}
function delete_option($name) {
global $wpdb, $tableoptions, $tableoptiongroup_options;
// Get the ID, if no ID then return
$option_id = $wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = '$name'");
if (!$option_id) return false;
$wpdb->query("DELETE FROM $tableoptiongroup_options WHERE option_id = '$option_id'");
$wpdb->query("DELETE FROM $tableoptions WHERE option_name = '$name'");
return true;
}
function get_postdata($postid) {
global $post, $tableposts, $wpdb;