-
Notifications
You must be signed in to change notification settings - Fork 0
/
packerly_taxonomies.php
62 lines (58 loc) · 2.08 KB
/
packerly_taxonomies.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
class PackerlyTaxonomies
{
public function __construct()
{
add_action('init', array($this, 'create_climate_budget_taxonomy'));
add_action('init', array($this, 'create_gender_taxonomy'));
}
public function create_climate_budget_taxonomy()
{
$labels = array(
'name' => _x('Climate/budget', 'taxonomy general name'),
'singular_name' => _x('Climate/budget', 'taxonomy singular name'),
'search_items' => __('Search Climate/budget'),
'all_items' => __('All Climate/budgets'),
'parent_item' => __('Parent Climate/budget'),
'parent_item_colon' => __('Parent Climate/budget:'),
'edit_item' => __('Edit Climate/budget'),
'update_item' => __('Update Climate/budget'),
'add_new_item' => __('Add New Climate/budget'),
'new_item_name' => __('New Climate/budget Name'),
'menu_name' => __('Climate/budget'),
);
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array('slug' => 'climate-budget'),
);
register_taxonomy('climate-budget', array('clothing', 'electricalitems', 'careitems'), $args);
}
public function create_gender_taxonomy()
{
$labels = array(
'name' => _x('Gender', 'taxonomy general name'),
'singular_name' => _x('Gender', 'taxonomy singular name'),
'all_items' => __('All Genders'),
'edit_item' => __('Edit Gender'),
'update_item' => __('Update Gender'),
'add_new_item' => __('Add New Gender'),
'new_item_name' => __('New Gender'),
'menu_name' => __('Gender'),
);
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array('slug' => 'gender'),
);
register_taxonomy('gender', array('clothing', 'electricalitems', 'careitems'), $args);
}
}
$packerlyTaxonomies = new PackerlyTaxonomies();
?>