-
Notifications
You must be signed in to change notification settings - Fork 0
/
os-avengers.php
151 lines (140 loc) · 7.11 KB
/
os-avengers.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
/**
* Plugin Name: Avengers Assemble
* Plugin URI: https://osen.co.ke/wp/plugins/os-avengers
* Description: WordPress plugin for our team
* Author: Osen Concepts < hi@osen.co.ke >
* Version: 1.4
* Author URI: https://osen.co.ke/
*
* Requires at least: 4.4
* Tested up to: 4.9.5
*/
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
// Register Avengers Custom Post Type
function osen_our_team() {
$labels = array(
'name' => _x( 'Avengers', 'Post Type General Name', 'osen' ),
'singular_name' => _x( 'Avenger', 'Post Type Singular Name', 'osen' ),
'menu_name' => __( 'Avengers', 'osen' ),
'name_admin_bar' => __( 'Avenger', 'osen' ),
'archives' => __( 'Avengers Archives', 'osen' ),
'attributes' => __( 'Item Attributes', 'osen' ),
'parent_item_colon' => __( 'Parent Avenger:', 'osen' ),
'all_items' => __( 'All Avengers', 'osen' ),
'add_new_item' => __( 'Add New Avenger', 'osen' ),
'add_new' => __( 'Add New', 'osen' ),
'new_item' => __( 'New Avenger', 'osen' ),
'edit_item' => __( 'Edit Avenger', 'osen' ),
'update_item' => __( 'Update Avenger', 'osen' ),
'view_item' => __( 'View Avenger', 'osen' ),
'view_items' => __( 'View Avengers', 'osen' ),
'search_items' => __( 'Search Avenger', 'osen' ),
'not_found' => __( 'Not found', 'osen' ),
'not_found_in_trash' => __( 'Not found in Trash', 'osen' ),
'featured_image' => __( 'Avenger Avatar', 'osen' ),
'set_featured_image' => __( 'Set avenger avatar', 'osen' ),
'remove_featured_image' => __( 'Remove avenger avatar', 'osen' ),
'use_featured_image' => __( 'Use as avenger avatar', 'osen' ),
'insert_into_item' => __( 'Insert into avenger', 'osen' ),
'uploaded_to_this_item' => __( 'Uploaded to this avenger', 'osen' ),
'items_list' => __( 'Avengers list', 'osen' ),
'items_list_navigation' => __( 'Avengers list navigation', 'osen' ),
'filter_items_list' => __( 'Filter avengers list', 'osen' ),
);
$args = array(
'label' => __( 'Avenger', 'osen' ),
'description' => __( 'Post Type Description', 'osen' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields' ),
'taxonomies' => array( 'editor' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => get_template_directory_uri()."/assets/images/avengers.png",
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'avenger', $args );
}
add_action( 'init', 'osen_our_team', 0 );
// Register Custom Taxonomy - Avengers Type
function osen_avenger_type() {
$labels = array(
'name' => _x( 'Types', 'Taxonomy General Name', 'osen' ),
'singular_name' => _x( 'Type', 'Taxonomy Singular Name', 'osen' ),
'menu_name' => __( 'Types', 'osen' ),
'all_items' => __( 'All Types', 'osen' ),
'parent_item' => __( 'Parent Type', 'osen' ),
'parent_item_colon' => __( 'Parent Type:', 'osen' ),
'new_item_name' => __( 'New Type Name', 'osen' ),
'add_new_item' => __( 'Add New Type', 'osen' ),
'edit_item' => __( 'Edit Type', 'osen' ),
'update_item' => __( 'Update Type', 'osen' ),
'view_item' => __( 'View Type', 'osen' ),
'separate_items_with_commas' => __( 'Separate types with commas', 'osen' ),
'add_or_remove_items' => __( 'Add or remove types', 'osen' ),
'choose_from_most_used' => __( 'Choose from the most used', 'osen' ),
'popular_items' => __( 'Popular Type', 'osen' ),
'search_items' => __( 'Search Types', 'osen' ),
'not_found' => __( 'Not Found', 'osen' ),
'no_terms' => __( 'No types', 'osen' ),
'items_list' => __( 'Types list', 'osen' ),
'items_list_navigation' => __( 'Types list navigation', 'osen' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
'show_in_rest' => true,
);
register_taxonomy( 'avenger_type', array( 'avenger' ), $args );
}
add_action( 'init', 'osen_avenger_type', 0 );
// Register Custom Taxonomy
function osen_avenger_skill() {
$labels = array(
'name' => _x( 'Skills', 'Taxonomy General Name', 'osen' ),
'singular_name' => _x( 'Skill', 'Taxonomy Singular Name', 'osen' ),
'menu_name' => __( 'Skills', 'osen' ),
'all_items' => __( 'All Skills', 'osen' ),
'parent_item' => __( 'Parent Skill', 'osen' ),
'parent_item_colon' => __( 'Parent Skill:', 'osen' ),
'new_item_name' => __( 'New Skill Name', 'osen' ),
'add_new_item' => __( 'Add New Skill', 'osen' ),
'edit_item' => __( 'Edit Skill', 'osen' ),
'update_item' => __( 'Update Skill', 'osen' ),
'view_item' => __( 'View Skill', 'osen' ),
'separate_items_with_commas' => __( 'Separate skills with commas', 'osen' ),
'add_or_remove_items' => __( 'Add or remove items', 'osen' ),
'choose_from_most_used' => __( 'Choose from the most used', 'osen' ),
'popular_items' => __( 'Popular Skills', 'osen' ),
'search_items' => __( 'Search Skills', 'osen' ),
'not_found' => __( 'Not Found', 'osen' ),
'no_terms' => __( 'No skills', 'osen' ),
'items_list' => __( 'Skills list', 'osen' ),
'items_list_navigation' => __( 'Skills list navigation', 'osen' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
);
register_taxonomy( 'avenger_skill', array( 'avenger' ), $args );
}
add_action( 'init', 'osen_avenger_skill', 0 );