Exemple #1
0
  public function delete($args = array()) {
    
    $r = wp_parse_args($args, array(
      "existing_terms" => "leave",
      "existing_terms_reassign_taxonomy" => "",
      "field_sets" => "keep",
      "field_data" => "keep"
    ));
    
    $existing_action = $r["existing_terms"];
        
    if ($existing_action == "delete") {
      $this->delete_terms();
    } else if ($existing_action == "reassign") {
      $this->reassign_terms($r["existing_terms_reassign_taxonomy"]);
    }
    
    if ($existing_action != "reassign" && $r["field_sets"] == "delete") {
      $this->delete_field_sets();
    }

    if (isset($r["field_data"]) && $r["field_data"] == "delete") {
      $tax->delete_meta();
    }
    
    parent::delete();
  }
Exemple #2
0
 public function delete($args = array()) {
   
   $r = wp_parse_args($args, array(
     "posts" => "leave",
     "posts_reassign_type" => "",
     "field_sets" => "keep",
     "field_data" => "keep"
   ));
   
   $this->unlink_taxonomies();
   
   $posts_action = $r["posts"];
   
   if ($posts_action == "delete") {
     $this->delete_posts();
   } else if ($posts_action == "trash") {
     $this->trash_posts();
   } else if ($posts_action == "reassign") {
     $this->reassign_posts($r["posts_reassign_type"], $r["field_sets"]);
   } 
   
   if ($posts_action != "reassign" && $r["field_sets"] == "delete") {
     $this->delete_field_sets();
   }
   
   if (isset($_POST["field_data"]) && $r["field_data"] == "delete") {
     $this->delete_meta();
   }
   
   parent::delete();
 }
Exemple #3
0
 public function delete() {
   global $wpdb;
   $wpdb->query("DELETE FROM ".MPU::table("fields")." WHERE field_set_id = ".$this->id);
   parent::delete();
 }