Mauro777

Custom Post Type

Jan 21st, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. function create_post_type_html5()
  2. {
  3. register_taxonomy_for_object_type('category', 'loja'); // Register Taxonomies for Category
  4. register_taxonomy_for_object_type('post_tag', 'loja');
  5. register_post_type('loja', // Register Custom Post Type
  6. array(
  7. 'labels' => array(
  8. 'name' => __('Loja', 'loja'), // Rename these to suit
  9. 'singular_name' => __('Produtos', 'loja'),
  10. 'add_new' => __('Adicionar Novo Produto', 'loja'),
  11. 'add_new_item' => __('Adicionar Novo Produto', 'loja'),
  12. 'edit' => __('Editar', 'loja'),
  13. 'edit_item' => __('Editar Produto', 'loja'),
  14. 'new_item' => __('Novo Produto', 'loja'),
  15. 'view' => __('Ver Produto', 'loja'),
  16. 'view_item' => __('Ver Produto', 'loja'),
  17. 'search_items' => __('Pesquisar Produto', 'loja'),
  18. 'not_found' => __('Produto não encontrado', 'loja'),
  19. 'not_found_in_trash' => __('No produto found in Trash', 'loja')
  20. ),
  21. 'public' => true,
  22. 'hierarchical' => true, // Allows your posts to behave like Hierarchy Pages
  23. 'has_archive' => true,
  24. 'supports' => array(
  25. 'title',
  26. 'editor',
  27. 'excerpt',
  28. 'thumbnail'
  29. ), // Go to Dashboard Custom HTML5 Blank post for supports
  30. 'can_export' => true, // Allows export in Tools > Export
  31. 'taxonomies' => array(
  32. 'post_tag',
  33. 'category'
  34. ) // Add Category and Post Tags support
  35. ));
  36. }
Advertisement
Add Comment
Please, Sign In to add comment