certainlyakey
3/3/2014 - 9:37 PM

Wordpress - register tag taxonomy for pages

Wordpress - register tag taxonomy for pages

//Create categories for pages
function create_pages_taxonomy() {
	$labels_pages_cat = array(
		'name' => _x( 'Теги страниц', 'taxonomy general name' ),
		'singular_name' => _x( 'Тег страницы', 'taxonomy singular name' ),
		'search_items' =>  __( 'Искать теги страниц' ),
		'all_items' => __( 'Все теги страниц' ),
		// 'parent_item' => __( 'Родительская категория страниц' ),
		// 'parent_item_colon' => __( 'Родительская категория страниц' ),
		'edit_item' => __( 'Редактировать' ), 
		'update_item' => __( 'Обновить' ),
		'add_new_item' => __( 'Добавить тег страницы' ),
		'new_item_name' => __( 'Название' ),
		'menu_name' => __( 'Теги страниц' ),
	);
	register_taxonomy('pagescat','page', array(
		'hierarchical' => false,
		'labels' => $labels_pages_cat,
		'show_ui' => true,
		'show_admin_column' => true,
		'query_var' => true,
		'rewrite' => array( 'slug' => 'pagescat' ),
	));
}
add_action( 'init', 'create_pages_taxonomy', 0 );