create_node_types.php

  1. 8.0.x tests/resources/create_node_types.php
  2. 6.x tests/resources/create_node_types.php
  3. 7.x tests/resources/create_node_types.php
  4. 5.x tests/resources/create_node_types.php
  5. master tests/resources/create_node_types.php

File

tests/resources/create_node_types.php
View source
  1. <?php
  2. $types = array(
  3. array(
  4. 'type' => 'page',
  5. 'name' => 'Basic page',
  6. 'base' => 'node_content',
  7. 'description' => 'Use <em>basic pages</em> for your static content, such as an \'About us\' page.',
  8. 'custom' => 1,
  9. 'modified' => 1,
  10. 'locked' => 0,
  11. ),
  12. array(
  13. 'type' => 'article',
  14. 'name' => 'Article',
  15. 'base' => 'node_content',
  16. 'description' => 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.',
  17. 'custom' => 1,
  18. 'modified' => 1,
  19. 'locked' => 0,
  20. ),
  21. );
  22. foreach ($types as $type) {
  23. $type = node_type_set_defaults($type);
  24. node_type_save($type);
  25. node_add_body_field($type);
  26. }