Last active
August 29, 2015 13:56
-
-
Save certainlyakey/9335133 to your computer and use it in GitHub Desktop.
Wordpress - register tag taxonomy for pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment