studycards-custom-post-type
if ( ! function_exists('studycards_post_type') ) {
// Register Custom Post Type
function studycards_post_type() {
$labels = array(
'name' => _x( 'StudyCards', 'Post Type General Name', 'likabra' ),
'singular_name' => _x( 'StudyCard', 'Post Type Singular Name', 'likabra' ),
'menu_name' => __( 'StudyCard', 'likabra' ),
'name_admin_bar' => __( 'StudyCard', 'likabra' ),
'parent_item_colon' => __( 'Parent StudyCard:', 'likabra' ),
'all_items' => __( 'All StudyCards', 'likabra' ),
'add_new_item' => __( 'Add New StudyCard', 'likabra' ),
'add_new' => __( 'Add New', 'likabra' ),
'new_item' => __( 'New StudyCard', 'likabra' ),
'edit_item' => __( 'Edit StudyCard', 'likabra' ),
'update_item' => __( 'Update StudyCard', 'likabra' ),
'view_item' => __( 'View StudyCard', 'likabra' ),
'search_items' => __( 'Search StudyCards', 'likabra' ),
'not_found' => __( 'Not found', 'likabra' ),
'not_found_in_trash' => __( 'Not found in Trash', 'likabra' ),
);
$args = array(
'label' => __( 'studycard', 'likabra' ),
'description' => __( 'Create quizzes and study cards', 'likabra' ),
'labels' => $labels,
'supports' => array( 'title', 'author', 'revisions', 'page-attributes', ),
'taxonomies' => array( 'sc_category', 'sc_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-welcome-learn-more',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'studycard', $args );
}
// Hook into the 'init' action
add_action( 'init', 'studycards_post_type', 0 );
}