<?php
/*
-* Plugin Name: Theatre Pre-Sale
-* Plugin URI: https://johnzone.org/vvk
-* Description: Keep track of sold tickets
-* Author: John Janus
-* License: GPL3
-* License URI: https://gnu.org/licenses/gpl
-*/
-defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
+ * Plugin Name: Theatre Pre-Sale
+ * Plugin URI: https://johnzone.org/vvk
+ * Description: Keep track of sold tickets
+ * Author: John Janus
+ * License: GPL3
+ * License URI: https://gnu.org/licenses/gpl3
+ */
+defined ( 'ABSPATH' ) or die ( 'No script kiddies please!' );
-//custom post type for events
-
-add_action('init', 'presale_create_post_type');
+// custom post type for events
+add_action ( 'init', 'presale_create_post_type' );
function presale_create_post_type() {
- register_post_type('presale_show', array(
- 'labels' => array(
- 'name' => __( 'Shows' ),
- 'singular_name' => __( 'Show' ),
- 'name_admin_bar' => __( 'Show' )
- ),
- 'public' => true,
- 'has_archive' => true,
- 'public' => true,
- 'menu_position' => 20
- )
- );
+ $singular = __ ( 'Show' );
+ $plural = __ ( 'Shows' );
+ register_post_type ( 'presale_show', array (
+ 'labels' => array (
+ 'name' => $plural,
+ 'singular_name' => $singular,
+ 'name_admin_bar' => $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 ' ) . $singular,
+ 'not_found' => __ ( 'No ' ) . $plural . __ ( ' found' ),
+ 'not_found_in_trash' => __ ( 'No ' ) . $plural . __ ( ' found in Trash' )
+ ),
+ 'public' => true,
+ 'publicly_queryable' => true,
+ 'show_in_nav_menus' => true,
+ 'show_ui' => true,
+ 'show_in_menu' => true,
+ 'show_in_admin_bar' => true,
+ 'menu_icon' => 'dashicons-tickets-alt',
+ 'can_export' => true,
+ 'delete_withuser' => false,
+ 'hierarchical' => false,
+ 'has_archive' => true,
+ 'query_var' => true,
+ 'capability_type' => 'post',
+ 'menu_position' => 20,
+ 'map_meta_cap' => true,
+ 'rewrite' => array (
+ 'slug' => __ ( 'shows' ),
+ 'with_front' => true,
+ 'pages' => true,
+ 'feeds' => true
+ ),
+ 'supports' => array (
+ 'author',
+ 'editor',
+ 'title',
+ 'custom-fields',
+ 'thumnails'
+ )
+ ) );
+}
+
+add_action ( 'init', 'presale_register_taxonomy' );
+function presale_register_taxonomy() {
+ $plural = __ ( 'Locations' );
+ $singular = __ ( 'Location' );
+ register_taxonomy ( 'location', 'presale_show', array (
+ 'hierarchical' => false,
+ 'labels' => array (
+ 'name' => $plural,
+ 'singular_name' => $singular,
+ 'search_items' => __ ( 'Search ' ) . $plural,
+ 'popular_items' => __ ( 'Popular ' ) . $plural,
+ 'all_items' => __ ( 'All ' ) . $plural,
+ 'parent_item' => null,
+ 'parent_item_column' => null,
+ 'edit_item' => __ ( 'Edit ' ) . $singular,
+ 'update_item' => __ ( 'Update ' ) . $singular,
+ 'add_new_item' => __ ( 'Add New ' ) . $singular,
+ 'new_item_name' => __ ( 'New ' ) . $singular . __ ( ' Name' ),
+ 'seperate_items_with_commas' => __ ( 'Seperate ' ) . $plural . __ ( ' with commas' ),
+ 'add_or_remove_items' => __ ( 'Add or Remove ' ) . $plural,
+ 'choose_from_most_used' => __ ( 'Choose from most used ' ) . $plural,
+ 'not_found' => __ ( 'No ' ) . $plural . __ ( ' found' ),
+ 'menu_name' => $plural
+ ),
+ 'show_ui' => true,
+ 'show_admin_column' => true,
+ 'update_count_callback' => '_update_post_term_count',
+ 'query_var' => true,
+ 'rewrite' => array (
+ 'slug' => $singular
+ )
+ ) );
}
?>