Skip to content

Instantly share code, notes, and snippets.

@webkupas
Created May 12, 2015 01:40
Show Gist options
  • Select an option

  • Save webkupas/f712a2a4896043fc9dca to your computer and use it in GitHub Desktop.

Select an option

Save webkupas/f712a2a4896043fc9dca to your computer and use it in GitHub Desktop.
WP Add Custom Post Type
</php
/* register hyshel post type*/
function my_post_type_hyshell() {
register_post_type( 'hyshell',
array(
'labels' => array(
'name' => 'hyShells',
'singular_name' => 'hyShell',
'add_new' => 'Add New',
'add_new_item' => 'Add New hyShell',
'edit' => 'Edit',
'edit_item' => 'Edit hyShell',
'new_item' => 'New hyShell',
'view' => 'View',
'view_item' => 'View hyShell',
'search_items' => 'Search hyShells',
'not_found' => 'No hyShells found',
'not_found_in_trash' => 'No hyShells found in Trash',
'parent' => 'Parent hyShell'
),
'public' => true,
'show_ui' => true,
'show_in_nav_menus' => false,
'menu_position' => 5,
'menu_icon' => 'dashicons-cart',
'rewrite' => array(
'slug' => 'recipes-view',
'with_front' => FALSE,
),
'supports' => array(
'title',
'thumbnail',
'editor'
)
)
);
}
add_action('init', 'my_post_type_hyshell');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment