refstudycentre / rsc_library

Moved to https://gitlab.com/rsc-devs/rsc_library
GNU General Public License v2.0
0 stars 0 forks source link

Add an option to "reset content type names" #18

Open rudolfbyker opened 7 years ago

rudolfbyker commented 7 years ago

On the admin page, /admin/structure/rsc_library, add an option to "Reset content type names". This might require something along the lines of:

module_load_include('inc', 'node', 'content_types');

// reset content types
foreach(array_keys(rsc_library_node_info()) as $name) {

  $type = node_type_load($name);
  node_type_reset($type);
  node_type_save($type);

}

// rebuild content types and menus
node_types_rebuild();
menu_rebuild();