WPGM Characters Post Type
A custom post type for creating Savage Worlds Characters
if ( ! function_exists('wpgm_characters_sw') ) {
// Register Custom Post Type
function wpgm_characters_sw() {
$labels = array(
'name' => _x( 'Characters', 'Post Type General Name', 'wpgmchar' ),
'singular_name' => _x( 'Character', 'Post Type Singular Name', 'wpgmchar' ),
'menu_name' => __( 'Characters', 'wpgmchar' ),
'parent_item_colon' => __( 'Parent Item:', 'wpgmchar' ),
'all_items' => __( 'All Characters', 'wpgmchar' ),
'view_item' => __( 'View Character', 'wpgmchar' ),
'add_new_item' => __( 'Add New Character', 'wpgmchar' ),
'add_new' => __( 'Add New', 'wpgmchar' ),
'edit_item' => __( 'Edit Character', 'wpgmchar' ),
'update_item' => __( 'Update Character', 'wpgmchar' ),
'search_items' => __( 'Search Character', 'wpgmchar' ),
'not_found' => __( 'Not found', 'wpgmchar' ),
'not_found_in_trash' => __( 'Not found in Trash', 'wpgmchar' ),
);
$rewrite = array(
'slug' => 'character',
'with_front' => true,
'pages' => true,
'feeds' => false,
);
$args = array(
'label' => __( 'wpgm_characters_sw', 'wpgmchar' ),
'description' => __( 'Savage Worlds Character Records', 'wpgmchar' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'custom-fields', ),
'taxonomies' => array( 'wpgm_char_tax', '' ),
'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' => 'universal-access',
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'post',
);
register_post_type( 'wpgm_characters_sw', $args );
}
// Hook into the 'init' action
add_action( 'init', 'wpgm_characters_sw', 0 );
}