Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. function wp_custom_post_type_listing()
  2. {
  3.  
  4. $labels = array(
  5. 'name' => _x('Listing', 'post type general name', 'wpprolister'),
  6. 'singular_name' => _x('Listing', 'post type singular name' ,'wpprolister'),
  7. 'add_new' => _x('Add new listing', 'l', 'wpprolister'),
  8. 'all_item' => __('All Listing', 'wpprolister'),
  9. 'add_new_item' => __('Add new listing', 'wpprolister'),
  10. 'edit_item' => __('Edit Listing', 'wpprolister'),
  11. 'new_item' => __('New Listing', 'wpprolister'),
  12. 'view_item' => __('View Listing', 'wpprolister'),
  13. 'search_item' => __('Search Listing', 'wpprolister'),
  14. 'not_found' => __('No Listing found', 'wpprolister'),
  15. 'not_found_in_trash' => __('No listings found in trash', 'wpprolister'),
  16. 'parent_item_colon' => __('Parent Listing', 'wpprolister'),
  17. );
  18.  
  19. $args_listing = array(
  20. 'labels' => $labels,
  21. 'public' => true,
  22. 'has_archive' => true,
  23. 'publicly_queryable' => true,
  24. 'query_var' => true,
  25. 'rewrite' => true,
  26. 'menu_icon' => plugins_url( 'images/list.png', __FILE__ ),
  27. 'capability_type' => 'listing',
  28. 'capabilities' => array(
  29. 'edit_post' => 'edit_listing',
  30. 'read_post' => 'read_listing',
  31. 'delete_post' => 'delete_listing',
  32. 'edit_posts' => 'edit_listings',
  33. 'edit_others_posts' => 'edit_others_listings',
  34. 'publish_posts' => 'publish_listings',
  35. 'read_private_posts' => 'read_private_listings',
  36. 'create_posts' => 'edit_listings',
  37. 'delete_posts' => 'delete_listings',
  38. 'delete_published_posts' => 'delete_published_listing',
  39. 'delete_others_posts' => 'delete_others_listings',
  40. 'edit_published_posts' => 'edit_published_listings',
  41. ),
  42. 'hierarchical' => false,
  43. 'map_meta_cap' => false,
  44. 'supports' => array(
  45. 'title',
  46. 'editor',
  47. 'expert',
  48. 'thumbnail',
  49. 'comments',
  50. 'page-attributes',
  51. ),
  52. 'taxonomies' => array('listing_categories', 'locations', 'amenities', 'post_tag'),
  53. 'menu_position' => 2,
  54. 'exclude_from_search' => false,
  55. );
  56. register_post_type('l', $args_listing);
  57. }
  58.  
  59. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  60. /*
  61. Template Name: Full Width
  62. Template Post Type: post, page , l
  63. */
  64. get_header();
  65. get_template_part( '/wpprolister-templates/content', 'titlebar'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement