| 1 |
<?php |
| 2 |
|
| 3 |
// Register Custom Taxonomy "lesson-difficulty" |
| 4 |
add_action( 'init', 'wpc_lesson_difficulty_args', 0 ); |
| 5 |
// Customize taxonomy |
| 6 |
function wpc_lesson_difficulty_args() { |
| 7 |
$labels = array( |
| 8 |
'name' => _x( 'Difficulty', 'taxonomy general name' ), |
| 9 |
'singular_name' => _x( 'Difficulty', 'taxonomy name' ), |
| 10 |
'search_items' => __( 'Search Difficulty' ), |
| 11 |
'all_items' => __( 'All Difficulty' ), |
| 12 |
'parent_item' => __( 'Parent Term Category' ), |
| 13 |
'parent_item_colon' => __( 'Parent Term Category:' ), |
| 14 |
'edit_item' => __( 'Edit Difficulty' ), |
| 15 |
'update_item' => __( 'Update Difficulty' ), |
| 16 |
'add_new_item' => __( 'Add New Difficulty' ), |
| 17 |
'new_item_name' => __( 'New Difficulty' ), |
| 18 |
'menu_name' => __( 'Difficulty' ), |
| 19 |
); |
| 20 |
$args = array( |
| 21 |
'labels' => $labels, |
| 22 |
'hierarchical' => false, |
| 23 |
'show_admin_column' => true, |
| 24 |
'query_var' => true |
| 25 |
); |
| 26 |
register_taxonomy( 'course-difficulty', 'course', $args ); |
| 27 |
} |
| 28 |
// Register Custom Taxonomy "category" |
| 29 |
add_action( 'init', 'wpc_course_category_args', 0 ); |
| 30 |
// Customize taxonomy |
| 31 |
function wpc_course_category_args() { |
| 32 |
$labels = array( |
| 33 |
'name' => _x( 'Category', 'taxonomy general name' ), |
| 34 |
'singular_name' => _x( 'Category', 'taxonomy name' ), |
| 35 |
'search_items' => __( 'Search Category' ), |
| 36 |
'all_items' => __( 'All Categories' ), |
| 37 |
'parent_item' => __( 'Parent Term Category' ), |
| 38 |
'parent_item_colon' => __( 'Parent Term Category:' ), |
| 39 |
'edit_item' => __( 'Edit Category' ), |
| 40 |
'update_item' => __( 'Update Category' ), |
| 41 |
'add_new_item' => __( 'Add New Category' ), |
| 42 |
'new_item_name' => __( 'New Category' ), |
| 43 |
'menu_name' => __( 'Category' ), |
| 44 |
); |
| 45 |
$args = array( |
| 46 |
'labels' => $labels, |
| 47 |
'hierarchical' => false, |
| 48 |
'show_admin_column' => true, |
| 49 |
'query_var' => true |
| 50 |
); |
| 51 |
register_taxonomy( 'course-category', 'course', $args ); |
| 52 |
} |
| 53 |
|
| 54 |
?> |