Skip to content

Instantly share code, notes, and snippets.

@zanematthew
Created May 9, 2012 22:58
Show Gist options
  • Save zanematthew/2649552 to your computer and use it in GitHub Desktop.
Save zanematthew/2649552 to your computer and use it in GitHub Desktop.
This the contents of our Events Post Type
<?php
// This file is located in models/events.php
$tmp_cpt = 'events';
$event = new Events();
$event->post_type = array(
array(
'name' => 'Race Event',
'type' => $tmp_cpt,
'has_one' => 'tracks', // add support 'has_many' => 'other_cpt'
'rewrite' => array(
'slug' => 'events'
),
'supports' => array(
'title',
'editor',
'comments'
),
'taxonomies' => array(
'type',
'bmx_rs_tag',
'attendees'
)
)
);
$event->taxonomy = array(
array(
'name' => 'type',
'post_type' => $tmp_cpt,
'menu_name' => 'Type'
),
array(
'name' => 'bmx_rs_tag',
'post_type' => $tmp_cpt,
'menu_name' => 'BMX Tags',
'slug' => 'bmx-tags'
),
array(
'name' => 'attendees',
'post_type' => $tmp_cpt
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment