I have a weird error that happens every time I create a new category in a custom post type:
I also get an error when I try to delete the category: An undefined error occurred.
I have tried wp in debug mode but nothing extra gets added.
Hope someone can help :)
Here's my taxonomy code:
function store_categories() {
$labels = array(
'name' => _x( 'Store Categories', 'taxonomy general name' ),
'singular_name' => _x( 'Store Category', 'taxonomy singular name' ),
'search_items' => __( 'Search Store Categories' ),
'all_items' => __( 'All Store Categories' ),
'parent_item' => __( 'Parent Store Category' ),
'parent_item_colon' => __( 'Parent Store Category:' ),
'edit_item' => __( 'Edit Store Category' ),
'update_item' => __( 'Update Store Category' ),
'add_new_item' => __( 'Add New Store Category' ),
'new_item_name' => __( 'New Store Category' ),
'menu_name' => __( 'Store Categories' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'query_var' => true,
'rewrite' => true,
'public' => true,
'show_ui' => true,
);
register_taxonomy( 'store-category', 'stores', $args );
}
add_action( 'init', 'store_categories', 0 );
And the custom post type code:
function custom_store_post_type() {
$labels = array(
'name' => _x( 'Custom Stores', 'post type general name' ),
'singular_name' => _x( 'Custom Store', 'post type singular name' ),
'add_new' => _x( 'Add New', 'Custom Store' ),
'add_new_item' => __( 'Add New Custom Store' ),
'edit_item' => __( 'Edit Custom Store' ),
'new_item' => __( 'New Custom Store' ),
'all_items' => __( 'All Custom Stores' ),
'view_item' => __( 'View Success Story' ),
'search_items' => __( 'Search Custom Stores' ),
'not_found' => __( 'No Custom Stores found' ),
'not_found_in_trash' => __( 'No Custom Stores found in the Trash' ),
'parent_item_colon' => '',
'menu_name' => 'Custom Stores'
);
$args = array(
'labels' => $labels,
'description' => 'Holds our Custom Stores and Custom Store specific data',
'public' => true,
'menu_position' => 20,
'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'excerpt' ),
'has_archive' => true,
);
register_post_type( 'stores', $args );
}
add_action( 'init', 'custom_store_post_type' );
Problem solved.
Had a closing php tag that was causing the issue at the plugin details.