Skip to content

Instantly share code, notes, and snippets.

@certainlyakey
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save certainlyakey/9335133 to your computer and use it in GitHub Desktop.
Save certainlyakey/9335133 to your computer and use it in GitHub Desktop.
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 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment