jaredatch/Custom-Metaboxes-and-Fields-for-WordPress — Issue #97: weird conflict with existing CPTs and WP rotator
Author: nvcadp
Created: 2012-01-21 20:24:21+00:00
State: open

We have 3 CPTs in use on our site designed using the Custom Metaboxes and Fields, which worked well until....

I adding the Wp Rotator plugin and code as described here:
http://www.billerickson.net/wordpress-metaboxes/

which worked for including the Rotator itself but for some reason it removed the 1 of the 3 CPTs (called Reviews) If I remove the Rotator portion from the register_posttypes.php then Review appears again on the left nav. It I pop the rotator code back in Reviews disappear again. It is always Reviews that it removes. I've picked over the code and can't figure out where the conflict is. Any ideas are greatly appreciated!!

here is the register_posttypes.php code in it's entirety:

_x('Trail Reports', 'post type general name'),
'singular_name' => _x('Trail Reports', 'post type singular name'),
'add_new_item' => __('Add New Item'),
'edit_item' => __('Edit Item'),
'new_item' => __('New Item'),
'view_item' => __('View Item'),
'search_items' => __('Search Trail Reports'),
'not_found' => __('No items found'),
'not_found_in_trash' => __('No items found in Trash'),
'menu_name' => 'Trail Reports'
);

$trail_args = array(
'labels' => $trail_labels,
'supports' => array('title','editor','excerpt','thumbnail','comments','author','tags','catagories','post-meta'),
'has_archive' => 'trails',
//'menu_icon' => THEMEIMG . '/icon-products.png' // Products
);
sld_register_post_type('trails',$trail_args);

// Recipes
$recipes_labels = array(
'name' => _x('Recipes', 'post type general name'),
'singular_name' => _x('Recipe', 'post type singular name'),
'add_new_item' => __('Add New Item'),
'edit_item' => __('Edit Item'),
'new_item' => __('New Item'),
'view_item' => __('View Item'),
'search_items' => __('Search Recipes'),
'not_found' => __('No items found'),
'not_found_in_trash' => __('No items found in Trash'),
'menu_name' => 'Recipes'
);

$recipes_args = array(
'labels' => $recipes_labels,
'supports' => array('title','editor','excerpt','thumbnail','comments','author'),
'has_archive' => 'recipes',
//'menu_icon' => THEMEIMG . '/icon-products.png' // Products
);
sld_register_post_type('recipes',$recipes_args);

// Rotator
$rotator_labels = array(
'name' => _x('rotator', 'post type general name'),
'singular_name' => _x('rotator', 'post type singular name'),
'add_new_item' => __('Add New Item'),
'edit_item' => __('Edit Item'),
'new_item' => __('New Item'),
'view_item' => __('View Item'),
'search_items' => __('Search rotator'),
'not_found' => __('No items found'),
'not_found_in_trash' => __('No items found in Trash'),
'menu_name' => 'Image Rotator'
);

$rotator_args = array(
'labels' => $rotator_labels,
'supports' => array('title','editor','excerpt','thumbnail','comments','author'),
'has_archive' => 'rotator',
//'menu_icon' => THEMEIMG . '/icon-products.png' // Products
);
sld_register_post_type('rotator',$rotator_args);

// Reviews
$reviews_labels = array(
'name' => _x('Reviews', 'post type general name'),
'singular_name' => _x('Reviews', 'post type singular name'),
'add_new_item' => __('Add New Item'),
'edit_item' => __('Edit Item'),
'new_item' => __('New Item'),
'view_item' => __('View Item'),
'search_items' => __('Search Reviews'),
'not_found' => __('No items found'),
'not_found_in_trash' => __('No items found in Trash'),
'menu_name' => 'Reviews'
);

$reviews_args = array(
'labels' => $reviews_labels,
'supports' => array('title','editor','excerpt','thumbnail','comments','author','tags','catagories','post-meta'),
'has_archive' => 'reviews',
//'menu_icon' => THEMEIMG . '/icon-products.png' // Products
);
sld_register_post_type('reviews',$reviews_args);
}
add_filter('init','trail_custom_post_types',-999);

//function to add taxonomies to custom post types
function trail_custom_post_types_taxonomies() {

$trail_args = array(
'rewrite' => array( 'slug' => 'trails' ),
);

// Registers the taxonomies for catalog items
sld_register_taxonomy( 'trail_category', 'trails', 'Trail Category', $trail_args, 'Trail Categories' );

// Registers the taxonomies for catalog items
sld_register_taxonomy( 'trail_state', 'trails', 'Trail State', $trail_args, 'Trail State' );

sld_register_taxonomy( 'trail-report-tags', 'trails', 'Trail Tags', $trail_args, 'Trail Tags' );

$recipes_args = array(
'rewrite' => array( 'slug' => 'recipes' ),
);

// Registers the taxonomies for catalog items
sld_register_taxonomy( 'recipe_category', 'recipes', 'Recipe Category', $recipes_args, 'Recipes Categories' );
sld_register_taxonomy( 'recipe-tags', 'recipes', 'Recipe Tags', $recipes_args, 'Recipe Tags' );

$reviews_args = array(
'rewrite' => array( 'slug' => 'reviews' ),
);

// Registers the taxonomies for catalog items
sld_register_taxonomy( 'gear_reviews_category', 'reviews', 'Gear Category', $reviews_args, 'Gear Categories' );

$labelsT = array(
'name' => _x( 'Gear Tags', 'gear-review-tags' ),
'singular_name' => _x( 'Gear Tags', 'gear-review-tags' ),
'search_items' => __( 'Search Gear Tags' ),
'popular_items' => __( 'Popular Gear Tags' ),
'all_items' => __( 'All Gear Tags' ),
'edit_item' => __( 'Edit Gear Tag' ),
'update_item' => __( 'Update Gear Tag' ),
'add_new_item' => __( 'Add New Gear Tag' ),
'new_item_name' => __( 'New Gear Tag' ),
'separate_items_with_commas' => __( 'Separate gear tags with commas' ),
'add_or_remove_items' => __( 'Add or remove gear tag' ),
'choose_from_most_used' => __( 'Choose from the most used gear tags' ),
'menu_name' => __( 'Gear Tags' ),
);

register_taxonomy('gear-review-tags','reviews',array(
'hierarchical' => false,
'labels' => $labelsT,
'show_ui' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'rewrite' => array( 'slug' => 'gear-review-tags' ),
));
}
add_filter('init','trail_custom_post_types_taxonomies',-888);

?>