public function testContentTypesCanBeAdded()
 {
     $types = Content_Type::getAll();
     $type_count = count($types);
     $new_type = new Content_Type('Test Type');
     $new_type->save();
     $this->assertEquals($type_count, $type_count + 1);
 }
 public function register_custom_content_types()
 {
     $content_types = Content_Type::getAll();
     foreach ($content_types as $content_type) {
         $this->register_content_type($content_type->name);
         if (property_exists($content_type, 'taxonomies')) {
             foreach ($content_type->taxonomies as $taxonomy) {
                 $this->register_taxonomy($taxonomy->name, str_replace(" ", "_", strtolower($content_type->name)));
             }
         }
     }
     $taxonomies = Taxonomy::getAll();
     foreach ($taxonomies as $taxonomy) {
         $this->register_taxonomy($taxonomy->name, 'all');
     }
 }
 private function content_types_admin_edit_taxonomy_form()
 {
     $taxonomy = Taxonomy::find((int) $_GET['id']);
     $content_types = Content_Type::getAll();
     if (!$taxonomy) {
         echo "Taxonomy not found";
         new WP_Error(404, "Taxonomy not found");
         return;
     }
     require_once plugin_dir_path(__FILE__) . 'partials/rooftop-content-types-admin-edit-taxonomy.php';
 }