PluginProbe
Team Showcase / 1.7
Team Showcase v1.7
trunk 1.0 1.1 1.11 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.2 1.20 1.21 1.21.1 1.21.2 1.21.3 1.21.4 1.21.5 1.22.0 1.22.1 1.22.10 1.22.12 1.22.13 1.22.14 All 49 releases
team / includes / class-post-types.php

class-post-types.php in Team Showcase 1.7, at includes/class-post-types.php

160 lines 5.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * @Author ParaTheme
5 * @Folder Team/Includes
6 * @version 3.0.5
7
8 * Copyright: 2015 ParaTheme
9 */
10
11 if ( ! defined('ABSPATH')) exit; // if direct access
12
13 class team_class_post_types{
14
15
16 public function __construct(){
17 add_action( 'init', array( $this, 'team_posttype_team_member' ), 0 );
18 add_action( 'init', array( $this, 'team_posttype_team' ), 0);
19
20 }
21
22
23 public function team_posttype_team_member(){
24
25 if ( post_type_exists( "team_member" ) )
26 return;
27
28 $singular = __( 'Team Member', 'team' );
29 $plural = __( 'Team Members', 'team' );
30
31
32 register_post_type( "team_member",
33 apply_filters( "register_post_type_team_member", array(
34 'labels' => array(
35 'name' => $plural,
36 'singular_name' => $singular,
37 'menu_name' => __( 'Team Member', 'team' ),
38 'all_items' => sprintf( __( 'All %s', 'team' ), $plural ),
39 'add_new' => __( 'Add New', 'team' ),
40 'add_new_item' => sprintf( __( 'Add %s', 'team' ), $singular ),
41 'edit' => __( 'Edit', 'team' ),
42 'edit_item' => sprintf( __( 'Edit %s', 'team' ), $singular ),
43 'new_item' => sprintf( __( 'New %s', 'team' ), $singular ),
44 'view' => sprintf( __( 'View %s', 'team' ), $singular ),
45 'view_item' => sprintf( __( 'View %s', 'team' ), $singular ),
46 'search_items' => sprintf( __( 'Search %s', 'team' ), $plural ),
47 'not_found' => sprintf( __( 'No %s found', 'team' ), $plural ),
48 'not_found_in_trash' => sprintf( __( 'No %s found in trash', 'team' ), $plural ),
49 'parent' => sprintf( __( 'Parent %s', 'team' ), $singular )
50 ),
51 'description' => sprintf( __( 'This is where you can create and manage %s.', 'team' ), $plural ),
52 'public' => true,
53 'show_ui' => true,
54 'capability_type' => 'post',
55 'map_meta_cap' => true,
56 'publicly_queryable' => true,
57 'exclude_from_search' => false,
58 'hierarchical' => false,
59 'rewrite' => true,
60 'query_var' => true,
61 'supports' => array( 'title','editor','thumbnail','custom-fields' ),
62 'show_in_nav_menus' => false,
63 'show_in_menu' => 'edit.php?post_type=team',
64 'menu_icon' => 'dashicons-admin-users',
65
66
67
68 ) )
69 );
70
71 $singular = __( 'Team Group', 'team' );
72 $plural = __( 'Team Groups', 'team' );
73
74 register_taxonomy( "team_group",
75 apply_filters( 'register_taxonomy_team_group_object_type', array( 'team_member' ) ),
76 apply_filters( 'register_taxonomy_team_group_args', array(
77 'hierarchical' => true,
78 'show_admin_column' => true,
79 'update_count_callback' => '_update_post_term_count',
80 'label' => $plural,
81 'labels' => array(
82 'name' => $plural,
83 'singular_name' => $singular,
84 'menu_name' => ucwords( $plural ),
85 'search_items' => sprintf( __( 'Search %s', 'team' ), $plural ),
86 'all_items' => sprintf( __( 'All %s', 'team' ), $plural ),
87 'parent_item' => sprintf( __( 'Parent %s', 'team' ), $singular ),
88 'parent_item_colon' => sprintf( __( 'Parent %s:', 'team' ), $singular ),
89 'edit_item' => sprintf( __( 'Edit %s', 'team' ), $singular ),
90 'update_item' => sprintf( __( 'Update %s', 'team' ), $singular ),
91 'add_new_item' => sprintf( __( 'Add New %s', 'team' ), $singular ),
92 'new_item_name' => sprintf( __( 'New %s Name', 'team' ), $singular )
93 ),
94 'show_ui' => true,
95 'public' => true,
96 'rewrite' => array(
97 'slug' => 'team_group', // This controls the base slug that will display before each term
98 'with_front' => false, // Don't display the category base before "/locations/"
99 'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/"
100 ),
101 ) )
102 );
103
104
105
106 }
107
108 public function team_posttype_team(){
109 if ( post_type_exists( "team" ) )
110 return;
111
112 $singular = __( 'Team', 'team' );
113 $plural = __( 'Team', 'team' );
114
115
116 register_post_type( "team",
117 apply_filters( "register_post_type_team", array(
118 'labels' => array(
119 'name' => $plural,
120 'singular_name' => $singular,
121 'menu_name' => __( 'Team', 'team' ),
122 'all_items' => sprintf( __( 'All %s', 'team' ), $plural ),
123 'add_new' => __( 'Add New', 'team' ),
124 'add_new_item' => sprintf( __( 'Add %s', 'team' ), $singular ),
125 'edit' => __( 'Edit', 'team' ),
126 'edit_item' => sprintf( __( 'Edit %s', 'team' ), $singular ),
127 'new_item' => sprintf( __( 'New %s', 'team' ), $singular ),
128 'view' => sprintf( __( 'View %s', 'team' ), $singular ),
129 'view_item' => sprintf( __( 'View %s', 'team' ), $singular ),
130 'search_items' => sprintf( __( 'Search %s', 'team' ), $plural ),
131 'not_found' => sprintf( __( 'No %s found', 'team' ), $plural ),
132 'not_found_in_trash' => sprintf( __( 'No %s found in trash', 'team' ), $plural ),
133 'parent' => sprintf( __( 'Parent %s', 'team' ), $singular )
134 ),
135 'description' => sprintf( __( 'This is where you can create and manage %s.', 'team' ), $plural ),
136 'public' => true,
137 'show_ui' => true,
138 'capability_type' => 'post',
139 'map_meta_cap' => true,
140 'publicly_queryable' => true,
141 'exclude_from_search' => false,
142 'hierarchical' => false,
143 'rewrite' => true,
144 'query_var' => true,
145 'supports' => array( 'title'),
146 'show_in_nav_menus' => false,
147 'menu_icon' => 'dashicons-admin-users',
148 ) )
149 );
150
151
152 }
153
154
155
156
157
158 }
159
160 new team_class_post_types();