File Taxonomy-abc.php

File: admin/taxonomy/taxonomy-event.php

<?php
    function inno_event_taxonomy() {

        /* Biến $label chứa các tham số thiết lập tên hiển thị của Taxonomy
         */
        $labels = array(
                ‘name’ => ‘Các sự kiện’,
                ‘singular’ => ‘Các sự kiện’,
                ‘menu_name’ => ‘Các sự kiện’,

        );

        /* Biến $args khai báo các tham số trong custom taxonomy cần tạo
         */
        $args = array(
                ‘labels’                     => $labels,
                ‘hierarchical’               => true,
                ‘show_ui’                    => true,
                ‘show_admin_column’          => true,
                ‘query_var’ => true
        );

        /* Hàm register_taxonomy để khởi tạo taxonomy
         */
        register_taxonomy(‘inno-event-cat’, ‘inno-event’, $args);

}
add_action( ‘init’, ‘inno_event_taxonomy’, 0 );
?>

Leave a Reply

Your email address will not be published. Required fields are marked *