Last active
April 9, 2021 20:46
-
-
Save dragipostolovski/12fa7d4e2f56e9447cc82b7f99a27c4b to your computer and use it in GitHub Desktop.
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
<?php | |
function pe_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' => __( 'Parent product' ), | |
'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', 'pe_custom_post_product' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment