ĐĂNG TIN
logo
Online:
Visits: 1,685,763,871
Stories: 8,383,788
Profile image
0
0
Tác giả: fcwordpress
Trang tin cá nhân | Bài đã đăng
Lượt xem

Hiện tại:
1h trước: 1
24h trước: 1
Tổng số: 40
Code đăng ký taxonomy chuẩn nhất giúp chúng ta copy nhanh vào dự án
Friday, December 23, 2016 0:03
% of readers think this story is Fact. Add your two cents.


Đây là code đăng ký taxonomy chuẩn giúp anh chị copy vào dự án của mình:

add_action( 'init', function() { register_taxonomy( 'news_category', 'news', [ 'labels' => [ 'name' => __( 'News Categories', ABC ), 'singular_name' => __( 'News Category', ABC ), 'search_items' => __( 'Search News Categories', ABC ), 'all_items' => __( 'All News Categories', ABC ), 'parent_item' => __( 'Parent News Categories', ABC ), 'parent_item_colon' => __( 'Parent News Category:', ABC ), 'edit_item' => __( 'Edit News Category', ABC ), 'update_item' => __( 'Update News Category', ABC ), 'add_new_item' => __( 'Add News Category', ABC ), 'new_item_name' => __( 'New News', ABC ), 'menu_name' => __( 'News Categories', ABC ), ], 'rewrite' => [ 'slug' => 'news-category', 'hierarchical' => true ], 'hierarchical' => true, 'show_admin_column' => true, 'query_var' => true ]); });

Tin nổi bật trong ngày
Tin mới nhất

Register

Newsletter

Email this story
If you really want to disable all recommended stories, click on OK button. After that, you will be redirect to your options page.