-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathclass-taxonomy-publication.php
More file actions
78 lines (71 loc) · 2.21 KB
/
class-taxonomy-publication.php
File metadata and controls
78 lines (71 loc) · 2.21 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* To register custom taxonomy.
*
* @package osi-features
*/
namespace Osi\Features\Inc\Taxonomies;
use Osi\Features\Inc\Post_Types\Post_Type_Press_Mentions;
/**
* Class Taxonomy_Steward
*/
class Taxonomy_Publication extends Base {
/**
* Slug of taxonomy.
*
* @var string
*/
const SLUG = 'taxonomy-publication';
/**
* Labels for taxonomy.
*
* @return array
*/
public function get_labels() {
return array(
'name' => _x( 'Publication', 'taxonomy general name', 'osi-features' ),
'singular_name' => _x( 'Publication', 'taxonomy singular name', 'osi-features' ),
'search_items' => __( 'Search Publication', 'osi-features' ),
'popular_items' => __( 'Popular Publications', 'osi-features' ),
'all_items' => __( 'All Publications', 'osi-features' ),
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => __( 'Edit Publication', 'osi-features' ),
'update_item' => __( 'Update Publication', 'osi-features' ),
'add_new_item' => __( 'Add New Publication', 'osi-features' ),
'new_item_name' => __( 'New Publication Name', 'osi-features' ),
'separate_items_with_commas' => __( 'Separate Publications with commas', 'osi-features' ),
'add_or_remove_items' => __( 'Add or remove Publication', 'osi-features' ),
'choose_from_most_used' => __( 'Choose from the most used Publications', 'osi-features' ),
'not_found' => __( 'No Publication found.', 'osi-features' ),
'menu_name' => __( 'Publications', 'osi-features' ),
);
}
/**
* List of post types for taxonomy.
*
* @return array
*/
public function get_post_types() {
return array(
Post_Type_Press_Mentions::get_instance()->get_slug(),
);
}
/**
* To get argument to register taxonomy.
*
* @return array
*/
public function get_args() {
return wp_parse_args(
array(
'hierarchical' => true,
'rewrite' => array(
'slug' => Post_Type_Press_Mentions::get_instance()->get_slug() . '/publication',
'with_front' => false,
),
),
parent::get_args()
);
}
}