Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Hooks */
- add_action( 'init', 'nd_brooklin_posttype' );
- add_action( 'init', 'nd_brooklin_taxonomy' );
- add_action( 'init', 'nd_brooklin_metaboxes');
- /* Functions */
- function nd_brooklin_posttype(){
- //Set up custom post type variables.
- $labels = array(
- 'name' => _x('Brooklin Models', 'post type general name'),
- 'singular_name' => _x('Model', 'post type singular name'),
- 'add_new' => _x('Add New', 'Model'),
- 'add_new_item' => __('Add New Model'),
- 'edit_item' => __('Edit Model'),
- 'new_item' => __('New Model'),
- 'view_item' => __('View Model'),
- 'search_items' => __('Search Models'),
- 'not_found' => __('Nothing found'),
- 'not_found_in_trash' => __('Nothing found in Trash'),
- 'parent_item_colon' => ''
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'query_var' => true,
- 'rewrite' => true,
- 'capability_type' => 'page',
- 'hierarchical' => false,
- 'menu_position' => 20,
- 'supports' => array(
- 'title',
- 'editor',
- 'thumbnail'),
- 'rewrite' => array( 'slug' => 'model' ),
- );
- //Register the newsletter post type.
- register_post_type( 'nd_brooklin' , $args );
- flush_rewrite_rules();
- }
- function nd_brooklin_taxonomy(){
- register_taxonomy(
- 'nd_brooklin_tax',
- 'nd_brooklin',
- array(
- 'hierarchical' => true,
- 'label' => 'Ranges',
- 'query_var' => true,
- 'rewrite' => true,
- 'rewrite' => array( 'slug' => 'ranges' )
- )
- );
- if( function_exists('add_term_ordering_support') ) add_term_ordering_support ('nd_brooklin_tax');
- }
- function nd_brooklin_metaboxes(){
- $pluginDir = WP_PLUGIN_DIR . '/19d_brooklinProducts';
- if(!class_exists('WPAlchemy_MetaBox'))include_once $pluginDir . '/WPAlchemy/MetaBox.php';
- if (is_admin()) wp_enqueue_style('custom_meta_css', WP_PLUGIN_URL . '/19d_brooklinProducts' . '/box-styles.css');
- $nd_brooklin_metabox = new WPAlchemy_MetaBox(
- array(
- 'id' => '_nd_brooklin',
- 'title' => 'Model Preferences',
- 'template' => $pluginDir . '/box-styles/nd_brooklin.php',
- 'types' => array('nd_brooklin'),
- 'context' => 'normal',
- 'priority' => 'high',
- 'autosave' => TRUE,
- 'mode' => WPALCHEMY_MODE_EXTRACT
- )
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement