Advertisement
keha76

CPT Products

Sep 21st, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.37 KB | None | 0 0
  1. $labels = array(
  2.     'name'               => _x( 'Products', 'post type general name', 'dp-marketplace' ),
  3.     'singular_name'      => _x( 'Product', 'post type singular name', 'dp-marketplace' ),
  4.     'add_new'            => _x( 'Add Product', 'Product', 'dp-marketplace' ),
  5.     'add_new_item'       => __( 'Create New Product', 'dp-marketplace' ),
  6.     'edit_item'          => __( 'Edit Product', 'dp-marketplace' ),
  7.     'new_item'           => __( 'New Product', 'dp-marketplace' ),
  8.     'all_items'          => __( 'All Products', 'dp-marketplace' ),
  9.     'view_item'          => __( 'View Product', 'dp-marketplace' ),
  10.     'search_items'       => __( 'Search Products', 'dp-marketplace' ),
  11.     'not_found'          => __( 'No products found', 'dp-marketplace' ),
  12.     'not_found_in_trash' => __( 'No products found in Trash', 'dp-marketplace' ),
  13.     'parent_item_colon'  => '',
  14.     'menu_name'          => __( 'Products', 'dp-marketplace' )
  15. );
  16.  
  17. $args = array(
  18.     'labels'               => $labels,
  19.     'description'          => __( 'Custom user uploads for sale.', 'dp-marketplace' ),
  20.     'public'               => TRUE,
  21.     'exclude_from_search'  => FALSE,
  22.     'publicly_queryable'   => TRUE,
  23.     'show_ui'              => TRUE,
  24.     'show_in_nav_menus'    => TRUE,
  25.     'show_in_menu'         => TRUE,
  26.     'show_in_admin_bar'    => TRUE,
  27.     'menu_position'        => 1976,
  28.     'capability_type'      => 'product',
  29.     'capabilities'         => array(
  30.         'edit_post'           => 'edit_product',
  31.         'edit_posts'          => 'edit_products',
  32.         'edit_others_posts'   => 'edit_others_products',
  33.         'delete_post'         => 'delete_product',
  34.         'delete_posts'        => 'delete_products',
  35.         'delete_others_posts' => 'delete_others_products',
  36.         'publish_posts'       => 'publish_products',
  37.         'read_post'           => 'read_product',
  38.         'read_private_posts'  => 'read_private_products'
  39.     ),
  40.     'hierarchical'         => FALSE, // Does not list posts in admin if set to true
  41.     'supports'             => array( 'title', 'editor', 'thumbnail', 'excerpt', 'page-attributes' ),
  42.     'register_meta_box_cb' => '',
  43.     'taxonomies'           => array( 'tags' ),
  44.     'has_archive'          => TRUE,
  45.     'rewrite'              => array(
  46.         'slug'       => 'product',
  47.         'with_front' => TRUE,
  48.         'feeds'      => TRUE,
  49.         'pages'      => TRUE
  50.     ),
  51.     'query_var'            => TRUE,
  52.     'can_export'           => TRUE,
  53.     '_builtin'             => false
  54. );
  55.  
  56. register_post_type( 'product', $args );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement