slimndap/wp-theatre

List of post_types, post_meta, taxonomies and term_meta

Opened this issue · 4 comments

To better understand the inner workings of the plugin (and its extensions) I'd like to have an overview about registered data AND their relations altogether, in particular:

Post types

  • Productions: wp_theatre_prod
  • Events: wp_theatre_event
  • Season: wp_theatre_season

Registered here.

Taxonomies

No taxonomies are registered. Productions us the existing 'category' and 'post_tag' taxonomies.

Defined here.

Post meta

  • Most meta fields for events are defined here.
  • All other meta fields are just being used whenever thet are needed and are scattered all over the code.
  • Events are linked to a production through a wp_theatre_prod meta field, that contains the ID of the production.
  • Productions are, optionally, linked to a season through a wp_theatre_season meta field.
  • Productions and events have a _wpt_order meta field that is used to display them in the corrected order or to select them by a date range.

What is the reason for assigning the identical ˋlabelˋ arguments for the event and production post_types?

$post_type_args = array(
'labels' => array(
'name' => __( 'Events','theatre'),
'singular_name' => __( 'Event','theatre'),
'add_new' => _x('Add New', 'production','theatre'),
'new_item' => __('New event','theatre'),
'add_new_item' => __('Add new event','theatre'),
'edit_item' => __('Edit event','theatre')
),
'public' => true,
'has_archive' => true,
'show_in_menu' => false,
'show_in_admin_bar' => true,
'supports' => array('title', 'editor', 'excerpt', 'thumbnail','comments'),
'taxonomies' => array('category','post_tag'),
'rewrite' => array(
'slug' => $wp_theatre->production_permalink->get_base(),
'with_front' => false,
'feeds' => true
),
);
/**
* Filter the post type args for productions.
*
* @since 0.15.9
* @param $post_type_args The post type args.
*/
$post_type_args = apply_filters('wpt/setup/post_type/args/?post_type='.WPT_Production::post_type_name, $post_type_args);
register_post_type( WPT_Production::post_type_name, $post_type_args );
$post_type_args = array(
'labels' => array(
'name' => __( 'Events','theatre'),
'singular_name' => __( 'Event','theatre'),
'new_item' => __('New event','theatre'),
'add_new_item' => __('Add new event','theatre'),
'edit_item' => __('Edit event','theatre')
),
'public' => true,
'has_archive' => true,
'show_in_menu' => false,
'supports' => array(''),
'taxonomies' => array('category','post_tag'),
'show_in_nav_menus'=> false,
);
/**
* Filter the post type args for events.
*
* @since 0.15.9
* @param $post_type_args The post type args.
*/
$post_type_args = apply_filters('wpt/setup/post_type/args/?post_type='.WPT_Event::post_type_name, $post_type_args);
register_post_type( WPT_Event::post_type_name, $post_type_args );

Additionally, the label for the wp_theatre_event post type is not being used in the user interface.