CPT Recipe
if ( ! function_exists('wpbscook_register_recipe') ) {
// Register Custom Post Type
function wpbscook_register_recipe() {
$labels = array(
'name' => _x( 'Recipes', 'Post Type General Name', 'wpbscook' ),
'singular_name' => _x( 'Recipe', 'Post Type Singular Name', 'wpbscook' ),
'menu_name' => __( 'Recipes', 'wpbscook' ),
'parent_item_colon' => __( 'Parent recipe:', 'wpbscook' ),
'all_items' => __( 'All recipes', 'wpbscook' ),
'view_item' => __( 'View recipe', 'wpbscook' ),
'add_new_item' => __( 'Add new recipe', 'wpbscook' ),
'add_new' => __( 'Add new', 'wpbscook' ),
'edit_item' => __( 'Edit recipe', 'wpbscook' ),
'update_item' => __( 'Update recipe', 'wpbscook' ),
'search_items' => __( 'Search recipe', 'wpbscook' ),
'not_found' => __( 'Not found', 'wpbscook' ),
'not_found_in_trash' => __( 'Not found in trash', 'wpbscook' ),
);
$args = array(
'label' => __( 'wpbscook_recipe', 'wpbscook' ),
'description' => __( 'A recipe custom post type', 'wpbscook' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', ),
'taxonomies' => array( 'wpbscook_category', 'wpbscook_ingredient', 'wpbscook_cuisine', 'wpbscook_tags' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-store',
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
);
register_post_type( 'wpbscook_recipe', $args );
}
// Hook into the 'init' action
add_action( 'init', 'wpbscook_register_recipe', 0 );
}