Changeset 1836611
- Timestamp:
- 03/08/2018 08:45:58 PM (8 years ago)
- Location:
- custom-post-type-maker
- Files:
-
- 4 edited
- 6 copied
-
tags/1.1.4 (copied) (copied from custom-post-type-maker/trunk)
-
tags/1.1.4/CHANGELOG.md (copied) (copied from custom-post-type-maker/trunk/CHANGELOG.md) (2 diffs)
-
tags/1.1.4/README.md (copied) (copied from custom-post-type-maker/trunk/README.md) (2 diffs)
-
tags/1.1.4/custom-post-type-maker.php (copied) (copied from custom-post-type-maker/trunk/custom-post-type-maker.php) (44 diffs)
-
tags/1.1.4/lang (copied) (copied from custom-post-type-maker/trunk/lang)
-
tags/1.1.4/readme.txt (copied) (copied from custom-post-type-maker/trunk/readme.txt) (1 diff)
-
trunk/CHANGELOG.md (modified) (2 diffs)
-
trunk/README.md (modified) (2 diffs)
-
trunk/custom-post-type-maker.php (modified) (44 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
custom-post-type-maker/tags/1.1.4/CHANGELOG.md
r1706370 r1836611 1 1 ## Changelog 2 3 ### 1.1.4 4 - Add ability to show custom taxonomy column in post listing. 2 5 3 6 ### 1.1.3 … … 31 34 - [Bugfix] Fixed `add_utility_page provokes "deprecated" notice in 4.5.2` 32 35 - [Forked] Forked https://wordpress.org/plugins/custom-post-type-maker/ 33 -
custom-post-type-maker/tags/1.1.4/README.md
r1706370 r1836611 23 23 24 24 ## Changelog 25 26 ### 1.1.4 27 - Add ability to show custom taxonomy column in post listing. 25 28 26 29 ### 1.1.3 … … 55 58 - [Bugfix] Fixed `add_utility_page provokes "deprecated" notice in 4.5.2` 56 59 - [Forked] Forked https://wordpress.org/plugins/custom-post-type-maker/ 57 58 -
custom-post-type-maker/tags/1.1.4/custom-post-type-maker.php
r1706370 r1836611 4 4 Plugin URI: https://github.com/Graffino/custom-post-type-maker-ui 5 5 Description: Custom Post Type Maker lets you create Custom Post Types and custom Taxonomies in a user friendly way. 6 Version: 1.1. 36 Version: 1.1.4 7 7 Author: Graffino 8 8 Author URI: http://www.graffino.com/ … … 25 25 * @license http://www.gnu.org/licenses/gpl-2.0.html GPLv2 26 26 * @package Custom_Post_Types_Maker 27 * @version 1.1. 327 * @version 1.1.4 28 28 */ 29 29 … … 40 40 * @since 1.0.0 41 41 */ 42 class Cptm 42 class Cptm 43 43 { 44 44 45 45 46 46 /** @var string $dir Plugin dir */ … … 54 54 * Constructor 55 55 */ 56 function __construct() 56 function __construct() 57 57 { 58 58 // vars 59 59 $this->dir = plugins_url( '', __FILE__ ); 60 60 $this->path = plugin_dir_path( __FILE__ ); 61 $this->version = '1.1. 3';61 $this->version = '1.1.4'; 62 62 63 63 // actions … … 92 92 * Initialize plugin 93 93 */ 94 public function init() 94 public function init() 95 95 { 96 96 // Create cptm post type … … 161 161 * Add admin menu items 162 162 */ 163 public function cptm_admin_menu() 163 public function cptm_admin_menu() 164 164 { 165 165 // add cptm page to options menu … … 167 167 add_submenu_page( 'edit.php?post_type=cptm', __('Taxonomies', 'custom-post-type-maker' ), __('Taxonomies', 'custom-post-type-maker' ), 'manage_options', 'edit.php?post_type=cptm_tax' ); 168 168 } 169 169 170 170 /** 171 171 * Register admin styles … … 173 173 * @param string $hook Wordpress hook 174 174 */ 175 public function cptm_styles( $hook ) 175 public function cptm_styles( $hook ) 176 176 { 177 177 // register overview style … … 198 198 } 199 199 } 200 200 201 201 /** 202 202 * Create custom post types … … 229 229 230 230 // Custom post icon (uploaded) 231 $cptm_icon_url = ( array_key_exists( 'cptm_icon_url', $cptm_meta ) && $cptm_meta['cptm_icon_url'][0] ? $cptm_meta['cptm_icon_url'][0] : false ); 232 231 $cptm_icon_url = ( array_key_exists( 'cptm_icon_url', $cptm_meta ) && $cptm_meta['cptm_icon_url'][0] ? $cptm_meta['cptm_icon_url'][0] : false ); 232 233 233 // Custom post icon (dashicons) 234 234 $cptm_icon_slug = ( array_key_exists( 'cptm_icon_slug', $cptm_meta ) && $cptm_meta['cptm_icon_slug'][0] ? $cptm_meta['cptm_icon_slug'][0] : false ); 235 235 236 236 // If DashIcon is set ignore uploaded 237 237 if ( !empty($cptm_icon_slug) ) { … … 240 240 $cptm_icon_name = $cptm_icon_url; 241 241 } 242 242 243 243 $cptm_custom_rewrite_slug = ( array_key_exists( 'cptm_custom_rewrite_slug', $cptm_meta ) && $cptm_meta['cptm_custom_rewrite_slug'][0] ? esc_html( $cptm_meta['cptm_custom_rewrite_slug'][0] ) : $cptm_name ); 244 244 $cptm_menu_position = ( array_key_exists( 'cptm_menu_position', $cptm_meta ) && $cptm_meta['cptm_menu_position'][0] ? (int) $cptm_meta['cptm_menu_position'][0] : null ); … … 256 256 $cptm_pages = ( array_key_exists( 'cptm_pages', $cptm_meta ) && $cptm_meta['cptm_pages'][0] == '1' ? true : false ); 257 257 $cptm_query_var = ( array_key_exists( 'cptm_query_var', $cptm_meta ) && $cptm_meta['cptm_query_var'][0] == '1' ? true : false ); 258 258 259 259 // If it doesn't exist, it must be set to true ( fix for existing installs ) 260 260 if ( ! array_key_exists( 'cptm_publicly_queryable', $cptm_meta ) ) { … … 274 274 $cptm_rewrite_options = array(); 275 275 if ( $cptm_rewrite ) { $cptm_rewrite_options['slug'] = _x( $cptm_custom_rewrite_slug, 'URL Slug', 'custom-post-type-maker' ); } 276 276 277 277 $cptm_rewrite_options['with_front'] = $cptm_withfront; 278 278 … … 302 302 'cptm_builtin_taxonomies' => unserialize( $cptm_builtin_taxonomies ), 303 303 ); 304 304 305 305 // register custom post types 306 306 if ( is_array( $cptms ) ) { … … 371 371 $cptm_tax_rewrite = ( array_key_exists( 'cptm_tax_rewrite', $cptm_meta ) && $cptm_meta['cptm_tax_rewrite'][0] == '1' ? array( 'slug' => _x( $cptm_tax_custom_rewrite_slug, 'URL Slug', 'custom-post-type-maker' ) ) : false ); 372 372 $cptm_tax_query_var = ( array_key_exists( 'cptm_tax_query_var', $cptm_meta ) && $cptm_meta['cptm_tax_query_var'][0] == '1' ? true : false ); 373 $cptm_tax_show_admin_column = ( array_key_exists( 'cptm_tax_show_admin_column', $cptm_meta ) && $cptm_meta['cptm_tax_show_admin_column'][0] == '1' ? true : false ); 374 373 375 374 376 // checkbox … … 385 387 'cptm_tax_rewrite' => $cptm_tax_rewrite, 386 388 'cptm_tax_query_var' => (bool) $cptm_tax_query_var, 389 'cptm_tax_show_admin_column' => (bool) $cptm_tax_show_admin_column, 387 390 'cptm_tax_builtin_taxonomies' => unserialize( $cptm_tax_post_types ), 388 391 ); … … 417 420 'hierarchical' => $cptm_taxonomy['cptm_tax_hierarchical'], 418 421 'query_var' => $cptm_taxonomy['cptm_tax_query_var'], 422 'show_admin_column' => $cptm_taxonomy['cptm_tax_show_admin_column'], 419 423 ); 420 424 … … 450 454 ); 451 455 } 452 456 453 457 /** 454 458 * Create custom post meta box … … 469 473 // Custom post icon (uploaded) 470 474 $cptm_icon_url = isset( $values['cptm_icon_url'] ) ? esc_attr( $values['cptm_icon_url'][0] ) : ''; 471 475 472 476 // Custom post icon (dashicons) 473 $cptm_icon_slug = isset( $values['cptm_icon_slug'] ) ? esc_attr( $values['cptm_icon_slug'][0] ) : ''; 474 477 $cptm_icon_slug = isset( $values['cptm_icon_slug'] ) ? esc_attr( $values['cptm_icon_slug'][0] ) : ''; 478 475 479 // If DashIcon is set ignore uploaded 476 480 if ( !empty($cptm_icon_slug) ) { … … 479 483 $cptm_icon_name = $cptm_icon_url; 480 484 } 481 482 485 486 483 487 $cptm_custom_rewrite_slug = isset( $values['cptm_custom_rewrite_slug'] ) ? esc_attr( $values['cptm_custom_rewrite_slug'][0] ) : ''; 484 488 $cptm_menu_position = isset( $values['cptm_menu_position'] ) ? esc_attr( $values['cptm_menu_position'][0] ) : ''; … … 829 833 * @param object $post Wordpress $post object 830 834 */ 831 public function cptm_tax_meta_box( $post ) 835 public function cptm_tax_meta_box( $post ) 832 836 { 833 837 // get post meta values … … 845 849 $cptm_tax_rewrite = isset( $values['cptm_tax_rewrite'] ) ? esc_attr( $values['cptm_tax_rewrite'][0] ) : ''; 846 850 $cptm_tax_query_var = isset( $values['cptm_tax_query_var'] ) ? esc_attr( $values['cptm_tax_query_var'][0] ) : ''; 851 $cptm_tax_show_admin_column = isset( $values['cptm_tax_show_admin_column'] ) ? esc_attr( $values['cptm_tax_show_admin_column'][0] ) : ''; 847 852 848 853 // checkbox fields … … 957 962 </tr> 958 963 <tr> 964 <td class="label"> 965 <label for="cptm_tax_show_admin_column"><?php _e( 'Admin Column', 'custom-post-type-maker' ); ?></label> 966 <p><?php _e( 'Show this taxonomy as a column in the custom post listing.', 'custom-post-type-maker' ); ?></p> 967 </td> 968 <td> 969 <select name="cptm_tax_show_admin_column" id="cptm_tax_show_admin_column" tabindex="8"> 970 <option value="1" <?php selected( $cptm_tax_show_admin_column, '1' ); ?>><?php _e( 'True', 'custom-post-type-maker' ); ?> (<?php _e( 'default', 'custom-post-type-maker' ); ?>)</option> 971 <option value="0" <?php selected( $cptm_tax_show_admin_column, '0' ); ?>><?php _e( 'False', 'custom-post-type-maker' ); ?></option> 972 </select> 973 </td> 974 </tr> 975 <tr> 959 976 <td class="label top"> 960 977 <label for="cptm_tax_post_types"><?php _e( 'Post Types', 'custom-post-type-maker' ); ?></label> … … 980 997 <?php 981 998 } 982 999 983 1000 /** 984 1001 * Save custom post … … 986 1003 * @param int $post_id Wordpress Post ID 987 1004 */ 988 public function cptm_save_post( $post_id ) 1005 public function cptm_save_post( $post_id ) 989 1006 { 990 1007 // verify if this is an auto save routine. … … 1011 1028 if ( isset($_POST['cptm_icon_slug']) ) 1012 1029 update_post_meta( $post_id, 'cptm_icon_slug', esc_textarea( $_POST['cptm_icon_slug'] ) ); 1013 1030 1014 1031 if ( isset($_POST['cptm_icon_url']) ) 1015 1032 update_post_meta( $post_id, 'cptm_icon_url', esc_textarea( $_POST['cptm_icon_url'] ) ); … … 1050 1067 if ( isset( $_POST['cptm_query_var'] ) ) 1051 1068 update_post_meta( $post_id, 'cptm_query_var', esc_attr( $_POST['cptm_query_var'] ) ); 1052 1069 1053 1070 if ( isset( $_POST['cptm_publicly_queryable'] ) ) 1054 1071 update_post_meta( $post_id, 'cptm_publicly_queryable', esc_attr( $_POST['cptm_publicly_queryable'] ) ); … … 1091 1108 update_post_meta( $post_id, 'cptm_tax_query_var', esc_attr( $_POST['cptm_tax_query_var'] ) ); 1092 1109 1110 if ( isset( $_POST['cptm_tax_show_admin_column'] ) ) 1111 update_post_meta( $post_id, 'cptm_tax_show_admin_column', esc_attr( $_POST['cptm_tax_show_admin_column'] ) ); 1112 1093 1113 $cptm_tax_post_types = isset( $_POST['cptm_tax_post_types'] ) ? $_POST['cptm_tax_post_types'] : array(); 1094 1114 update_post_meta( $post_id, 'cptm_tax_post_types', $cptm_tax_post_types ); … … 1097 1117 update_option( 'cptm_plugin_settings_changed', true ); 1098 1118 } 1099 1119 1100 1120 /** 1101 1121 * Flush rewrite rules 1102 1122 */ 1103 function cptm_plugin_settings_flush_rewrite() 1123 function cptm_plugin_settings_flush_rewrite() 1104 1124 { 1105 1125 if ( get_option( 'cptm_plugin_settings_changed' ) == true ) { … … 1112 1132 * Flush rewrite rules on plugin activation 1113 1133 */ 1114 function cptm_plugin_activate_flush_rewrite() 1134 function cptm_plugin_activate_flush_rewrite() 1115 1135 { 1116 1136 $this->cptm_create_custom_post_types(); 1117 1137 flush_rewrite_rules(); 1118 1138 } 1119 1139 1120 1140 /** 1121 1141 * Modify existing columns … … 1124 1144 * @return object Modified columns 1125 1145 */ 1126 function cptm_change_columns( $cols ) 1146 function cptm_change_columns( $cols ) 1127 1147 { 1128 1148 $cols = array( … … 1135 1155 return $cols; 1136 1156 } 1137 1157 1138 1158 /** 1139 1159 * Make columns sortable … … 1141 1161 * @return array Sortable array 1142 1162 */ 1143 function cptm_sortable_columns() 1163 function cptm_sortable_columns() 1144 1164 { 1145 1165 return array( … … 1154 1174 * @param int $post_id Wordpress Post ID 1155 1175 */ 1156 function cptm_custom_columns( $column, $post_id ) 1176 function cptm_custom_columns( $column, $post_id ) 1157 1177 { 1158 1178 switch ( $column ) { … … 1168 1188 } 1169 1189 } 1170 1190 1171 1191 /** 1172 1192 * Modify existing taxonomy columns … … 1175 1195 * @return array Modified taxonomy columns 1176 1196 */ 1177 function cptm_tax_change_columns( $cols ) 1197 function cptm_tax_change_columns( $cols ) 1178 1198 { 1179 1199 $cols = array( … … 1185 1205 return $cols; 1186 1206 } 1187 1207 1188 1208 /** 1189 1209 * Make taxonomy columns sortable … … 1191 1211 * @return array Sortable array 1192 1212 */ 1193 function cptm_tax_sortable_columns() 1213 function cptm_tax_sortable_columns() 1194 1214 { 1195 1215 return array( … … 1197 1217 ); 1198 1218 } 1199 1219 1200 1220 /** 1201 1221 * Insert custom taxonomy columns … … 1204 1224 * @param int $post_id Wordpress Post ID 1205 1225 */ 1206 function cptm_tax_custom_columns( $column, $post_id ) 1226 function cptm_tax_custom_columns( $column, $post_id ) 1207 1227 { 1208 1228 switch ( $column ) { … … 1215 1235 } 1216 1236 } 1217 1237 1218 1238 /** 1219 1239 * Insert admin footer 1220 1240 */ 1221 function cptm_admin_footer() 1241 function cptm_admin_footer() 1222 1242 { 1223 1243 global $post_type; … … 1442 1462 } 1443 1463 } 1444 1464 1445 1465 /** 1446 1466 * Update messages … … 1449 1469 * @return array Update messages 1450 1470 */ 1451 function cptm_post_updated_messages( $messages ) 1471 function cptm_post_updated_messages( $messages ) 1452 1472 { 1453 1473 global $post, $post_ID; … … 1470 1490 return $messages; 1471 1491 } 1472 1492 1473 1493 /** 1474 1494 * Prepare attachment for Ajax Upload Request -
custom-post-type-maker/tags/1.1.4/readme.txt
r1706375 r1836611 67 67 == Changelog == 68 68 69 = 1.1.4 70 - Add ability to show custom taxonomy column in post listing. 71 69 72 = 1.1.3 70 73 - Removed forgotten development dump. Sorry about that. -
custom-post-type-maker/trunk/CHANGELOG.md
r1706370 r1836611 1 1 ## Changelog 2 3 ### 1.1.4 4 - Add ability to show custom taxonomy column in post listing. 2 5 3 6 ### 1.1.3 … … 31 34 - [Bugfix] Fixed `add_utility_page provokes "deprecated" notice in 4.5.2` 32 35 - [Forked] Forked https://wordpress.org/plugins/custom-post-type-maker/ 33 -
custom-post-type-maker/trunk/README.md
r1706370 r1836611 23 23 24 24 ## Changelog 25 26 ### 1.1.4 27 - Add ability to show custom taxonomy column in post listing. 25 28 26 29 ### 1.1.3 … … 55 58 - [Bugfix] Fixed `add_utility_page provokes "deprecated" notice in 4.5.2` 56 59 - [Forked] Forked https://wordpress.org/plugins/custom-post-type-maker/ 57 58 -
custom-post-type-maker/trunk/custom-post-type-maker.php
r1706370 r1836611 4 4 Plugin URI: https://github.com/Graffino/custom-post-type-maker-ui 5 5 Description: Custom Post Type Maker lets you create Custom Post Types and custom Taxonomies in a user friendly way. 6 Version: 1.1. 36 Version: 1.1.4 7 7 Author: Graffino 8 8 Author URI: http://www.graffino.com/ … … 25 25 * @license http://www.gnu.org/licenses/gpl-2.0.html GPLv2 26 26 * @package Custom_Post_Types_Maker 27 * @version 1.1. 327 * @version 1.1.4 28 28 */ 29 29 … … 40 40 * @since 1.0.0 41 41 */ 42 class Cptm 42 class Cptm 43 43 { 44 44 45 45 46 46 /** @var string $dir Plugin dir */ … … 54 54 * Constructor 55 55 */ 56 function __construct() 56 function __construct() 57 57 { 58 58 // vars 59 59 $this->dir = plugins_url( '', __FILE__ ); 60 60 $this->path = plugin_dir_path( __FILE__ ); 61 $this->version = '1.1. 3';61 $this->version = '1.1.4'; 62 62 63 63 // actions … … 92 92 * Initialize plugin 93 93 */ 94 public function init() 94 public function init() 95 95 { 96 96 // Create cptm post type … … 161 161 * Add admin menu items 162 162 */ 163 public function cptm_admin_menu() 163 public function cptm_admin_menu() 164 164 { 165 165 // add cptm page to options menu … … 167 167 add_submenu_page( 'edit.php?post_type=cptm', __('Taxonomies', 'custom-post-type-maker' ), __('Taxonomies', 'custom-post-type-maker' ), 'manage_options', 'edit.php?post_type=cptm_tax' ); 168 168 } 169 169 170 170 /** 171 171 * Register admin styles … … 173 173 * @param string $hook Wordpress hook 174 174 */ 175 public function cptm_styles( $hook ) 175 public function cptm_styles( $hook ) 176 176 { 177 177 // register overview style … … 198 198 } 199 199 } 200 200 201 201 /** 202 202 * Create custom post types … … 229 229 230 230 // Custom post icon (uploaded) 231 $cptm_icon_url = ( array_key_exists( 'cptm_icon_url', $cptm_meta ) && $cptm_meta['cptm_icon_url'][0] ? $cptm_meta['cptm_icon_url'][0] : false ); 232 231 $cptm_icon_url = ( array_key_exists( 'cptm_icon_url', $cptm_meta ) && $cptm_meta['cptm_icon_url'][0] ? $cptm_meta['cptm_icon_url'][0] : false ); 232 233 233 // Custom post icon (dashicons) 234 234 $cptm_icon_slug = ( array_key_exists( 'cptm_icon_slug', $cptm_meta ) && $cptm_meta['cptm_icon_slug'][0] ? $cptm_meta['cptm_icon_slug'][0] : false ); 235 235 236 236 // If DashIcon is set ignore uploaded 237 237 if ( !empty($cptm_icon_slug) ) { … … 240 240 $cptm_icon_name = $cptm_icon_url; 241 241 } 242 242 243 243 $cptm_custom_rewrite_slug = ( array_key_exists( 'cptm_custom_rewrite_slug', $cptm_meta ) && $cptm_meta['cptm_custom_rewrite_slug'][0] ? esc_html( $cptm_meta['cptm_custom_rewrite_slug'][0] ) : $cptm_name ); 244 244 $cptm_menu_position = ( array_key_exists( 'cptm_menu_position', $cptm_meta ) && $cptm_meta['cptm_menu_position'][0] ? (int) $cptm_meta['cptm_menu_position'][0] : null ); … … 256 256 $cptm_pages = ( array_key_exists( 'cptm_pages', $cptm_meta ) && $cptm_meta['cptm_pages'][0] == '1' ? true : false ); 257 257 $cptm_query_var = ( array_key_exists( 'cptm_query_var', $cptm_meta ) && $cptm_meta['cptm_query_var'][0] == '1' ? true : false ); 258 258 259 259 // If it doesn't exist, it must be set to true ( fix for existing installs ) 260 260 if ( ! array_key_exists( 'cptm_publicly_queryable', $cptm_meta ) ) { … … 274 274 $cptm_rewrite_options = array(); 275 275 if ( $cptm_rewrite ) { $cptm_rewrite_options['slug'] = _x( $cptm_custom_rewrite_slug, 'URL Slug', 'custom-post-type-maker' ); } 276 276 277 277 $cptm_rewrite_options['with_front'] = $cptm_withfront; 278 278 … … 302 302 'cptm_builtin_taxonomies' => unserialize( $cptm_builtin_taxonomies ), 303 303 ); 304 304 305 305 // register custom post types 306 306 if ( is_array( $cptms ) ) { … … 371 371 $cptm_tax_rewrite = ( array_key_exists( 'cptm_tax_rewrite', $cptm_meta ) && $cptm_meta['cptm_tax_rewrite'][0] == '1' ? array( 'slug' => _x( $cptm_tax_custom_rewrite_slug, 'URL Slug', 'custom-post-type-maker' ) ) : false ); 372 372 $cptm_tax_query_var = ( array_key_exists( 'cptm_tax_query_var', $cptm_meta ) && $cptm_meta['cptm_tax_query_var'][0] == '1' ? true : false ); 373 $cptm_tax_show_admin_column = ( array_key_exists( 'cptm_tax_show_admin_column', $cptm_meta ) && $cptm_meta['cptm_tax_show_admin_column'][0] == '1' ? true : false ); 374 373 375 374 376 // checkbox … … 385 387 'cptm_tax_rewrite' => $cptm_tax_rewrite, 386 388 'cptm_tax_query_var' => (bool) $cptm_tax_query_var, 389 'cptm_tax_show_admin_column' => (bool) $cptm_tax_show_admin_column, 387 390 'cptm_tax_builtin_taxonomies' => unserialize( $cptm_tax_post_types ), 388 391 ); … … 417 420 'hierarchical' => $cptm_taxonomy['cptm_tax_hierarchical'], 418 421 'query_var' => $cptm_taxonomy['cptm_tax_query_var'], 422 'show_admin_column' => $cptm_taxonomy['cptm_tax_show_admin_column'], 419 423 ); 420 424 … … 450 454 ); 451 455 } 452 456 453 457 /** 454 458 * Create custom post meta box … … 469 473 // Custom post icon (uploaded) 470 474 $cptm_icon_url = isset( $values['cptm_icon_url'] ) ? esc_attr( $values['cptm_icon_url'][0] ) : ''; 471 475 472 476 // Custom post icon (dashicons) 473 $cptm_icon_slug = isset( $values['cptm_icon_slug'] ) ? esc_attr( $values['cptm_icon_slug'][0] ) : ''; 474 477 $cptm_icon_slug = isset( $values['cptm_icon_slug'] ) ? esc_attr( $values['cptm_icon_slug'][0] ) : ''; 478 475 479 // If DashIcon is set ignore uploaded 476 480 if ( !empty($cptm_icon_slug) ) { … … 479 483 $cptm_icon_name = $cptm_icon_url; 480 484 } 481 482 485 486 483 487 $cptm_custom_rewrite_slug = isset( $values['cptm_custom_rewrite_slug'] ) ? esc_attr( $values['cptm_custom_rewrite_slug'][0] ) : ''; 484 488 $cptm_menu_position = isset( $values['cptm_menu_position'] ) ? esc_attr( $values['cptm_menu_position'][0] ) : ''; … … 829 833 * @param object $post Wordpress $post object 830 834 */ 831 public function cptm_tax_meta_box( $post ) 835 public function cptm_tax_meta_box( $post ) 832 836 { 833 837 // get post meta values … … 845 849 $cptm_tax_rewrite = isset( $values['cptm_tax_rewrite'] ) ? esc_attr( $values['cptm_tax_rewrite'][0] ) : ''; 846 850 $cptm_tax_query_var = isset( $values['cptm_tax_query_var'] ) ? esc_attr( $values['cptm_tax_query_var'][0] ) : ''; 851 $cptm_tax_show_admin_column = isset( $values['cptm_tax_show_admin_column'] ) ? esc_attr( $values['cptm_tax_show_admin_column'][0] ) : ''; 847 852 848 853 // checkbox fields … … 957 962 </tr> 958 963 <tr> 964 <td class="label"> 965 <label for="cptm_tax_show_admin_column"><?php _e( 'Admin Column', 'custom-post-type-maker' ); ?></label> 966 <p><?php _e( 'Show this taxonomy as a column in the custom post listing.', 'custom-post-type-maker' ); ?></p> 967 </td> 968 <td> 969 <select name="cptm_tax_show_admin_column" id="cptm_tax_show_admin_column" tabindex="8"> 970 <option value="1" <?php selected( $cptm_tax_show_admin_column, '1' ); ?>><?php _e( 'True', 'custom-post-type-maker' ); ?> (<?php _e( 'default', 'custom-post-type-maker' ); ?>)</option> 971 <option value="0" <?php selected( $cptm_tax_show_admin_column, '0' ); ?>><?php _e( 'False', 'custom-post-type-maker' ); ?></option> 972 </select> 973 </td> 974 </tr> 975 <tr> 959 976 <td class="label top"> 960 977 <label for="cptm_tax_post_types"><?php _e( 'Post Types', 'custom-post-type-maker' ); ?></label> … … 980 997 <?php 981 998 } 982 999 983 1000 /** 984 1001 * Save custom post … … 986 1003 * @param int $post_id Wordpress Post ID 987 1004 */ 988 public function cptm_save_post( $post_id ) 1005 public function cptm_save_post( $post_id ) 989 1006 { 990 1007 // verify if this is an auto save routine. … … 1011 1028 if ( isset($_POST['cptm_icon_slug']) ) 1012 1029 update_post_meta( $post_id, 'cptm_icon_slug', esc_textarea( $_POST['cptm_icon_slug'] ) ); 1013 1030 1014 1031 if ( isset($_POST['cptm_icon_url']) ) 1015 1032 update_post_meta( $post_id, 'cptm_icon_url', esc_textarea( $_POST['cptm_icon_url'] ) ); … … 1050 1067 if ( isset( $_POST['cptm_query_var'] ) ) 1051 1068 update_post_meta( $post_id, 'cptm_query_var', esc_attr( $_POST['cptm_query_var'] ) ); 1052 1069 1053 1070 if ( isset( $_POST['cptm_publicly_queryable'] ) ) 1054 1071 update_post_meta( $post_id, 'cptm_publicly_queryable', esc_attr( $_POST['cptm_publicly_queryable'] ) ); … … 1091 1108 update_post_meta( $post_id, 'cptm_tax_query_var', esc_attr( $_POST['cptm_tax_query_var'] ) ); 1092 1109 1110 if ( isset( $_POST['cptm_tax_show_admin_column'] ) ) 1111 update_post_meta( $post_id, 'cptm_tax_show_admin_column', esc_attr( $_POST['cptm_tax_show_admin_column'] ) ); 1112 1093 1113 $cptm_tax_post_types = isset( $_POST['cptm_tax_post_types'] ) ? $_POST['cptm_tax_post_types'] : array(); 1094 1114 update_post_meta( $post_id, 'cptm_tax_post_types', $cptm_tax_post_types ); … … 1097 1117 update_option( 'cptm_plugin_settings_changed', true ); 1098 1118 } 1099 1119 1100 1120 /** 1101 1121 * Flush rewrite rules 1102 1122 */ 1103 function cptm_plugin_settings_flush_rewrite() 1123 function cptm_plugin_settings_flush_rewrite() 1104 1124 { 1105 1125 if ( get_option( 'cptm_plugin_settings_changed' ) == true ) { … … 1112 1132 * Flush rewrite rules on plugin activation 1113 1133 */ 1114 function cptm_plugin_activate_flush_rewrite() 1134 function cptm_plugin_activate_flush_rewrite() 1115 1135 { 1116 1136 $this->cptm_create_custom_post_types(); 1117 1137 flush_rewrite_rules(); 1118 1138 } 1119 1139 1120 1140 /** 1121 1141 * Modify existing columns … … 1124 1144 * @return object Modified columns 1125 1145 */ 1126 function cptm_change_columns( $cols ) 1146 function cptm_change_columns( $cols ) 1127 1147 { 1128 1148 $cols = array( … … 1135 1155 return $cols; 1136 1156 } 1137 1157 1138 1158 /** 1139 1159 * Make columns sortable … … 1141 1161 * @return array Sortable array 1142 1162 */ 1143 function cptm_sortable_columns() 1163 function cptm_sortable_columns() 1144 1164 { 1145 1165 return array( … … 1154 1174 * @param int $post_id Wordpress Post ID 1155 1175 */ 1156 function cptm_custom_columns( $column, $post_id ) 1176 function cptm_custom_columns( $column, $post_id ) 1157 1177 { 1158 1178 switch ( $column ) { … … 1168 1188 } 1169 1189 } 1170 1190 1171 1191 /** 1172 1192 * Modify existing taxonomy columns … … 1175 1195 * @return array Modified taxonomy columns 1176 1196 */ 1177 function cptm_tax_change_columns( $cols ) 1197 function cptm_tax_change_columns( $cols ) 1178 1198 { 1179 1199 $cols = array( … … 1185 1205 return $cols; 1186 1206 } 1187 1207 1188 1208 /** 1189 1209 * Make taxonomy columns sortable … … 1191 1211 * @return array Sortable array 1192 1212 */ 1193 function cptm_tax_sortable_columns() 1213 function cptm_tax_sortable_columns() 1194 1214 { 1195 1215 return array( … … 1197 1217 ); 1198 1218 } 1199 1219 1200 1220 /** 1201 1221 * Insert custom taxonomy columns … … 1204 1224 * @param int $post_id Wordpress Post ID 1205 1225 */ 1206 function cptm_tax_custom_columns( $column, $post_id ) 1226 function cptm_tax_custom_columns( $column, $post_id ) 1207 1227 { 1208 1228 switch ( $column ) { … … 1215 1235 } 1216 1236 } 1217 1237 1218 1238 /** 1219 1239 * Insert admin footer 1220 1240 */ 1221 function cptm_admin_footer() 1241 function cptm_admin_footer() 1222 1242 { 1223 1243 global $post_type; … … 1442 1462 } 1443 1463 } 1444 1464 1445 1465 /** 1446 1466 * Update messages … … 1449 1469 * @return array Update messages 1450 1470 */ 1451 function cptm_post_updated_messages( $messages ) 1471 function cptm_post_updated_messages( $messages ) 1452 1472 { 1453 1473 global $post, $post_ID; … … 1470 1490 return $messages; 1471 1491 } 1472 1492 1473 1493 /** 1474 1494 * Prepare attachment for Ajax Upload Request -
custom-post-type-maker/trunk/readme.txt
r1706375 r1836611 67 67 == Changelog == 68 68 69 = 1.1.4 70 - Add ability to show custom taxonomy column in post listing. 71 69 72 = 1.1.3 70 73 - Removed forgotten development dump. Sorry about that.
Note: See TracChangeset
for help on using the changeset viewer.