if ($id == 0) {
return insert_data("insert into {$CONFIG->dbprefix}entity_subtypes"
. " (type, subtype, class) values ('$type','$subtype','$class')");
- } else {
- update_subtype($type, $subtype, $class);
}
return $id;
* Register the ElggBlog class for the object/blog subtype
*/
-add_subtype('object', 'blog', 'ElggBlog');
+if (get_subtype_id('object', 'blog')) {
+ update_subtype('object', 'blog', 'ElggBlog');
+} else {
+ add_subtype('object', 'blog', 'ElggBlog');
+}
* Register the ElggWire class for the object/thewire subtype
*/
-add_subtype('object', 'thewire', 'ElggWire');
+if (get_subtype_id('object', 'thewire')) {
+ update_subtype('object', 'thewire', 'ElggWire');
+} else {
+ add_subtype('object', 'thewire', 'ElggWire');
+}