function.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. function wpc_cpt() {
  3. /* Property */
  4. $labels = array(
  5. 'name' => _x('Properties', 'Post Type General Name', 'la_mine'),
  6. 'singular_name' => _x('Property', 'Post Type Singular Name', 'la_mine'),
  7. 'menu_name' => __('Properties', 'la_mine'),
  8. 'name_admin_bar' => __('Properties', 'la_mine'),
  9. 'parent_item_colon' => __('Parent Item:', 'la_mine'),
  10. 'all_items' => __('All Items', 'la_mine'),
  11. 'add_new_item' => __('Add New Item', 'la_mine'),
  12. 'add_new' => __('Add New', 'la_mine'),
  13. 'new_item' => __('New Item', 'la_mine' ),
  14. 'edit_item' => __('Edit Item', 'la_mine'),
  15. 'update_item' => __('Update Item', 'la_mine'),
  16. 'view_item' => __('View Item', 'la_mine'),
  17. 'search_items' => __('Search Item', 'la_mine'),
  18. 'not_found' => __('Not found', 'la_mine'),
  19. 'not_found_in_trash' => __('Not found in Trash', 'la_mine'),
  20. );
  21. $rewrite = array(
  22. 'slug' => _x('property', 'property', 'la_mine'),
  23. 'with_front' => true,
  24. 'pages' => true,
  25. 'feeds' => false,
  26. );
  27. $args = array(
  28. 'label' => __('property', 'la_mine'),
  29. 'description' => __('Properties', 'la_mine'),
  30. 'labels' => $labels,
  31. 'supports' => array('title', 'editor', 'thumbnail', 'comments', 'revisions', 'custom-fields'),
  32. 'taxonomies' => array('property_type'),
  33. 'hierarchical' => false,
  34. 'public' => true,
  35. 'show_ui' => true,
  36. 'show_in_menu' => true,
  37. 'menu_position' => 5,
  38. 'menu_icon' => 'dashicons-admin-home',
  39. 'show_in_admin_bar' => true,
  40. 'show_in_nav_menus' => true,
  41. 'can_export' => true,
  42. 'has_archive' => false,
  43. 'exclude_from_search' => false,
  44. 'publicly_queryable' => true,
  45. 'query_var' => 'property',
  46. 'rewrite' => $rewrite,
  47. 'capability_type' => 'page',
  48. );
  49. register_post_type('property', $args);
  50. }
  51. add_action('init', 'wpc_cpt', 10);
  52. ?>