Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
define('_TEMPLATEURL', WP_CONTENT_URL . '/themes/' . basename(TEMPLATEPATH));
include_once 'WPAlchemy/MetaBox.php';
if (is_admin()) wp_enqueue_style('custom_meta_css', _TEMPLATEURL . '/custom/meta.css');
$repeating_mb = new WPAlchemy_MetaBox(array
(
'id' => '_repeating_meta',
'title' => 'My Repeating Meta',
'types' => array('event'),
'template' => TEMPLATEPATH . '/custom/repeating_fields_meta.php',
));
add_action('init','init_hook');
function init_hook()
{
$labels = array
(
'name' => _x('Events', 'post type general name'),
'singular_name' => _x('Event', 'post type singular name'),
'add_new' => _x('Add New', 'event'),
'add_new_item' => __('Add New Event'),
'edit_item' => __('Edit Event'),
'new_item' => __('New Event'),
'view_item' => __('View Event'),
'search_items' => __('Search Events'),
'not_found' => __('No events found'),
'not_found_in_trash' => __('No events found in Trash'),
'parent_item_colon' => '',
);
$support = array
(
'title',
'editor',
'author',
'thumbnail',
'excerpt',
'custom-fields',
'comments',
'revisions',
'page-attributes',
);
$args = array
(
'labels' => $labels,
'public' => TRUE,
'rewrite' => array('slug'=>'events'),
'capability_type' => 'post',
'hierarchical' => TRUE,
'supports' => $support,
'menu_position' => 21,
);
register_post_type('event', $args);
}
/* end of file */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment