WordPress.org

Forums

[resolved] Custom Taxonomy does not show up in WP Menu (2 posts)

  1. johnhamman
    Member
    Posted 4 years ago #

    Hi all,
    I have created a custom post_type and a taxonomy to go with it. The taxonomy is not showing up in the nav-menus.php admin page?

    Here is my code, perhaps I am missing something?

    function products_register() {
    
    	$labels = array(
    		'name' => __( 'Products' ),
    		'singular_name' => __( 'Product' ),
    		'add_new' => __( 'Add New' ),
    		'add_new_item' => __( 'Add New Product' ),
    		'edit' => __( 'Edit' ),
    		'edit_item' => __( 'Edit Product' ),
    		'new_item' => __( 'New Product' ),
    		'view' => __( 'View Product' ),
    		'view_item' => __( 'View Product' ),
    		'search_items' => __( 'Search Products' ),
    		'not_found' => __( 'No Products found' ),
    		'not_found_in_trash' => __( 'No Products found in Trash' ),
    		'parent_item_colon' => ''
    	);
    
    	$args = array(
    		'labels' => $labels,
    		'public' => true,
    		'publicly_queryable' => true,
    		'show_ui' => true,
    		'query_var' => true,
    		//'menu_icon' => get_stylesheet_directory_uri() . '/product16.png',
    		'rewrite' => array('slug'=>'products'),
    		'capability_type' => 'post',
    		'hierarchical' => false,
    		'menu_position' => null,
    		//'show_in_nav_menus' => true,
    		'supports' => array('title','editor','thumbnail','comments')
    	  ); 
    
    	register_post_type( 'productpage' , $args );
    
    	register_taxonomy("Product Categories",
    					  array("productpage"),
    					  array("hierarchical" => true,
    							"label" => "Product Categories",
    							"singular_label" => "Product Category",
    							"rewrite" => true));
    
    }
  2. johnhamman
    Member
    Posted 4 years ago #

    Ok found the problem.

    Instead of

    register_taxonomy("Product Categories",
    ........

    I need to remove the space to change it to

    register_taxonomy("ProductCategories",
    .....

Topic Closed

This topic has been closed to new replies.

About this Topic