Version Description
= 0.7 = * WordPress 3.1 support * Added has_archive and show_in_menu support * Added label for custom menu name * Updated plugin UI to be consistent with WordPress styles * Added "Get Code" feature to easily copy code used for post types and taxonomies (BETA)
= 0.6.2 = * Added support for assigning custom taxonomies to post types when creating/editing * Fixed bug when setting hierarchy on a post type (props @JohnPBloch) * Fixed an error when registering a post type with no supported meta boxes * Fixed "Undefined index" error when determining return URLs * Added Chinese translation
= 0.6.1 = * Added translation functionality and .pot file * Added Japanese translation * Reworked entire path structure fixing "page not found" errors * Fixed "First argument is expected to be a valid callback" error * Random bug fixes
= 0.6 = * Added support for custom labels with custom post types and taxonomies * Added ability to assign built-in taxonomies to custom post types * Added ability to assign custom taxonomies to multiple post types * Fixed jQuery conflict with other plugins (props shadyvb) * Managing post types now displays total published/draft per type * Code optimization and cleanup
= 0.5.2 = * Updated excerpts to excerpt in CPT Support field (props vlad27aug)
= 0.5.1 = * Added flush_rewrite_rules() to reset rules when using custom rewrite slugs
= 0.5 = * Fixed multiple bugs * If upgrading from pre 0.5 version you will need to recreate your custom post types
= 0.4.1 = * Fixed bug with REWRITE and QUERY_VAR values not executing correctly
= 0.4 = * Default view now hides advanced options * Get Code link to easily copy/paste code used to create custom post types and taxonomies * Added support for 'author' and 'page-attributes' in CPT Supports field
= 0.3.1 = * Fixed multiple warnings and errors
= 0.3 = * added new menu/submenus for individual sections * added support for 'title' and 'editor' in CPT Supports field * added Singular Label for custom taxonomies (props sleary)
= 0.2.1 = * Set default Query Var setting to False
= 0.2 = * Fixed the siteurl bug * Added support for creating custom taxonomies
= 0.1.2 = * Fixed a bug where default values were incorrect
= 0.1.1 = * Fixed a bunch of warnings
= 0.1 = * First beta release
Release Info
Developer | williamsba1 |
Plugin | Custom Post Type UI |
Version | 0.7.0.0 |
Comparing to | |
See all releases |
Version 0.7.0.0
- custom-post-type-ui.php +1484 -0
- images/professional-wordpress-plugin-development.png +0 -0
- images/professional-wordpress.jpg +0 -0
- languages/cpt-plugin-ja.mo +0 -0
- languages/cpt-plugin-ja.po +345 -0
- languages/cpt-plugin-zh_CN.mo +0 -0
- languages/cpt-plugin-zh_CN.po +495 -0
- languages/custom-post-type-ui.mo +0 -0
- languages/custom-post-type-ui.pot +484 -0
- readme.txt +213 -0
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
@@ -0,0 +1,1484 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Custom Post Type UI
|
4 |
+
Plugin URI: http://webdevstudios.com/support/wordpress-plugins/
|
5 |
+
Description: Admin panel for creating custom post types and custom taxonomies in WordPress
|
6 |
+
Author: WebDevStudios.com
|
7 |
+
Version: 0.7
|
8 |
+
Author URI: http://webdevstudios.com/
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Define current version constant
|
12 |
+
define( 'CPT_VERSION', '0.7' );
|
13 |
+
|
14 |
+
// Define plugin URL constant
|
15 |
+
$CPT_URL = cpt_check_return( 'add' );
|
16 |
+
|
17 |
+
//load translated strings
|
18 |
+
load_plugin_textdomain( 'cpt-plugin', false, 'custom-post-type-ui/languages' );
|
19 |
+
|
20 |
+
// create custom plugin settings menu
|
21 |
+
add_action('admin_menu', 'cpt_plugin_menu');
|
22 |
+
|
23 |
+
//call delete post function
|
24 |
+
add_action( 'admin_init', 'cpt_delete_post_type' );
|
25 |
+
|
26 |
+
//call register settings function
|
27 |
+
add_action( 'admin_init', 'cpt_register_settings' );
|
28 |
+
|
29 |
+
//process custom taxonomies if they exist
|
30 |
+
add_action( 'init', 'cpt_create_custom_taxonomies', 0 );
|
31 |
+
|
32 |
+
//process custom taxonomies if they exist
|
33 |
+
add_action( 'init', 'cpt_create_custom_post_types', 0 );
|
34 |
+
|
35 |
+
function cpt_plugin_menu() {
|
36 |
+
//create custom post type menu
|
37 |
+
add_menu_page('Custom Post Types', 'Custom Post Types', 'administrator', 'cpt_main_menu', 'cpt_settings');
|
38 |
+
|
39 |
+
//create submenu items
|
40 |
+
add_submenu_page('cpt_main_menu', 'Add New', 'Add New', 'administrator', 'cpt_sub_add_new', 'cpt_add_new');
|
41 |
+
add_submenu_page('cpt_main_menu', 'Manage Post Types', 'Manage Post Types', 'administrator', 'cpt_sub_manage_cpt', 'cpt_manage_cpt');
|
42 |
+
add_submenu_page('cpt_main_menu', 'Manage Taxonomies', 'Manage Taxonomies', 'administrator', 'cpt_sub_manage_taxonomies', 'cpt_manage_taxonomies');
|
43 |
+
}
|
44 |
+
|
45 |
+
//temp fix, should do: http://planetozh.com/blog/2008/04/how-to-load-javascript-with-your-wordpress-plugin/
|
46 |
+
//only load JS if on a CPT page
|
47 |
+
If ( strpos($_SERVER['REQUEST_URI'], 'cpt')>0 ) {
|
48 |
+
add_action( 'admin_head', 'cpt_wp_add_styles' );
|
49 |
+
}
|
50 |
+
// Add JS Scripts
|
51 |
+
function cpt_wp_add_styles() {
|
52 |
+
?>
|
53 |
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js">
|
54 |
+
</script>
|
55 |
+
<script type="text/javascript" >
|
56 |
+
jQuery(document).ready(function()
|
57 |
+
{
|
58 |
+
jQuery(".comment_button").click(function(){
|
59 |
+
|
60 |
+
var element = jQuery(this);
|
61 |
+
var I = element.attr("id");
|
62 |
+
|
63 |
+
jQuery("#slidepanel"+I).slideToggle(300);
|
64 |
+
jQuery(this).toggleClass("active");
|
65 |
+
|
66 |
+
return false;
|
67 |
+
});
|
68 |
+
});
|
69 |
+
</script>
|
70 |
+
<?php
|
71 |
+
}
|
72 |
+
|
73 |
+
function cpt_create_custom_post_types() {
|
74 |
+
//register custom post types
|
75 |
+
$cpt_post_types = get_option('cpt_custom_post_types');
|
76 |
+
|
77 |
+
//check if option value is an Array before proceeding
|
78 |
+
if ( is_array( $cpt_post_types ) ) {
|
79 |
+
foreach ($cpt_post_types as $cpt_post_type) {
|
80 |
+
|
81 |
+
//set post type values
|
82 |
+
$cpt_label = ( !$cpt_post_type["label"] ) ? esc_html($cpt_post_type["name"]) : esc_html($cpt_post_type["label"]);
|
83 |
+
$cpt_singular = ( !$cpt_post_type["singular_label"] ) ? $cpt_label : esc_html($cpt_post_type["singular_label"]);
|
84 |
+
$cpt_rewrite_slug = ( !$cpt_post_type["rewrite_slug"] ) ? esc_html($cpt_post_type["name"]) : esc_html($cpt_post_type["rewrite_slug"]);
|
85 |
+
$cpt_menu_position = ( !$cpt_post_type["menu_position"] ) ? null : intval($cpt_post_type["menu_position"]);
|
86 |
+
$cpt_taxonomies = ( !$cpt_post_type[1] ) ? array() : $cpt_post_type[1];
|
87 |
+
$cpt_supports = ( !$cpt_post_type[0] ) ? array() : $cpt_post_type[0];
|
88 |
+
//$cpt_show_in_menu = ( !$cpt_post_type["show_in_menu_string"] ) ? null : $cpt_post_type["show_in_menu_string"];
|
89 |
+
|
90 |
+
$cpt_show_in_menu = ( $cpt_post_type["show_in_menu"] == 1 ) ? true : false;
|
91 |
+
$cpt_show_in_menu = ( $cpt_post_type["show_in_menu_string"] ) ? $cpt_post_type["show_in_menu_string"] : $cpt_show_in_menu;
|
92 |
+
|
93 |
+
//set custom label values
|
94 |
+
$cpt_labels['name'] = $cpt_label;
|
95 |
+
$cpt_labels['singular_name'] = $cpt_post_type["singular_label"];
|
96 |
+
$cpt_labels['menu_name'] = ( $cpt_post_type[2]["menu_name"] ) ? $cpt_post_type[2]["menu_name"] : $cpt_label;
|
97 |
+
$cpt_labels['add_new'] = ( $cpt_post_type[2]["add_new"] ) ? $cpt_post_type[2]["add_new"] : 'Add ' .$cpt_singular;
|
98 |
+
$cpt_labels['add_new_item'] = ( $cpt_post_type[2]["add_new_item"] ) ? $cpt_post_type[2]["add_new_item"] : 'Add New ' .$cpt_singular;
|
99 |
+
$cpt_labels['edit'] = ( $cpt_post_type[2]["edit"] ) ? $cpt_post_type[2]["edit"] : 'Edit';
|
100 |
+
$cpt_labels['edit_item'] = ( $cpt_post_type[2]["edit_item"] ) ? $cpt_post_type[2]["edit_item"] : 'Edit ' .$cpt_singular;
|
101 |
+
$cpt_labels['new_item'] = ( $cpt_post_type[2]["new_item"] ) ? $cpt_post_type[2]["new_item"] : 'New ' .$cpt_singular;
|
102 |
+
$cpt_labels['view'] = ( $cpt_post_type[2]["view"] ) ? $cpt_post_type[2]["view"] : 'View ' .$cpt_singular;
|
103 |
+
$cpt_labels['view_item'] = ( $cpt_post_type[2]["view_item"] ) ? $cpt_post_type[2]["view_item"] : 'View ' .$cpt_singular;
|
104 |
+
$cpt_labels['search_items'] = ( $cpt_post_type[2]["search_items"] ) ? $cpt_post_type[2]["search_items"] : 'Search ' .$cpt_label;
|
105 |
+
$cpt_labels['not_found'] = ( $cpt_post_type[2]["not_found"] ) ? $cpt_post_type[2]["not_found"] : 'No ' .$cpt_label. ' Found';
|
106 |
+
$cpt_labels['not_found_in_trash'] = ( $cpt_post_type[2]["not_found_in_trash"] ) ? $cpt_post_type[2]["not_found_in_trash"] : 'No ' .$cpt_label. ' Found in Trash';
|
107 |
+
$cpt_labels['parent'] = ( $cpt_post_type[2]["parent"] ) ? $cpt_post_type[2]["parent"] : 'Parent ' .$cpt_singular;
|
108 |
+
|
109 |
+
register_post_type( $cpt_post_type["name"], array( 'label' => __($cpt_label),
|
110 |
+
'public' => get_disp_boolean($cpt_post_type["public"]),
|
111 |
+
'singular_label' => $cpt_post_type["singular_label"],
|
112 |
+
'show_ui' => get_disp_boolean($cpt_post_type["show_ui"]),
|
113 |
+
'has_archive' => get_disp_boolean($cpt_post_type["has_archive"]),
|
114 |
+
'show_in_menu' => $cpt_show_in_menu,
|
115 |
+
'capability_type' => $cpt_post_type["capability_type"],
|
116 |
+
'hierarchical' => get_disp_boolean($cpt_post_type["hierarchical"]),
|
117 |
+
'rewrite' => array('slug' => $cpt_rewrite_slug),
|
118 |
+
'query_var' => get_disp_boolean($cpt_post_type["query_var"]),
|
119 |
+
'description' => esc_html($cpt_post_type["description"]),
|
120 |
+
'menu_position' => $cpt_menu_position,
|
121 |
+
'supports' => $cpt_supports,
|
122 |
+
'taxonomies' => $cpt_taxonomies,
|
123 |
+
'labels' => $cpt_labels
|
124 |
+
) );
|
125 |
+
}
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
|
130 |
+
function cpt_create_custom_taxonomies() {
|
131 |
+
//register custom taxonomies
|
132 |
+
$cpt_tax_types = get_option('cpt_custom_tax_types');
|
133 |
+
|
134 |
+
//check if option value is an array before proceeding
|
135 |
+
if ( is_array( $cpt_tax_types ) ) {
|
136 |
+
foreach ($cpt_tax_types as $cpt_tax_type) {
|
137 |
+
|
138 |
+
//set custom taxonomy values
|
139 |
+
$cpt_label = ( !$cpt_tax_type["label"] ) ? esc_html($cpt_tax_type["name"]) : esc_html($cpt_tax_type["label"]);
|
140 |
+
$cpt_singular_label = ( !$cpt_tax_type["singular_label"] ) ? esc_html($cpt_tax_type["name"]) : esc_html($cpt_tax_type["singular_label"]);
|
141 |
+
$cpt_rewrite_slug = ( !$cpt_tax_type["rewrite_slug"] ) ? esc_html($cpt_tax_type["name"]) : esc_html($cpt_tax_type["rewrite_slug"]);
|
142 |
+
$cpt_post_types = ( !$cpt_tax_type[1] ) ? $cpt_tax_type["cpt_name"] : $cpt_tax_type[1];
|
143 |
+
|
144 |
+
//set custom label values
|
145 |
+
$cpt_labels['name'] = $cpt_label;
|
146 |
+
$cpt_labels['singular_name'] = $cpt_tax_type["singular_label"];
|
147 |
+
$cpt_labels['search_items'] = ( $cpt_tax_type[0]["search_items"] ) ? $cpt_tax_type[0]["search_items"] : 'Search ' .$cpt_label;
|
148 |
+
$cpt_labels['popular_items'] = ( $cpt_tax_type[0]["popular_items"] ) ? $cpt_tax_type[0]["popular_items"] : 'Popular ' .$cpt_label;
|
149 |
+
$cpt_labels['all_items'] = ( $cpt_tax_type[0]["all_items"] ) ? $cpt_tax_type[0]["all_items"] : 'All ' .$cpt_label;
|
150 |
+
$cpt_labels['parent_item'] = ( $cpt_tax_type[0]["parent_item"] ) ? $cpt_tax_type[0]["parent_item"] : 'Parent ' .$cpt_singular_label;
|
151 |
+
$cpt_labels['parent_item_colon'] = ( $cpt_tax_type[0]["parent_item_colon"] ) ? $cpt_tax_type[0]["parent_item_colon"] : 'Parent ' .$cpt_singular_label. ':';
|
152 |
+
$cpt_labels['edit_item'] = ( $cpt_tax_type[0]["edit_item"] ) ? $cpt_tax_type[0]["edit_item"] : 'Edit ' .$cpt_singular_label;
|
153 |
+
$cpt_labels['update_item'] = ( $cpt_tax_type[0]["update_item"] ) ? $cpt_tax_type[0]["update_item"] : 'Update ' .$cpt_singular_label;
|
154 |
+
$cpt_labels['add_new_item'] = ( $cpt_tax_type[0]["add_new_item"] ) ? $cpt_tax_type[0]["add_new_item"] : 'Add New ' .$cpt_singular_label;
|
155 |
+
$cpt_labels['new_item_name'] = ( $cpt_tax_type[0]["new_item_name"] ) ? $cpt_tax_type[0]["new_item_name"] : 'New ' .$cpt_singular_label. ' Name';
|
156 |
+
$cpt_labels['separate_items_with_commas'] = ( $cpt_tax_type[0]["separate_items_with_commas"] ) ? $cpt_tax_type[0]["separate_items_with_commas"] : 'Separate ' .$cpt_label. ' with commas';
|
157 |
+
$cpt_labels['add_or_remove_items'] = ( $cpt_tax_type[0]["add_or_remove_items"] ) ? $cpt_tax_type[0]["add_or_remove_items"] : 'Add or remove ' .$cpt_label;
|
158 |
+
$cpt_labels['choose_from_most_used'] = ( $cpt_tax_type[0]["choose_from_most_used"] ) ? $cpt_tax_type[0]["choose_from_most_used"] : 'Choose from the most used ' .$cpt_label;
|
159 |
+
|
160 |
+
//register our custom taxonomies
|
161 |
+
register_taxonomy( $cpt_tax_type["name"],
|
162 |
+
$cpt_post_types,
|
163 |
+
array( 'hierarchical' => get_disp_boolean($cpt_tax_type["hierarchical"]),
|
164 |
+
'label' => $cpt_label,
|
165 |
+
'show_ui' => get_disp_boolean($cpt_tax_type["show_ui"]),
|
166 |
+
'query_var' => get_disp_boolean($cpt_tax_type["query_var"]),
|
167 |
+
'rewrite' => array('slug' => $cpt_rewrite_slug),
|
168 |
+
'singular_label' => $cpt_singular_label,
|
169 |
+
'labels' => $cpt_labels
|
170 |
+
) );
|
171 |
+
|
172 |
+
}
|
173 |
+
}
|
174 |
+
}
|
175 |
+
|
176 |
+
//delete custom post type or custom taxonomy
|
177 |
+
function cpt_delete_post_type() {
|
178 |
+
global $CPT_URL;
|
179 |
+
|
180 |
+
//check if we are deleting a custom post type
|
181 |
+
If(isset($_GET['deltype'])) {
|
182 |
+
check_admin_referer('cpt_delete_post_type');
|
183 |
+
$delType = intval($_GET['deltype']);
|
184 |
+
$cpt_post_types = get_option('cpt_custom_post_types');
|
185 |
+
|
186 |
+
unset($cpt_post_types[$delType]);
|
187 |
+
|
188 |
+
$cpt_post_types = array_values($cpt_post_types);
|
189 |
+
|
190 |
+
update_option('cpt_custom_post_types', $cpt_post_types);
|
191 |
+
|
192 |
+
If (isset($_GET['return'])) {
|
193 |
+
$RETURN_URL = cpt_check_return(esc_attr($_GET['return']));
|
194 |
+
}Else{
|
195 |
+
$RETURN_URL = $CPT_URL;
|
196 |
+
}
|
197 |
+
|
198 |
+
wp_redirect($RETURN_URL .'&cpt_msg=del');
|
199 |
+
}
|
200 |
+
|
201 |
+
//check if we are deleting a custom taxonomy
|
202 |
+
If(isset($_GET['deltax'])) {
|
203 |
+
check_admin_referer('cpt_delete_tax');
|
204 |
+
|
205 |
+
$delType = intval($_GET['deltax']);
|
206 |
+
$cpt_taxonomies = get_option('cpt_custom_tax_types');
|
207 |
+
|
208 |
+
unset($cpt_taxonomies[$delType]);
|
209 |
+
|
210 |
+
$cpt_taxonomies = array_values($cpt_taxonomies);
|
211 |
+
|
212 |
+
update_option('cpt_custom_tax_types', $cpt_taxonomies);
|
213 |
+
|
214 |
+
If (isset($_GET['return'])) {
|
215 |
+
$RETURN_URL = cpt_check_return(esc_attr($_GET['return']));
|
216 |
+
}Else{
|
217 |
+
$RETURN_URL = $CPT_URL;
|
218 |
+
}
|
219 |
+
|
220 |
+
wp_redirect($RETURN_URL .'&cpt_msg=del');
|
221 |
+
}
|
222 |
+
|
223 |
+
}
|
224 |
+
|
225 |
+
function cpt_register_settings() {
|
226 |
+
global $cpt_error, $CPT_URL;
|
227 |
+
|
228 |
+
If (isset($_POST['cpt_edit'])) {
|
229 |
+
//edit a custom post type
|
230 |
+
check_admin_referer('cpt_add_custom_post_type');
|
231 |
+
|
232 |
+
//custom post type to edit
|
233 |
+
$cpt_edit = intval($_POST['cpt_edit']);
|
234 |
+
|
235 |
+
//edit the custom post type
|
236 |
+
$cpt_form_fields = $_POST['cpt_custom_post_type'];
|
237 |
+
|
238 |
+
//add support checkbox values to array
|
239 |
+
$cpt_supports = ( isset( $_POST['cpt_supports'] ) ) ? $_POST['cpt_supports'] : null;
|
240 |
+
array_push($cpt_form_fields, $cpt_supports);
|
241 |
+
|
242 |
+
//add taxonomies support checkbox values to array
|
243 |
+
$cpt_addon_taxes = ( isset( $_POST['cpt_addon_taxes'] ) ) ? $_POST['cpt_addon_taxes'] : null;
|
244 |
+
array_push($cpt_form_fields, $cpt_addon_taxes);
|
245 |
+
|
246 |
+
//add label values to array
|
247 |
+
array_push($cpt_form_fields, $_POST['cpt_labels']);
|
248 |
+
|
249 |
+
//load custom posts saved in WP
|
250 |
+
$cpt_options = get_option('cpt_custom_post_types');
|
251 |
+
|
252 |
+
If (is_array($cpt_options)) {
|
253 |
+
|
254 |
+
unset($cpt_options[$cpt_edit]);
|
255 |
+
|
256 |
+
//insert new custom post type into the array
|
257 |
+
array_push($cpt_options, $cpt_form_fields);
|
258 |
+
|
259 |
+
$cpt_options = array_values($cpt_options);
|
260 |
+
|
261 |
+
//save custom post types
|
262 |
+
update_option('cpt_custom_post_types', $cpt_options);
|
263 |
+
|
264 |
+
If (isset($_GET['return'])) {
|
265 |
+
$RETURN_URL = cpt_check_return(esc_attr($_GET['return']));
|
266 |
+
}Else{
|
267 |
+
$RETURN_URL = $CPT_URL;
|
268 |
+
}
|
269 |
+
|
270 |
+
wp_redirect($RETURN_URL);
|
271 |
+
|
272 |
+
}
|
273 |
+
|
274 |
+
}ElseIf(isset($_POST['cpt_submit'])) {
|
275 |
+
//create a new custom post type
|
276 |
+
check_admin_referer('cpt_add_custom_post_type');
|
277 |
+
|
278 |
+
//retrieve new custom post type values
|
279 |
+
$cpt_form_fields = $_POST['cpt_custom_post_type'];
|
280 |
+
|
281 |
+
If (empty($cpt_form_fields["name"])) {
|
282 |
+
If (isset($_GET['return'])) {
|
283 |
+
$RETURN_URL = cpt_check_return(esc_attr($_GET['return']));
|
284 |
+
}Else{
|
285 |
+
$RETURN_URL = $CPT_URL;
|
286 |
+
}
|
287 |
+
|
288 |
+
wp_redirect($RETURN_URL .'&cpt_error=1');
|
289 |
+
exit();
|
290 |
+
}
|
291 |
+
|
292 |
+
//add support checkbox values to array
|
293 |
+
$cpt_supports = ( isset( $_POST['cpt_supports'] ) ) ? $_POST['cpt_supports'] : null;
|
294 |
+
array_push($cpt_form_fields, $cpt_supports);
|
295 |
+
|
296 |
+
//add taxonomies support checkbox values to array
|
297 |
+
$cpt_addon_taxes = ( isset( $_POST['cpt_addon_taxes'] ) ) ? $_POST['cpt_addon_taxes'] : null;
|
298 |
+
array_push($cpt_form_fields, $cpt_addon_taxes);
|
299 |
+
|
300 |
+
//add label values to array
|
301 |
+
array_push($cpt_form_fields, $_POST['cpt_labels']);
|
302 |
+
|
303 |
+
//load custom posts saved in WP
|
304 |
+
$cpt_options = get_option('cpt_custom_post_types');
|
305 |
+
|
306 |
+
//check if option exists, if not create an array for it
|
307 |
+
If (!is_array($cpt_options)) {
|
308 |
+
$cpt_options = array();
|
309 |
+
}
|
310 |
+
|
311 |
+
//insert new custom post type into the array
|
312 |
+
array_push($cpt_options, $cpt_form_fields);
|
313 |
+
|
314 |
+
//save new custom post type array in the CPT option
|
315 |
+
update_option('cpt_custom_post_types', $cpt_options);
|
316 |
+
|
317 |
+
If (isset($_GET['return'])) {
|
318 |
+
$RETURN_URL = cpt_check_return(esc_attr($_GET['return']));
|
319 |
+
}Else{
|
320 |
+
$RETURN_URL = $CPT_URL;
|
321 |
+
}
|
322 |
+
|
323 |
+
wp_redirect($RETURN_URL .'&cpt_msg=1');
|
324 |
+
}
|
325 |
+
|
326 |
+
If (isset($_POST['cpt_edit_tax'])) {
|
327 |
+
//edit a custom taxonomy
|
328 |
+
check_admin_referer('cpt_add_custom_taxonomy');
|
329 |
+
|
330 |
+
//custom taxonomy to edit
|
331 |
+
$cpt_edit = intval($_POST['cpt_edit_tax']);
|
332 |
+
|
333 |
+
//edit the custom taxonomy
|
334 |
+
$cpt_form_fields = $_POST['cpt_custom_tax'];
|
335 |
+
|
336 |
+
//add label values to array
|
337 |
+
array_push($cpt_form_fields, $_POST['cpt_tax_labels']);
|
338 |
+
|
339 |
+
//add attached post type values to array
|
340 |
+
array_push($cpt_form_fields, $_POST['cpt_post_types']);
|
341 |
+
|
342 |
+
//load custom posts saved in WP
|
343 |
+
$cpt_options = get_option('cpt_custom_tax_types');
|
344 |
+
|
345 |
+
If (is_array($cpt_options)) {
|
346 |
+
|
347 |
+
unset($cpt_options[$cpt_edit]);
|
348 |
+
|
349 |
+
//insert new custom post type into the array
|
350 |
+
array_push($cpt_options, $cpt_form_fields);
|
351 |
+
|
352 |
+
$cpt_options = array_values($cpt_options);
|
353 |
+
|
354 |
+
//save custom post types
|
355 |
+
update_option('cpt_custom_tax_types', $cpt_options);
|
356 |
+
|
357 |
+
If (isset($_GET['return'])) {
|
358 |
+
$RETURN_URL = cpt_check_return(esc_attr($_GET['return']));
|
359 |
+
}Else{
|
360 |
+
$RETURN_URL = $CPT_URL;
|
361 |
+
}
|
362 |
+
|
363 |
+
wp_redirect($RETURN_URL);
|
364 |
+
|
365 |
+
}
|
366 |
+
|
367 |
+
}ElseIf(isset($_POST['cpt_add_tax'])) {
|
368 |
+
//create new custom taxonomy
|
369 |
+
check_admin_referer('cpt_add_custom_taxonomy');
|
370 |
+
|
371 |
+
//retrieve new custom taxonomy values
|
372 |
+
$cpt_form_fields = $_POST['cpt_custom_tax'];
|
373 |
+
|
374 |
+
//verify required fields are filled out
|
375 |
+
If (empty($cpt_form_fields["name"])) {
|
376 |
+
If (isset($_GET['return'])) {
|
377 |
+
$RETURN_URL = cpt_check_return(esc_attr($_GET['return']));
|
378 |
+
}Else{
|
379 |
+
$RETURN_URL = $CPT_URL;
|
380 |
+
}
|
381 |
+
|
382 |
+
wp_redirect($RETURN_URL .'&cpt_error=2');
|
383 |
+
exit();
|
384 |
+
}elseif ( empty( $_POST['cpt_post_types'] ) ) {
|
385 |
+
If (isset($_GET['return'])) {
|
386 |
+
$RETURN_URL = cpt_check_return(esc_attr($_GET['return']));
|
387 |
+
}Else{
|
388 |
+
$RETURN_URL = $CPT_URL;
|
389 |
+
}
|
390 |
+
|
391 |
+
wp_redirect($RETURN_URL .'&cpt_error=3');
|
392 |
+
exit();
|
393 |
+
}
|
394 |
+
|
395 |
+
//add label values to array
|
396 |
+
array_push($cpt_form_fields, $_POST['cpt_tax_labels']);
|
397 |
+
|
398 |
+
//add attached post type values to array
|
399 |
+
array_push($cpt_form_fields, $_POST['cpt_post_types']);
|
400 |
+
|
401 |
+
//load custom taxonomies saved in WP
|
402 |
+
$cpt_options = get_option('cpt_custom_tax_types');
|
403 |
+
|
404 |
+
//check if option exists, if not create an array for it
|
405 |
+
If (!is_array($cpt_options)) {
|
406 |
+
$cpt_options = array();
|
407 |
+
}
|
408 |
+
|
409 |
+
//insert new custom taxonomy into the array
|
410 |
+
array_push($cpt_options, $cpt_form_fields);
|
411 |
+
|
412 |
+
//save new custom taxonomy array in the CPT option
|
413 |
+
update_option('cpt_custom_tax_types', $cpt_options);
|
414 |
+
|
415 |
+
If (isset($_GET['return'])) {
|
416 |
+
$RETURN_URL = cpt_check_return(esc_attr($_GET['return']));
|
417 |
+
}Else{
|
418 |
+
$RETURN_URL = $CPT_URL;
|
419 |
+
}
|
420 |
+
|
421 |
+
wp_redirect($RETURN_URL .'&cpt_msg=2');
|
422 |
+
|
423 |
+
}
|
424 |
+
}
|
425 |
+
|
426 |
+
//main welcome/settings page
|
427 |
+
function cpt_settings() {
|
428 |
+
global $CPT_URL, $wp_post_types;
|
429 |
+
|
430 |
+
//flush rewrite rules
|
431 |
+
flush_rewrite_rules();
|
432 |
+
?>
|
433 |
+
<div class="wrap">
|
434 |
+
<?php screen_icon( 'plugins' ); ?>
|
435 |
+
<h2><?php _e('Custom Post Type UI', 'cpt-plugin'); ?></h2>
|
436 |
+
<p><?php _e('Plugin version', 'cpt-plugin'); ?>: <?php echo CPT_VERSION; ?></p>
|
437 |
+
<p><?php _e('WordPress version', 'cpt-plugin'); ?>: <?php echo get_bloginfo('version'); ?></p>
|
438 |
+
<table border="0" width="60%">
|
439 |
+
<tr>
|
440 |
+
<td colspan="3"><h2><?php _e( 'Help Support This Plugin!', 'cpt-plugin' ); ?></h2></td>
|
441 |
+
</tr>
|
442 |
+
<tr>
|
443 |
+
<td width="33%"><h3><?php _e( 'PayPal Donation', 'cpt-plugin' ); ?></h3></td>
|
444 |
+
<td width="33%"><h3><?php _e( 'Professional WordPress', 'cpt-plugin' ); ?></h3></td>
|
445 |
+
<td width="33%"><h3><?php _e( 'Professional WordPress<br />Plugin Development', 'cpt-plugin' ); ?></h3></td>
|
446 |
+
</tr>
|
447 |
+
<tr>
|
448 |
+
<td valign="top" width="33%">
|
449 |
+
<p>Please donate to the development<br />of Custom Post Type UI:
|
450 |
+
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
451 |
+
<input type="hidden" name="cmd" value="_s-xclick">
|
452 |
+
<input type="hidden" name="hosted_button_id" value="YJEDXPHE49Q3U">
|
453 |
+
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
454 |
+
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
455 |
+
</form>
|
456 |
+
</p>
|
457 |
+
</td>
|
458 |
+
<td valign="top" width="33%"><a href="http://bit.ly/pro-wp" target="_blank"><img src="<?php echo plugins_url( '/images/professional-wordpress.jpg', __FILE__ ); ?>" width="200"></a><br />The leading book on WordPress design and development!</td>
|
459 |
+
<td valign="top" width="33%"><a href="http://amzn.to/plugindevbook" target="_blank"><img src="<?php echo plugins_url( '/images/professional-wordpress-plugin-development.png', __FILE__ ); ?>" width="200"></a><br />Check out my new book all about plugin development!</td>
|
460 |
+
</tr>
|
461 |
+
</table>
|
462 |
+
|
463 |
+
<h3><?php _e('Frequently Asked Questions', 'cpt-plugin'); ?></h3>
|
464 |
+
<p>Q: <strong>How can I display content from a custom post type on my website?</strong></p>
|
465 |
+
<p>
|
466 |
+
A: Justin Tadlock has written some great posts on the topic:<br />
|
467 |
+
<a href="http://justintadlock.com/archives/2010/02/02/showing-custom-post-types-on-your-home-blog-page" target="_blank">Showing Custom Post Types on your Home Page</a><br />
|
468 |
+
<a href="http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress" target="_blank">Custom Post Types in WordPress</a>
|
469 |
+
</p>
|
470 |
+
<p>Q: <strong>How can I add custom meta boxes to my custom post types?</strong></p>
|
471 |
+
<p>A: The Custom Field Template plugin does a great job at creating custom meta boxes and fully supports custom post types: <a href="http://wordpress.org/extend/plugins/custom-field-template/" target="_blank">http://wordpress.org/extend/plugins/custom-field-template/</a></p>
|
472 |
+
<p>Q: <strong>I changed my custom post type name and now I can't get to my posts</strong></p>
|
473 |
+
<p>A: You can either change the custom post type name back to the original name or try the Post Type Switcher plugin: <a href="http://wordpress.org/extend/plugins/post-type-switcher/" target="_blank">http://wordpress.org/extend/plugins/post-type-switcher/</a></p>
|
474 |
+
<h3><?php _e('Slightly Outdated Demo Video', 'cpt-plugin'); ?></h3>
|
475 |
+
<object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=10187055&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=ff9933&fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=10187055&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=ff9933&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object>
|
476 |
+
<h3><?php _e( 'Latest WebDevStudios.com News', 'cpt-plugin' ); ?></h3>
|
477 |
+
<?php
|
478 |
+
echo '<div class="cp-rss-widget">';
|
479 |
+
|
480 |
+
wp_widget_rss_output( array(
|
481 |
+
'url' => esc_url( 'http://webdevstudios.com/feed/' ),
|
482 |
+
'title' => __( 'WebDevStudios.com News', 'cpt-plugin' ),
|
483 |
+
'items' => 5,
|
484 |
+
'show_summary' => 1,
|
485 |
+
'show_author' => 0,
|
486 |
+
'show_date' => 1
|
487 |
+
) );
|
488 |
+
|
489 |
+
echo '</div>';
|
490 |
+
?>
|
491 |
+
</div>
|
492 |
+
<?php
|
493 |
+
//load footer
|
494 |
+
cpt_footer();
|
495 |
+
}
|
496 |
+
|
497 |
+
//manage custom post types page
|
498 |
+
function cpt_manage_cpt() {
|
499 |
+
global $CPT_URL;
|
500 |
+
|
501 |
+
$MANAGE_URL = cpt_check_return( 'add' );
|
502 |
+
|
503 |
+
?>
|
504 |
+
<div class="wrap">
|
505 |
+
<?php
|
506 |
+
//check for success/error messages
|
507 |
+
If (isset($_GET['cpt_msg']) && $_GET['cpt_msg']=='del') { ?>
|
508 |
+
<div id="message" class="updated">
|
509 |
+
<?php _e('Custom post type deleted successfully', 'cpt-plugin'); ?>
|
510 |
+
</div>
|
511 |
+
<?php
|
512 |
+
}
|
513 |
+
?>
|
514 |
+
<?php screen_icon( 'plugins' ); ?>
|
515 |
+
<h2><?php _e('Manage Custom Post Types', 'cpt-plugin') ?></h2>
|
516 |
+
<p><?php _e('Deleting custom post types does <strong>NOT</strong> delete any content added to those post types. You can easily recreate your post types and the content will still exist.', 'cpt-plugin') ?></p>
|
517 |
+
<?php
|
518 |
+
$cpt_post_types = get_option('cpt_custom_post_types');
|
519 |
+
If (is_array($cpt_post_types)) {
|
520 |
+
?>
|
521 |
+
<table width="100%" class="widefat">
|
522 |
+
<thead>
|
523 |
+
<tr>
|
524 |
+
<th><?php _e('Action', 'cpt-plugin');?></th>
|
525 |
+
<th><?php _e('Name', 'cpt-plugin');?></th>
|
526 |
+
<th><?php _e('Label', 'cpt-plugin');?></th>
|
527 |
+
<th><?php _e('Public', 'cpt-plugin');?></th>
|
528 |
+
<th><?php _e('Show UI', 'cpt-plugin');?></th>
|
529 |
+
<th><?php _e('Hierarchical', 'cpt-plugin');?></th>
|
530 |
+
<th><?php _e('Rewrite', 'cpt-plugin');?></th>
|
531 |
+
<th><?php _e('Rewrite Slug', 'cpt-plugin');?></th>
|
532 |
+
<th><?php _e('Total Published', 'cpt-plugin');?></th>
|
533 |
+
<th><?php _e('Total Drafts', 'cpt-plugin');?></th>
|
534 |
+
<th><?php _e('Supports', 'cpt-plugin');?></th>
|
535 |
+
</tr>
|
536 |
+
</thead>
|
537 |
+
<tfoot>
|
538 |
+
<tr>
|
539 |
+
<th><?php _e('Action', 'cpt-plugin');?></th>
|
540 |
+
<th><?php _e('Name', 'cpt-plugin');?></th>
|
541 |
+
<th><?php _e('Label', 'cpt-plugin');?></th>
|
542 |
+
<th><?php _e('Public', 'cpt-plugin');?></th>
|
543 |
+
<th><?php _e('Show UI', 'cpt-plugin');?></th>
|
544 |
+
<th><?php _e('Hierarchical', 'cpt-plugin');?></th>
|
545 |
+
<th><?php _e('Rewrite', 'cpt-plugin');?></th>
|
546 |
+
<th><?php _e('Rewrite Slug', 'cpt-plugin');?></th>
|
547 |
+
<th><?php _e('Total Published', 'cpt-plugin');?></th>
|
548 |
+
<th><?php _e('Total Drafts', 'cpt-plugin');?></th>
|
549 |
+
<th><?php _e('Supports', 'cpt-plugin');?></th>
|
550 |
+
</tr>
|
551 |
+
</tfoot>
|
552 |
+
<?php
|
553 |
+
$thecounter=0;
|
554 |
+
$cpt_names = array();
|
555 |
+
foreach ($cpt_post_types as $cpt_post_type) {
|
556 |
+
|
557 |
+
$del_url = cpt_check_return( 'cpt' ) .'&deltype=' .$thecounter .'&return=cpt';
|
558 |
+
$del_url = ( function_exists('wp_nonce_url') ) ? wp_nonce_url($del_url, 'cpt_delete_post_type') : $del_url;
|
559 |
+
|
560 |
+
$edit_url = $MANAGE_URL .'&edittype=' .$thecounter .'&return=cpt';
|
561 |
+
$edit_url = ( function_exists('wp_nonce_url') ) ? wp_nonce_url($edit_url, 'cpt_edit_post_type') : $edit_url;
|
562 |
+
|
563 |
+
$cpt_counts = wp_count_posts($cpt_post_type["name"]);
|
564 |
+
|
565 |
+
$rewrite_slug = ( $cpt_post_type["rewrite_slug"] ) ? $cpt_post_type["rewrite_slug"] : $cpt_post_type["name"];
|
566 |
+
?>
|
567 |
+
<tr>
|
568 |
+
<td valign="top"><a href="<?php echo $del_url; ?>">Delete</a> / <a href="<?php echo $edit_url; ?>">Edit</a> / <a href="#" class="comment_button" id="<?php echo $thecounter; ?>">Get Code</a></td>
|
569 |
+
<td valign="top"><?php echo stripslashes($cpt_post_type["name"]); ?></td>
|
570 |
+
<td valign="top"><?php echo stripslashes($cpt_post_type["label"]); ?></td>
|
571 |
+
<td valign="top"><?php echo disp_boolean($cpt_post_type["public"]); ?></td>
|
572 |
+
<td valign="top"><?php echo disp_boolean($cpt_post_type["show_ui"]); ?></td>
|
573 |
+
<td valign="top"><?php echo disp_boolean($cpt_post_type["hierarchical"]); ?></td>
|
574 |
+
<td valign="top"><?php echo disp_boolean($cpt_post_type["rewrite"]); ?></td>
|
575 |
+
<td valign="top"><?php echo $rewrite_slug; ?></td>
|
576 |
+
<td valign="top"><?php echo $cpt_counts->publish; ?></td>
|
577 |
+
<td valign="top"><?php echo $cpt_counts->draft; ?></td>
|
578 |
+
<td>
|
579 |
+
<?php
|
580 |
+
If (is_array($cpt_post_type[0])) {
|
581 |
+
foreach ($cpt_post_type[0] as $cpt_supports) {
|
582 |
+
echo $cpt_supports .'<br />';
|
583 |
+
}
|
584 |
+
}
|
585 |
+
?>
|
586 |
+
</td>
|
587 |
+
</tr>
|
588 |
+
<tr>
|
589 |
+
<td colspan="12">
|
590 |
+
<div style="display:none;" id="slidepanel<?php echo $thecounter; ?>">
|
591 |
+
<?php
|
592 |
+
//display register_post_type code
|
593 |
+
$custom_post_type='';
|
594 |
+
$cpt_support_array='';
|
595 |
+
$cpt_tax_array='';
|
596 |
+
|
597 |
+
$cpt_label = ( !$cpt_post_type["label"] ) ? esc_html($cpt_post_type["name"]) : esc_html($cpt_post_type["label"]);
|
598 |
+
$cpt_singular = ( !$cpt_post_type["singular_label"] ) ? $cpt_label : esc_html($cpt_post_type["singular_label"]);
|
599 |
+
$cpt_rewrite_slug = ( !$cpt_post_type["rewrite_slug"] ) ? esc_html($cpt_post_type["name"]) : esc_html($cpt_post_type["rewrite_slug"]);
|
600 |
+
$cpt_menu_position = ( !$cpt_post_type["menu_position"] ) ? null : intval($cpt_post_type["menu_position"]);
|
601 |
+
$cpt_show_in_menu = ( $cpt_post_type["show_in_menu"] == 1 ) ? 'true' : 'false';
|
602 |
+
$cpt_show_in_menu = ( $cpt_post_type["show_in_menu_string"] ) ? '\''.$cpt_post_type["show_in_menu_string"].'\'' : $cpt_show_in_menu;
|
603 |
+
|
604 |
+
//set custom label values
|
605 |
+
$cpt_labels['name'] = $cpt_label;
|
606 |
+
$cpt_labels['singular_name'] = $cpt_post_type["singular_label"];
|
607 |
+
$cpt_labels['menu_name'] = ( $cpt_post_type[2]["menu_name"] ) ? $cpt_post_type[2]["menu_name"] : $cpt_label;
|
608 |
+
$cpt_labels['add_new'] = ( $cpt_post_type[2]["add_new"] ) ? $cpt_post_type[2]["add_new"] : 'Add ' .$cpt_singular;
|
609 |
+
$cpt_labels['add_new_item'] = ( $cpt_post_type[2]["add_new_item"] ) ? $cpt_post_type[2]["add_new_item"] : 'Add New ' .$cpt_singular;
|
610 |
+
$cpt_labels['edit'] = ( $cpt_post_type[2]["edit"] ) ? $cpt_post_type[2]["edit"] : 'Edit';
|
611 |
+
$cpt_labels['edit_item'] = ( $cpt_post_type[2]["edit_item"] ) ? $cpt_post_type[2]["edit_item"] : 'Edit ' .$cpt_singular;
|
612 |
+
$cpt_labels['new_item'] = ( $cpt_post_type[2]["new_item"] ) ? $cpt_post_type[2]["new_item"] : 'New ' .$cpt_singular;
|
613 |
+
$cpt_labels['view'] = ( $cpt_post_type[2]["view"] ) ? $cpt_post_type[2]["view"] : 'View ' .$cpt_singular;
|
614 |
+
$cpt_labels['view_item'] = ( $cpt_post_type[2]["view_item"] ) ? $cpt_post_type[2]["view_item"] : 'View ' .$cpt_singular;
|
615 |
+
$cpt_labels['search_items'] = ( $cpt_post_type[2]["search_items"] ) ? $cpt_post_type[2]["search_items"] : 'Search ' .$cpt_label;
|
616 |
+
$cpt_labels['not_found'] = ( $cpt_post_type[2]["not_found"] ) ? $cpt_post_type[2]["not_found"] : 'No ' .$cpt_label. ' Found';
|
617 |
+
$cpt_labels['not_found_in_trash'] = ( $cpt_post_type[2]["not_found_in_trash"] ) ? $cpt_post_type[2]["not_found_in_trash"] : 'No ' .$cpt_label. ' Found in Trash';
|
618 |
+
$cpt_labels['parent'] = ( $cpt_post_type[2]["parent"] ) ? $cpt_post_type[2]["parent"] : 'Parent ' .$cpt_singular;
|
619 |
+
|
620 |
+
if( is_array( $cpt_post_type[0] ) ) {
|
621 |
+
foreach ( $cpt_post_type[0] as $cpt_supports ) {
|
622 |
+
//build supports variable
|
623 |
+
$cpt_support_array .= '\''.$cpt_supports.'\',';
|
624 |
+
}
|
625 |
+
}
|
626 |
+
|
627 |
+
if( is_array( $cpt_post_type[1] ) ) {
|
628 |
+
foreach ( $cpt_post_type[1] as $cpt_taxes ) {
|
629 |
+
//build taxonomies variable
|
630 |
+
$cpt_tax_array .= '\''.$cpt_taxes.'\',';
|
631 |
+
}
|
632 |
+
}
|
633 |
+
|
634 |
+
$custom_post_type = 'register_post_type(\'' .$cpt_post_type["name"]. '\', array( \'label\' => \''.__($cpt_label).'\',';
|
635 |
+
$custom_post_type .= '\'description\' => \''. $cpt_post_type["description"].'\',';
|
636 |
+
$custom_post_type .= '\'public\' => '.disp_boolean($cpt_post_type["public"]).',';
|
637 |
+
$custom_post_type .= '\'show_ui\' => '.disp_boolean($cpt_post_type["show_ui"]).',';
|
638 |
+
$custom_post_type .= '\'show_in_menu\' => ' .$cpt_show_in_menu .',';
|
639 |
+
$custom_post_type .= '\'capability_type\' => \''.$cpt_post_type["capability_type"].'\',';
|
640 |
+
$custom_post_type .= '\'hierarchical\' => '.disp_boolean($cpt_post_type["hierarchical"]).',';
|
641 |
+
$custom_post_type .= '\'rewrite\' => array(\'slug\' => \'' .$cpt_post_type["rewrite_slug"]. '\'),';
|
642 |
+
$custom_post_type .= '\'query_var\' => '. disp_boolean($cpt_post_type["query_var"]).',';
|
643 |
+
|
644 |
+
if ( $cpt_post_type["has_archive"] ) {
|
645 |
+
$custom_post_type .= '\'has_archive\' => '. disp_boolean( $cpt_post_type["has_archive"] ).',';
|
646 |
+
}
|
647 |
+
|
648 |
+
if ( $cpt_post_type["menu_position"] ) {
|
649 |
+
$custom_post_type .= '\'menu_position\' => '. $cpt_post_type["menu_position"].',';
|
650 |
+
}
|
651 |
+
|
652 |
+
$custom_post_type .= '\'supports\' => array(' .$cpt_support_array.'),';
|
653 |
+
|
654 |
+
if ( $cpt_tax_array ) {
|
655 |
+
$custom_post_type .= '\'taxonomies\' => array(' .$cpt_tax_array.'),';
|
656 |
+
}
|
657 |
+
|
658 |
+
if ( $cpt_labels ) {
|
659 |
+
$custom_post_type .= '\'labels\' => '.var_export( $cpt_labels, true ).',';
|
660 |
+
}
|
661 |
+
|
662 |
+
$custom_post_type .= ') );';
|
663 |
+
|
664 |
+
echo _e('Place the below code in your themes functions.php file to manually create this custom post type','cpt-plugin').'<br>';
|
665 |
+
echo _e('This is a <strong>BETA</strong> feature. Please <a href="http://webdevstudios.com/support/forum/custom-post-type-ui/">report bugs</a>.','cpt-plugin').'<br>';
|
666 |
+
echo '<textarea rows="5" cols="100">' .$custom_post_type .'</textarea>';
|
667 |
+
|
668 |
+
?>
|
669 |
+
</div>
|
670 |
+
</td>
|
671 |
+
</tr>
|
672 |
+
<?php
|
673 |
+
$thecounter++;
|
674 |
+
$cpt_names[] = strtolower( $cpt_post_type["name"] );
|
675 |
+
}
|
676 |
+
|
677 |
+
$args=array(
|
678 |
+
'public' => true,
|
679 |
+
'_builtin' => false
|
680 |
+
);
|
681 |
+
$output = 'objects'; // or objects
|
682 |
+
$post_types=get_post_types($args,$output);
|
683 |
+
if ( $post_types ) {
|
684 |
+
|
685 |
+
?></table>
|
686 |
+
<?php screen_icon( 'plugins' ); ?>
|
687 |
+
<h2><?php _e('Additional Custom Post Types', 'cpt-plugin') ?></h2>
|
688 |
+
<p><?php _e('The custom post types below are registered in WordPress but were not created by the Custom Post Type UI Plugin.', 'cpt-plugin') ?></p>
|
689 |
+
<?php
|
690 |
+
foreach ($post_types as $post_type ) {
|
691 |
+
|
692 |
+
if ( !in_array( strtolower( $post_type->name ), $cpt_names ) ) {
|
693 |
+
if ( isset( $cpt_first ) && !$cpt_first ) {
|
694 |
+
?>
|
695 |
+
<table width="100%" class="widefat">
|
696 |
+
<thead>
|
697 |
+
<tr>
|
698 |
+
<th><?php _e('Name', 'cpt-plugin');?></th>
|
699 |
+
<th><?php _e('Label', 'cpt-plugin');?></th>
|
700 |
+
<th><?php _e('Singular Label', 'cpt-plugin');?></th>
|
701 |
+
<th><?php _e('Public', 'cpt-plugin');?></th>
|
702 |
+
<th><?php _e('Show UI', 'cpt-plugin');?></th>
|
703 |
+
<th><?php _e('Capability Type', 'cpt-plugin');?></th>
|
704 |
+
<th><?php _e('Hierarchical', 'cpt-plugin');?></th>
|
705 |
+
<th><?php _e('Rewrite Slug', 'cpt-plugin');?></th>
|
706 |
+
<th><?php _e('Rewrite Slug', 'cpt-plugin');?></th>
|
707 |
+
<th><?php _e('Query Var', 'cpt-plugin');?></th>
|
708 |
+
</tr>
|
709 |
+
</thead>
|
710 |
+
<tfoot>
|
711 |
+
<tr>
|
712 |
+
<th><?php _e('Name', 'cpt-plugin');?></th>
|
713 |
+
<th><?php _e('Label', 'cpt-plugin');?></th>
|
714 |
+
<th><?php _e('Singular Label', 'cpt-plugin');?></th>
|
715 |
+
<th><?php _e('Public', 'cpt-plugin');?></th>
|
716 |
+
<th><?php _e('Show UI', 'cpt-plugin');?></th>
|
717 |
+
<th><?php _e('Capability Type', 'cpt-plugin');?></th>
|
718 |
+
<th><?php _e('Hierarchical', 'cpt-plugin');?></th>
|
719 |
+
<th><?php _e('Rewrite Slug', 'cpt-plugin');?></th>
|
720 |
+
<th><?php _e('Rewrite Slug', 'cpt-plugin');?></th>
|
721 |
+
<th><?php _e('Query Var', 'cpt-plugin');?></th>
|
722 |
+
</tr>
|
723 |
+
</tfoot>
|
724 |
+
<?php
|
725 |
+
$cpt_first = true;
|
726 |
+
}
|
727 |
+
$rewrite_slug = ( isset( $post_type->rewrite_slug ) ) ? $post_type->rewrite_slug : $post_type->name;
|
728 |
+
?>
|
729 |
+
<tr>
|
730 |
+
<td valign="top"><?php echo $post_type->name; ?></td>
|
731 |
+
<td valign="top"><?php echo $post_type->label; ?></td>
|
732 |
+
<td valign="top"><?php echo $post_type->singular_label; ?></td>
|
733 |
+
<td valign="top"><?php echo disp_boolean($post_type->public); ?></td>
|
734 |
+
<td valign="top"><?php echo disp_boolean($post_type->show_ui); ?></td>
|
735 |
+
<td valign="top"><?php echo $post_type->capability_type; ?></td>
|
736 |
+
<td valign="top"><?php echo disp_boolean($post_type->hierarchical); ?></td>
|
737 |
+
<td valign="top"><?php echo disp_boolean($post_type->rewrite); ?></td>
|
738 |
+
<td valign="top"><?php echo $rewrite_slug; ?></td>
|
739 |
+
<td valign="top"><?php echo disp_boolean($post_type->query_var); ?></td>
|
740 |
+
</tr>
|
741 |
+
<?php
|
742 |
+
}
|
743 |
+
}
|
744 |
+
}
|
745 |
+
|
746 |
+
if ( isset($cpt_first) && !$cpt_first ) {
|
747 |
+
echo '<tr><td><strong>';
|
748 |
+
_e( 'No additional post types found', 'cpt-plugin' );
|
749 |
+
echo '</strong></td></tr>';
|
750 |
+
}
|
751 |
+
?>
|
752 |
+
</table>
|
753 |
+
|
754 |
+
</div><?php
|
755 |
+
//load footer
|
756 |
+
cpt_footer();
|
757 |
+
}
|
758 |
+
}
|
759 |
+
|
760 |
+
//manage custom taxonomies page
|
761 |
+
function cpt_manage_taxonomies() {
|
762 |
+
global $CPT_URL;
|
763 |
+
|
764 |
+
$MANAGE_URL = cpt_check_return( 'add' );
|
765 |
+
|
766 |
+
?>
|
767 |
+
<div class="wrap">
|
768 |
+
<?php
|
769 |
+
//check for success/error messages
|
770 |
+
If (isset($_GET['cpt_msg']) && $_GET['cpt_msg']=='del') { ?>
|
771 |
+
<div id="message" class="updated">
|
772 |
+
<?php _e('Custom taxonomy deleted successfully', 'cpt-plugin'); ?>
|
773 |
+
</div>
|
774 |
+
<?php
|
775 |
+
}
|
776 |
+
?>
|
777 |
+
<?php screen_icon( 'plugins' ); ?>
|
778 |
+
<h2><?php _e('Manage Custom Taxonomies', 'cpt-plugin') ?></h2>
|
779 |
+
<p><?php _e('Deleting custom taxonomies does <strong>NOT</strong> delete any content added to those taxonomies. You can easily recreate your taxonomies and the content will still exist.', 'cpt-plugin') ?></p>
|
780 |
+
<?php
|
781 |
+
$cpt_tax_types = get_option('cpt_custom_tax_types');
|
782 |
+
|
783 |
+
If (is_array($cpt_tax_types)) {
|
784 |
+
?>
|
785 |
+
<table width="100%" class="widefat">
|
786 |
+
<thead>
|
787 |
+
<tr>
|
788 |
+
<th><?php _e('Action', 'cpt-plugin');?></th>
|
789 |
+
<th><?php _e('Name', 'cpt-plugin');?></th>
|
790 |
+
<th><?php _e('Label', 'cpt-plugin');?></th>
|
791 |
+
<th><?php _e('Singular Label', 'cpt-plugin');?></th>
|
792 |
+
<th><?php _e('Attached Post Types', 'cpt-plugin');?></th>
|
793 |
+
<th><?php _e('Hierarchical', 'cpt-plugin');?></th>
|
794 |
+
<th><?php _e('Show UI', 'cpt-plugin');?></th>
|
795 |
+
<th><?php _e('Rewrite', 'cpt-plugin');?></th>
|
796 |
+
<th><?php _e('Rewrite Slug', 'cpt-plugin');?></th>
|
797 |
+
</tr>
|
798 |
+
</thead>
|
799 |
+
<tfoot>
|
800 |
+
<tr>
|
801 |
+
<th><?php _e('Action', 'cpt-plugin');?></th>
|
802 |
+
<th><?php _e('Name', 'cpt-plugin');?></th>
|
803 |
+
<th><?php _e('Label', 'cpt-plugin');?></th>
|
804 |
+
<th><?php _e('Singular Label', 'cpt-plugin');?></th>
|
805 |
+
<th><?php _e('Attached Post Types', 'cpt-plugin');?></th>
|
806 |
+
<th><?php _e('Hierarchical', 'cpt-plugin');?></th>
|
807 |
+
<th><?php _e('Show UI', 'cpt-plugin');?></th>
|
808 |
+
<th><?php _e('Rewrite', 'cpt-plugin');?></th>
|
809 |
+
<th><?php _e('Rewrite Slug', 'cpt-plugin');?></th>
|
810 |
+
</tr>
|
811 |
+
</tfoot>
|
812 |
+
<?php
|
813 |
+
$thecounter=0;
|
814 |
+
foreach ($cpt_tax_types as $cpt_tax_type) {
|
815 |
+
|
816 |
+
$del_url = cpt_check_return( 'cpt' ) .'&deltax=' .$thecounter .'&return=tax';
|
817 |
+
$del_url = ( function_exists('wp_nonce_url') ) ? wp_nonce_url($del_url, 'cpt_delete_tax') : $del_url;
|
818 |
+
|
819 |
+
$edit_url = $MANAGE_URL .'&edittax=' .$thecounter .'&return=tax';
|
820 |
+
$edit_url = ( function_exists('wp_nonce_url') ) ? wp_nonce_url($edit_url, 'cpt_edit_tax') : $edit_url;
|
821 |
+
|
822 |
+
$rewrite_slug = ( $cpt_tax_type["rewrite_slug"] ) ? $cpt_tax_type["rewrite_slug"] : $cpt_tax_type["name"];
|
823 |
+
?>
|
824 |
+
<tr>
|
825 |
+
<td valign="top"><a href="<?php echo $del_url; ?>">Delete</a> / <a href="<?php echo $edit_url; ?>">Edit</a> / <a href="#" class="comment_button" id="<?php echo $thecounter; ?>">Get Code</a></td>
|
826 |
+
<td valign="top"><?php echo stripslashes($cpt_tax_type["name"]); ?></td>
|
827 |
+
<td valign="top"><?php echo stripslashes($cpt_tax_type["label"]); ?></td>
|
828 |
+
<td valign="top"><?php echo stripslashes($cpt_tax_type["singular_label"]); ?></td>
|
829 |
+
<td valign="top">
|
830 |
+
<?php
|
831 |
+
if ( isset( $cpt_tax_type["cpt_name"] ) ) {
|
832 |
+
echo stripslashes($cpt_tax_type["cpt_name"]);
|
833 |
+
}elseif ( is_array( $cpt_tax_type[1] ) ) {
|
834 |
+
foreach ($cpt_tax_type[1] as $cpt_post_types) {
|
835 |
+
echo $cpt_post_types .'<br />';
|
836 |
+
}
|
837 |
+
}
|
838 |
+
?>
|
839 |
+
</td>
|
840 |
+
<td valign="top"><?php echo disp_boolean($cpt_tax_type["hierarchical"]); ?></td>
|
841 |
+
<td valign="top"><?php echo disp_boolean($cpt_tax_type["show_ui"]); ?></td>
|
842 |
+
<td valign="top"><?php echo disp_boolean($cpt_tax_type["rewrite"]); ?></td>
|
843 |
+
<td valign="top"><?php echo $rewrite_slug; ?></td>
|
844 |
+
</tr>
|
845 |
+
<tr>
|
846 |
+
<td colspan="10">
|
847 |
+
<div style="display:none;" id="slidepanel<?php echo $thecounter; ?>">
|
848 |
+
<?php
|
849 |
+
//display register_taxonomy code
|
850 |
+
$cpt_tax_types = get_option('cpt_custom_tax_types');
|
851 |
+
$custom_tax = '';
|
852 |
+
|
853 |
+
//check if option value is an Array before proceeding
|
854 |
+
If (is_array($cpt_tax_types)) {
|
855 |
+
//foreach ($cpt_tax_types as $cpt_tax_type) {
|
856 |
+
|
857 |
+
If (!$cpt_tax_type["label"]) {
|
858 |
+
$cpt_label = esc_html($cpt_tax_type["name"]);
|
859 |
+
}Else{
|
860 |
+
$cpt_label = esc_html($cpt_tax_type["label"]);
|
861 |
+
}
|
862 |
+
|
863 |
+
//check if singular label was filled out
|
864 |
+
If (!$cpt_tax_type["singular_label"]) {
|
865 |
+
$cpt_singular_label = esc_html($cpt_tax_type["name"]);
|
866 |
+
}Else{
|
867 |
+
$cpt_singular_label = esc_html($cpt_tax_type["singular_label"]);
|
868 |
+
}
|
869 |
+
|
870 |
+
$cpt_post_types = ( !$cpt_tax_type[1] ) ? $cpt_tax_type["cpt_name"] : var_export( $cpt_tax_type[1], true );
|
871 |
+
|
872 |
+
//register our custom taxonomies
|
873 |
+
$custom_tax = 'register_taxonomy(\'' .$cpt_tax_type["name"]. '\',';
|
874 |
+
$custom_tax .= $cpt_post_types .',';
|
875 |
+
$custom_tax .= 'array( \'hierarchical\' => '.disp_boolean($cpt_tax_type["hierarchical"]).', ';
|
876 |
+
$custom_tax .= '\'label\' => \''.$cpt_label.'\',';
|
877 |
+
$custom_tax .= '\'show_ui\' => '.disp_boolean($cpt_tax_type["show_ui"]).',';
|
878 |
+
$custom_tax .= '\'query_var\' => '. disp_boolean($cpt_tax_type["query_var"]).',';
|
879 |
+
$custom_tax .= '\'rewrite\' => array(\'slug\' => \'' .$cpt_tax_type["rewrite_slug"]. '\'),';
|
880 |
+
$custom_tax .= '\'singular_label\' => \''.$cpt_singular_label.'\'';
|
881 |
+
$custom_tax .= ') );';
|
882 |
+
|
883 |
+
echo '<br>';
|
884 |
+
echo _e('Place the below code in your themes functions.php file to manually create this custom taxonomy','cpt-plugin').'<br>';
|
885 |
+
echo _e('This is a <strong>BETA</strong> feature. Please <a href="http://webdevstudios.com/support/forum/custom-post-type-ui/">report bugs</a>.','cpt-plugin').'<br>';
|
886 |
+
echo '<textarea rows="5" cols="100">' .$custom_tax .'</textarea>';
|
887 |
+
|
888 |
+
//}
|
889 |
+
}
|
890 |
+
?>
|
891 |
+
</div>
|
892 |
+
</td>
|
893 |
+
</tr>
|
894 |
+
<?php
|
895 |
+
$thecounter++;
|
896 |
+
}
|
897 |
+
?></table>
|
898 |
+
</div>
|
899 |
+
<?php
|
900 |
+
//load footer
|
901 |
+
cpt_footer();
|
902 |
+
}
|
903 |
+
}
|
904 |
+
|
905 |
+
//add new custom post type / taxonomy page
|
906 |
+
function cpt_add_new() {
|
907 |
+
global $cpt_error, $CPT_URL;
|
908 |
+
|
909 |
+
If (isset($_GET['return'])) {
|
910 |
+
$RETURN_URL = 'action="' .cpt_check_return(esc_attr($_GET['return'])). '"';
|
911 |
+
}Else{
|
912 |
+
$RETURN_URL = '';
|
913 |
+
}
|
914 |
+
|
915 |
+
|
916 |
+
//check if we are editing a custom post type or creating a new one
|
917 |
+
If (isset($_GET['edittype']) && !isset($_GET['cpt_edit'])) {
|
918 |
+
check_admin_referer('cpt_edit_post_type');
|
919 |
+
|
920 |
+
//get post type to edit
|
921 |
+
$editType = intval($_GET['edittype']);
|
922 |
+
|
923 |
+
//load custom posts saved in WP
|
924 |
+
$cpt_options = get_option('cpt_custom_post_types');
|
925 |
+
|
926 |
+
//load custom post type values to edit
|
927 |
+
$cpt_post_type_name = $cpt_options[$editType]["name"];
|
928 |
+
$cpt_label = $cpt_options[$editType]["label"];
|
929 |
+
$cpt_singular_label = $cpt_options[$editType]["singular_label"];
|
930 |
+
$cpt_public = $cpt_options[$editType]["public"];
|
931 |
+
$cpt_showui = $cpt_options[$editType]["show_ui"];
|
932 |
+
$cpt_capability = $cpt_options[$editType]["capability_type"];
|
933 |
+
$cpt_hierarchical = $cpt_options[$editType]["hierarchical"];
|
934 |
+
$cpt_rewrite = $cpt_options[$editType]["rewrite"];
|
935 |
+
$cpt_rewrite_slug = $cpt_options[$editType]["rewrite_slug"];
|
936 |
+
$cpt_query_var = $cpt_options[$editType]["query_var"];
|
937 |
+
$cpt_description = $cpt_options[$editType]["description"];
|
938 |
+
$cpt_menu_position = $cpt_options[$editType]["menu_position"];
|
939 |
+
$cpt_supports = $cpt_options[$editType][0];
|
940 |
+
$cpt_taxes = $cpt_options[$editType][1];
|
941 |
+
$cpt_labels = $cpt_options[$editType][2];
|
942 |
+
$cpt_has_archive = $cpt_options[$editType]["has_archive"];
|
943 |
+
$cpt_show_in_menu = $cpt_options[$editType]["show_in_menu"];
|
944 |
+
$cpt_show_in_menu_string = $cpt_options[$editType]["show_in_menu_string"];
|
945 |
+
|
946 |
+
$cpt_submit_name = 'Save Custom Post Type';
|
947 |
+
}Else{
|
948 |
+
$cpt_submit_name = 'Create Custom Post Type';
|
949 |
+
}
|
950 |
+
|
951 |
+
If (isset($_GET['edittax']) && !isset($_GET['cpt_edit'])) {
|
952 |
+
check_admin_referer('cpt_edit_tax');
|
953 |
+
|
954 |
+
//get post type to edit
|
955 |
+
$editTax = intval($_GET['edittax']);
|
956 |
+
|
957 |
+
//load custom posts saved in WP
|
958 |
+
$cpt_options = get_option('cpt_custom_tax_types');
|
959 |
+
|
960 |
+
//load custom post type values to edit
|
961 |
+
$cpt_tax_name = $cpt_options[$editTax]["name"];
|
962 |
+
$cpt_tax_label = $cpt_options[$editTax]["label"];
|
963 |
+
$cpt_singular_label = $cpt_options[$editTax]["singular_label"];
|
964 |
+
$cpt_tax_object_type = ( isset( $cpt_options[$editTax]["cpt_name"] ) ) ? $cpt_options[$editTax]["cpt_name"] : null;
|
965 |
+
$cpt_tax_hierarchical = $cpt_options[$editTax]["hierarchical"];
|
966 |
+
$cpt_tax_showui = $cpt_options[$editTax]["show_ui"];
|
967 |
+
$cpt_tax_query_var = $cpt_options[$editTax]["query_var"];
|
968 |
+
$cpt_tax_rewrite = $cpt_options[$editTax]["rewrite"];
|
969 |
+
$cpt_tax_rewrite_slug = $cpt_options[$editTax]["rewrite_slug"];
|
970 |
+
$cpt_tax_labels = $cpt_options[$editTax][0];
|
971 |
+
$cpt_post_types = $cpt_options[$editTax][1];
|
972 |
+
|
973 |
+
$cpt_tax_submit_name = 'Save Custom Taxonomy';
|
974 |
+
}Else{
|
975 |
+
$cpt_tax_submit_name = 'Create Custom Taxonomy';
|
976 |
+
}
|
977 |
+
|
978 |
+
//flush rewrite rules
|
979 |
+
flush_rewrite_rules();
|
980 |
+
|
981 |
+
?><div class="wrap"><?php
|
982 |
+
//check for success/error messages
|
983 |
+
If (isset($_GET['cpt_msg']) && $_GET['cpt_msg']==1) { ?>
|
984 |
+
<div id="message" class="updated">
|
985 |
+
<?php _e('Custom post type created successfully. You may need to refresh to view the new post type. <a href="' .cpt_check_return( 'cpt' ) .'">Manage custom post types</a>', 'cpt-plugin'); ?>
|
986 |
+
</div>
|
987 |
+
<?php
|
988 |
+
}elseIf (isset($_GET['cpt_msg']) && $_GET['cpt_msg']==2) { ?>
|
989 |
+
<div id="message" class="updated">
|
990 |
+
<?php _e('Custom taxonomy created successfully. You may need to refresh to view the new taxonomy. <a href="' .cpt_check_return( 'tax' ) .'">Manage custom taxonomies</a>', 'cpt-plugin'); ?>
|
991 |
+
</div>
|
992 |
+
<?php
|
993 |
+
}else{
|
994 |
+
If (isset($_GET['cpt_error']) && $_GET['cpt_error']==1) { ?>
|
995 |
+
<div class="error">
|
996 |
+
<?php _e('Post type name is a required field.', 'cpt-plugin'); ?>
|
997 |
+
</div>
|
998 |
+
<?php }ElseIf (isset($_GET['cpt_error']) && $_GET['cpt_error']==2) { ?>
|
999 |
+
<div class="error">
|
1000 |
+
<?php _e('Taxonomy name is a required field.', 'cpt-plugin'); ?>
|
1001 |
+
</div>
|
1002 |
+
<?php }ElseIf (isset($_GET['cpt_error']) && $_GET['cpt_error']==3) { ?>
|
1003 |
+
<div class="error">
|
1004 |
+
<?php _e('You must assign your custom taxonomy to at least one post type.', 'cpt-plugin'); ?>
|
1005 |
+
</div>
|
1006 |
+
<?php }
|
1007 |
+
}
|
1008 |
+
?>
|
1009 |
+
<?php screen_icon( 'plugins' ); ?>
|
1010 |
+
<?php If ( isset( $_GET['edittype'] ) || isset( $_GET['edittax'] ) ) { ?>
|
1011 |
+
<h2><?php _e('Edit Custom Post Type or Taxonomy', 'cpt-plugin') ?> · <a href="<?php echo cpt_check_return( 'add' ); ?>"><?php _e('Reset', 'cpt-plugin');?></a></h2>
|
1012 |
+
<?php }Else{ ?>
|
1013 |
+
<h2><?php _e('Create New Custom Post Type or Taxonomy', 'cpt-plugin') ?> · <a href="<?php echo cpt_check_return( 'add' ); ?>"><?php _e('Reset', 'cpt-plugin');?></a></h2>
|
1014 |
+
<?php } ?>
|
1015 |
+
<table border="0" cellspacing="10" class="widefat">
|
1016 |
+
<tr>
|
1017 |
+
<td width="50%" valign="top">
|
1018 |
+
<p><?php _e('If you are unfamiliar with the options below only fill out the <strong>Post Type Name</strong> and <strong>Label</strong> fields and check which meta boxes to support. The other settings are set to the most common defaults for custom post types.', 'cpt-plugin'); ?></p>
|
1019 |
+
<form method="post" <?php echo $RETURN_URL; ?>>
|
1020 |
+
<?php if ( function_exists('wp_nonce_field') )
|
1021 |
+
wp_nonce_field('cpt_add_custom_post_type'); ?>
|
1022 |
+
<?php If (isset($_GET['edittype'])) { ?>
|
1023 |
+
<input type="hidden" name="cpt_edit" value="<?php echo $editType; ?>" />
|
1024 |
+
<?php } ?>
|
1025 |
+
<table class="form-table">
|
1026 |
+
<tr valign="top">
|
1027 |
+
<th scope="row"><?php _e('Post Type Name', 'cpt-plugin') ?> <span style="color:red;">*</span></th>
|
1028 |
+
<td><input type="text" name="cpt_custom_post_type[name]" tabindex="1" value="<?php If (isset($cpt_post_type_name)) { echo esc_attr($cpt_post_type_name); } ?>" /> <a href="#" title="The post type name. Used to retrieve custom post type content. Should be short and sweet" style="cursor: help;">?</a> (e.g. movies)</td>
|
1029 |
+
</tr>
|
1030 |
+
|
1031 |
+
<tr valign="top">
|
1032 |
+
<th scope="row"><?php _e('Label', 'cpt-plugin') ?></th>
|
1033 |
+
<td><input type="text" name="cpt_custom_post_type[label]" tabindex="2" value="<?php If (isset($cpt_label)) { echo esc_attr($cpt_label); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. Movies)</td>
|
1034 |
+
</tr>
|
1035 |
+
|
1036 |
+
<tr valign="top">
|
1037 |
+
<th scope="row"><?php _e('Singular Label', 'cpt-plugin') ?></th>
|
1038 |
+
<td><input type="text" name="cpt_custom_post_type[singular_label]" tabindex="3" value="<?php If (isset($cpt_singular_label)) { echo esc_attr($cpt_singular_label); } ?>" /> <a href="#" title="Custom Post Type Singular label. Used in WordPress when a singular label is needed." style="cursor: help;">?</a> (e.g. Movie)</td>
|
1039 |
+
|
1040 |
+
</tr>
|
1041 |
+
|
1042 |
+
<tr valign="top">
|
1043 |
+
<th scope="row"><?php _e('Description', 'cpt-plugin') ?></th>
|
1044 |
+
<td><textarea name="cpt_custom_post_type[description]" tabindex="4" rows="4" cols="40"><?php If (isset($cpt_description)) { echo esc_attr($cpt_description); } ?></textarea><a href="#" title="Custom Post Type Description. Describe what your custom post type is used for." style="cursor: help;">?</a></td>
|
1045 |
+
</tr>
|
1046 |
+
|
1047 |
+
<tr valign="top">
|
1048 |
+
<td colspan="2">
|
1049 |
+
<p align="center">
|
1050 |
+
<?php echo '<a href="#" class="comment_button" id="1">' . __('Advanced Label Options', 'cpt-plugin') . '</a>'; ?> ·
|
1051 |
+
<?php echo '<a href="#" class="comment_button" id="2">' . __('Advanced Options', 'cpt-plugin') . '</a>'; ?>
|
1052 |
+
</p>
|
1053 |
+
</td>
|
1054 |
+
</tr>
|
1055 |
+
|
1056 |
+
</table>
|
1057 |
+
|
1058 |
+
<div style="display:none;" id="slidepanel1">
|
1059 |
+
<p><?php _e('Below are the advanced label options for custom post types. If you are unfamiliar with these labels the plugin will automatically create labels based off of your custom post type name', 'cpt-plugin'); ?></p>
|
1060 |
+
<table class="form-table">
|
1061 |
+
|
1062 |
+
<tr valign="top">
|
1063 |
+
<th scope="row"><?php _e('Menu Name', 'cpt-plugin') ?></th>
|
1064 |
+
<td><input type="text" name="cpt_labels[menu_name]" tabindex="2" value="<?php If (isset($cpt_labels["menu_name"])) { echo esc_attr($cpt_labels["menu_name"]); } ?>" /> <a href="#" title="Custom menu name for your custom post type." style="cursor: help;">?</a> (e.g. My Movies)</td>
|
1065 |
+
</tr>
|
1066 |
+
|
1067 |
+
<tr valign="top">
|
1068 |
+
<th scope="row"><?php _e('Add New', 'cpt-plugin') ?></th>
|
1069 |
+
<td><input type="text" name="cpt_labels[add_new]" tabindex="2" value="<?php If (isset($cpt_labels["add_new"])) { echo esc_attr($cpt_labels["add_new"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. Add New)</td>
|
1070 |
+
</tr>
|
1071 |
+
|
1072 |
+
<tr valign="top">
|
1073 |
+
<th scope="row"><?php _e('Add New Item', 'cpt-plugin') ?></th>
|
1074 |
+
<td><input type="text" name="cpt_labels[add_new_item]" tabindex="2" value="<?php If (isset($cpt_labels["add_new_item"])) { echo esc_attr($cpt_labels["add_new_item"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. Add New Movie)</td>
|
1075 |
+
</tr>
|
1076 |
+
|
1077 |
+
<tr valign="top">
|
1078 |
+
<th scope="row"><?php _e('Edit', 'cpt-plugin') ?></th>
|
1079 |
+
<td><input type="text" name="cpt_labels[edit]" tabindex="2" value="<?php If (isset($cpt_labels["edit"])) { echo esc_attr($cpt_labels["edit"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. Edit)</td>
|
1080 |
+
</tr>
|
1081 |
+
|
1082 |
+
<tr valign="top">
|
1083 |
+
<th scope="row"><?php _e('Edit Item', 'cpt-plugin') ?></th>
|
1084 |
+
<td><input type="text" name="cpt_labels[edit_item]" tabindex="2" value="<?php If (isset($cpt_labels["edit_item"])) { echo esc_attr($cpt_labels["edit_item"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. Edit Movie)</td>
|
1085 |
+
</tr>
|
1086 |
+
|
1087 |
+
<tr valign="top">
|
1088 |
+
<th scope="row"><?php _e('New Item', 'cpt-plugin') ?></th>
|
1089 |
+
<td><input type="text" name="cpt_labels[new_item]" tabindex="2" value="<?php If (isset($cpt_labels["new_item"])) { echo esc_attr($cpt_labels["new_item"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. New Movie)</td>
|
1090 |
+
</tr>
|
1091 |
+
|
1092 |
+
<tr valign="top">
|
1093 |
+
<th scope="row"><?php _e('View', 'cpt-plugin') ?></th>
|
1094 |
+
<td><input type="text" name="cpt_labels[view]" tabindex="2" value="<?php If (isset($cpt_labels["view"])) { echo esc_attr($cpt_labels["view"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. View Movie)</td>
|
1095 |
+
</tr>
|
1096 |
+
|
1097 |
+
<tr valign="top">
|
1098 |
+
<th scope="row"><?php _e('View Item', 'cpt-plugin') ?></th>
|
1099 |
+
<td><input type="text" name="cpt_labels[view_item]" tabindex="2" value="<?php If (isset($cpt_labels["view_item"])) { echo esc_attr($cpt_labels["view_item"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. View Movie)</td>
|
1100 |
+
</tr>
|
1101 |
+
|
1102 |
+
<tr valign="top">
|
1103 |
+
<th scope="row"><?php _e('Search Items', 'cpt-plugin') ?></th>
|
1104 |
+
<td><input type="text" name="cpt_labels[search_items]" tabindex="2" value="<?php If (isset($cpt_labels["search_items"])) { echo esc_attr($cpt_labels["search_items"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. Search Movies)</td>
|
1105 |
+
</tr>
|
1106 |
+
|
1107 |
+
<tr valign="top">
|
1108 |
+
<th scope="row"><?php _e('Not Found', 'cpt-plugin') ?></th>
|
1109 |
+
<td><input type="text" name="cpt_labels[not_found]" tabindex="2" value="<?php If (isset($cpt_labels["not_found"])) { echo esc_attr($cpt_labels["not_found"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. No Movies Found)</td>
|
1110 |
+
</tr>
|
1111 |
+
|
1112 |
+
<tr valign="top">
|
1113 |
+
<th scope="row"><?php _e('Not Found in Trash', 'cpt-plugin') ?></th>
|
1114 |
+
<td><input type="text" name="cpt_labels[not_found_in_trash]" tabindex="2" value="<?php If (isset($cpt_labels["not_found_in_trash"])) { echo esc_attr($cpt_labels["not_found_in_trash"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. No Movies found in Trash)</td>
|
1115 |
+
</tr>
|
1116 |
+
|
1117 |
+
<tr valign="top">
|
1118 |
+
<th scope="row"><?php _e('Parent', 'cpt-plugin') ?></th>
|
1119 |
+
<td><input type="text" name="cpt_labels[parent]" tabindex="2" value="<?php If (isset($cpt_labels["parent"])) { echo esc_attr($cpt_labels["parent"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. Parent Movie)</td>
|
1120 |
+
</tr>
|
1121 |
+
|
1122 |
+
</table>
|
1123 |
+
</div>
|
1124 |
+
|
1125 |
+
<div style="display:none;" id="slidepanel2">
|
1126 |
+
<table class="form-table">
|
1127 |
+
<tr valign="top">
|
1128 |
+
<th scope="row"><?php _e('Public', 'cpt-plugin') ?></th>
|
1129 |
+
<td>
|
1130 |
+
<SELECT name="cpt_custom_post_type[public]" tabindex="4">
|
1131 |
+
<OPTION value="0" <?php If (isset($cpt_public)) { If ($cpt_public == 0 && $cpt_public != '') { echo 'selected="selected"'; } } ?>>False</OPTION>
|
1132 |
+
<OPTION value="1" <?php If (isset($cpt_public)) { If ($cpt_public == 1 || is_null($cpt_public)) { echo 'selected="selected"'; } }Else{ echo 'selected="selected"'; } ?>>True</OPTION>
|
1133 |
+
</SELECT> <a href="#" title="Whether posts of this type should be shown in the admin UI" style="cursor: help;">?</a> (default: True)
|
1134 |
+
</td>
|
1135 |
+
</tr>
|
1136 |
+
|
1137 |
+
<tr valign="top">
|
1138 |
+
<th scope="row"><?php _e('Show UI', 'cpt-plugin') ?></th>
|
1139 |
+
<td>
|
1140 |
+
<SELECT name="cpt_custom_post_type[show_ui]" tabindex="5">
|
1141 |
+
<OPTION value="0" <?php If (isset($cpt_showui)) { If ($cpt_showui == 0 && $cpt_showui != '') { echo 'selected="selected"'; } } ?>>False</OPTION>
|
1142 |
+
<OPTION value="1" <?php If (isset($cpt_showui)) { If ($cpt_showui == 1 || is_null($cpt_showui)) { echo 'selected="selected"'; } }Else{ echo 'selected="selected"'; } ?>>True</OPTION>
|
1143 |
+
</SELECT> <a href="#" title="Whether to generate a default UI for managing this post type" style="cursor: help;">?</a> (default: True)
|
1144 |
+
</td>
|
1145 |
+
</tr>
|
1146 |
+
|
1147 |
+
<tr valign="top">
|
1148 |
+
<th scope="row"><?php _e('Has Archive', 'cpt-plugin') ?></th>
|
1149 |
+
<td>
|
1150 |
+
<SELECT name="cpt_custom_post_type[has_archive]" tabindex="6">
|
1151 |
+
<OPTION value="0" <?php If (isset($cpt_has_archive)) { If ($cpt_has_archive == 0) { echo 'selected="selected"'; } }Else{ echo 'selected="selected"'; } ?>>False</OPTION>
|
1152 |
+
<OPTION value="1" <?php If (isset($cpt_has_archive)) { If ($cpt_has_archive == 1) { echo 'selected="selected"'; } } ?>>True</OPTION>
|
1153 |
+
</SELECT> <a href="#" title="Whether the post type will have a post type archive page" style="cursor: help;">?</a> (default: False)
|
1154 |
+
</td>
|
1155 |
+
</tr>
|
1156 |
+
|
1157 |
+
<tr valign="top">
|
1158 |
+
<th scope="row"><?php _e('Capability Type', 'cpt-plugin') ?></th>
|
1159 |
+
<td><input type="text" name="cpt_custom_post_type[capability_type]" tabindex="6" value="post" value="<?php echo esc_attr($cpt_capability); ?>" /> <a href="#" title="The post type to use for checking read, edit, and delete capabilities" style="cursor: help;">?</a></td>
|
1160 |
+
</tr>
|
1161 |
+
|
1162 |
+
<tr valign="top">
|
1163 |
+
<th scope="row"><?php _e('Hierarchical', 'cpt-plugin') ?></th>
|
1164 |
+
<td>
|
1165 |
+
<SELECT name="cpt_custom_post_type[hierarchical]" tabindex="7">
|
1166 |
+
<OPTION value="0" <?php If (isset($cpt_hierarchical)) { If ($cpt_hierarchical == 0) { echo 'selected="selected"'; } }Else{ echo 'selected="selected"'; } ?>>False</OPTION>
|
1167 |
+
<OPTION value="1" <?php If (isset($cpt_hierarchical)) { If ($cpt_hierarchical == 1) { echo 'selected="selected"'; } } ?>>True</OPTION>
|
1168 |
+
</SELECT> <a href="#" title="Whether the post type is hierarchical" style="cursor: help;">?</a> (default: False)
|
1169 |
+
</td>
|
1170 |
+
</tr>
|
1171 |
+
|
1172 |
+
<tr valign="top">
|
1173 |
+
<th scope="row"><?php _e('Rewrite', 'cpt-plugin') ?></th>
|
1174 |
+
<td>
|
1175 |
+
<SELECT name="cpt_custom_post_type[rewrite]" tabindex="8">
|