Automator_Taxonomies::recipe_taxonomies()


Source

File: src/core/automator-post-types/uo-taxonomies/class-automator-taxonomies.php

	public function recipe_taxonomies() {

		// Add recipe category
		register_taxonomy(
			'recipe_category', // The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
			'uo-recipe', // post type name
			array(
				'hierarchical'      => true,
				'label'             => esc_attr__( 'Recipe category', 'uncanny-automator' ), // display name
				'labels'            => array(
					'menu_name' => esc_attr__( 'Categories', 'uncanny-automator' ),
				),
				'query_var'         => true,
				'rewrite'           => array(
					'slug'       => 'uo-recipe', // This controls the base slug that will display before each term
					'with_front' => false, // Don't display the category base before
				),
				'show_in_nav_menus' => false,
				'capabilities'      => array(
					'manage_terms' => 'manage_options',
					'edit_terms'   => 'manage_options',
					'delete_terms' => 'manage_options',
					'assign_terms' => 'manage_options',
				),
			)
		);

		// Add recipe tag
		register_taxonomy(
			'recipe_tag', // The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
			'uo-recipe', // post type name
			array(
				'hierarchical'      => false,
				'label'             => esc_attr__( 'Recipe tag', 'uncanny-automator' ), // display name
				'labels'            => array(
					'menu_name' => esc_attr__( 'Tags', 'uncanny-automator' ),
				),
				'query_var'         => true,
				'rewrite'           => array(
					'slug'       => 'uo-recipe', // This controls the base slug that will display before each term
					'with_front' => false, // Don't display the category base before
				),
				'show_in_nav_menus' => false,
				'capabilities'      => array(
					'manage_terms' => 'manage_options',
					'edit_terms'   => 'manage_options',
					'delete_terms' => 'manage_options',
					'assign_terms' => 'manage_options',
				),
			)
		);
	}