Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function dbwp_register_post_type() {
- $singular = 'Upcoming Game';
- $plural = 'Upcoming Games';
- $labels = array(
- 'name' => $plural,
- 'singular' => $singular,
- 'add_name' => 'Add New',
- 'add_new_item' => 'Add New ' . $singular,
- 'edit' => 'Edit',
- 'edit_item' => 'Edit ' . $singular,
- 'new_item' => 'New ' . $singular,
- 'view' => 'View ' . $singular,
- 'view_item' => 'View ' . $singular,
- 'search_term' => 'Search ' . $plural,
- 'parent' => 'Parent ' . $singular,
- 'not_found' => 'No ' . $plural . ' found',
- 'not_found_in_trash' => 'No ' . $plural . ' in Trash'
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'exclude_from_search' => false,
- 'show_in_nav_menus' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_admin_bar' => true,
- 'menu_position' => 6,
- 'menu_icon' => 'dashicons-megaphone',
- 'can_export' => true,
- 'delete_with_user' => false,
- 'hierarchical' => false,
- 'has_archive' => true,
- 'query_var' => true,
- 'capability_type' => 'post',
- 'map_meta_cap' => true,
- // 'capabilities' => array(),
- 'rewrite' => array(
- 'slug' => $slug,
- 'with_front' => true,
- 'pages' => true,
- 'feeds' => false,
- ),
- 'supports' => array(
- 'title',
- 'editor',
- 'author',
- 'thumbnail',
- 'custom-fields'
- )
- );
- register_post_type('upcoming-games', $args);
- }
- add_action('init', 'dbwp_register_post_type');
- function dbwp_register_category_taxonomy() {
- $plural = 'Consoles';
- $single = 'Console';
- $labels = array(
- 'name' => $plural,
- 'singular_name' => $singular,
- 'search_items' => 'Search ' . $plural,
- 'popular_items' => 'Popular ' . $plural,
- 'all_items' => 'All ' . $plural,
- 'parent_item' => null,
- 'parent_item_colon' => null,
- 'edit_item' => 'Edit ' . $singular,
- 'update_item' => 'Update ' . $singular,
- 'add_new_item' => 'Add New ' . $singular,
- 'new_item_name' => 'New ' . $singular . ' Name',
- 'separate_items_with_commas'=> 'Separate ' . $plural . ' with commas',
- 'add_or_remove_items' => 'Add or remove ' . $plural,
- 'choose_from_most_used' => 'Choose from the most used ' . $plural,
- 'not_found' => 'No ' . $plural . ' found.',
- 'menu_name' => $plural,
- );
- $args = array(
- 'hierarchical' => true,
- 'labels' => $labels,
- 'show_ui' => true,
- 'show_admin_column' => true,
- 'update_count_callback' => '_update_post_term_count',
- 'query var' => true,
- 'rewrite' => array( 'slug' => 'consoles'
- )
- );
- register_taxonomy('consoles', 'upcoming-games', $args);
- }
- add_action('init', 'dbwp_register_category_taxonomy');
- function dbwp_register_tag_taxonomy() {
- $plural = 'Genres';
- $single = 'Genre';
- $labels = array(
- 'name' => $plural,
- 'singular_name' => $singular,
- 'search_items' => 'Search ' . $plural,
- 'popular_items' => 'Popular ' . $plural,
- 'all_items' => 'All ' . $plural,
- 'parent_item' => null,
- 'parent_item_colon' => null,
- 'edit_item' => 'Edit ' . $singular,
- 'update_item' => 'Update ' . $singular,
- 'add_new_item' => 'Add New ' . $singular,
- 'new_item_name' => 'New ' . $singular . ' Name',
- 'separate_items_with_commas'=> 'Separate ' . $plural . ' with commas',
- 'add_or_remove_items' => 'Add or remove ' . $plural,
- 'choose_from_most_used' => 'Choose from the most used ' . $plural,
- 'not_found' => 'No ' . $plural . ' found.',
- 'menu_name' => $plural,
- );
- $args = array(
- 'hierarchical' => false,
- 'labels' => $labels,
- 'show_ui' => true,
- 'show_admin_column' => true,
- 'update_count_callback' => '_update_post_term_count',
- 'query var' => true,
- 'rewrite' => array( 'slug' => 'genres'
- )
- );
- register_taxonomy('genres', 'upcoming-games', $args);
- }
- add_action('init', 'dbwp_register_tag_taxonomy');
Add Comment
Please, Sign In to add comment