Skip to content

Instantly share code, notes, and snippets.

@wichaksono
Last active September 7, 2016 23:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wichaksono/aa6a55cf51b76d815dcd51855bdad575 to your computer and use it in GitHub Desktop.
Save wichaksono/aa6a55cf51b76d815dcd51855bdad575 to your computer and use it in GitHub Desktop.
<?php
/**
* tutorial membuat semi toko online
* @package https://www.onphpid.com/category/membuat-semi-toko-online
* @see : https://www.onphpid.com/langkah-awal-membuat-semi-toko-online-dengan-wordpress.html
*/
function onphpid_post_type()
{
// add post-type
register_post_type(
'onphpid_products',
array(
'labels' => array(
'name' => __('Products', 'semi-toko-online'),
'singular_name' => __('Product', 'semi-toko-online'),
'add_new' => _x( 'Add New', 'product', 'semi-toko-online' ),
'add_new_item' => __( 'Add New Product', 'semi-toko-online' ),
'new_item' => __( 'New Product', 'semi-toko-online' ),
'edit_item' => __( 'Edit Product', 'semi-toko-online' ),
'view_item' => __( 'View Product', 'semi-toko-online' ),
'all_items' => __( 'All Products', 'semi-toko-online' ),
),
'public' => true,
'supports' => array('title', 'editor', 'thumbnail'),
'has_archive' => true,
'rewrite' => array('slug'=>'product'),
'menu_position' => 100,
'menu_icon' => 'dashicons-cart'
)
);
}
add_action('init', 'onphpid_post_type');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment