Created
December 16, 2012 17:39
-
-
Save adrianthedev/4310049 to your computer and use it in GitHub Desktop.
Custom post type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_custom_post_product() { | |
$labels = array( | |
'name' => _x( 'Products', 'post type general name' ), | |
'singular_name' => _x( 'Product', 'post type singular name' ), | |
'add_new' => _x( 'Add New', 'book' ), | |
'add_new_item' => __( 'Add New Product' ), | |
'edit_item' => __( 'Edit Product' ), | |
'new_item' => __( 'New Product' ), | |
'all_items' => __( 'All Products' ), | |
'view_item' => __( 'View Product' ), | |
'search_items' => __( 'Search Products' ), | |
'not_found' => __( 'No products found' ), | |
'not_found_in_trash' => __( 'No products found in the Trash' ), | |
'parent_item_colon' => '', | |
'menu_name' => 'Products' | |
); | |
$args = array( | |
'labels' => $labels, | |
'description' => 'Holds our products and product specific data', | |
'public' => true, | |
'menu_position' => 5, | |
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ), | |
'has_archive' => true, | |
); | |
register_post_type( 'product', $args ); | |
} | |
add_action( 'init', 'my_custom_post_product' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment