Custom Post Type UI - Version 1.5.8

Version Description

  • 2018-04-16 =
  • Fixed: Corrected issue with "Get Code" area regarding post types and "show in menu" field values.
  • Fixed: Add post_format taxonomy support for CPTUI post types that declare post formats support. This primarily addresses issues with previewing changes for existing post type posts with post_format support.
  • Fixed: Add "show_in_nav_menus" settings/output to tools section.
  • Fixed: "Undefined index" notices for show_in_rest and rest_base settings.
  • Updated: Change how we hide submit button when editing exisitng post types or taxes so switching is available if a javascript error occurs.
  • Updated sidebar links for Pluginize products.
Download this release

Release Info

Developer tw2113
Plugin Icon 128x128 Custom Post Type UI
Version 1.5.8
Comparing to
See all releases

Code changes from version 1.5.7 to 1.5.8

css/cptui.css CHANGED
@@ -215,11 +215,6 @@
215
  right: 0;
216
  }
217
 
218
- .js #cptui_select_post_type input[type='submit'],
219
- .js #cptui_select_taxonomy input[type='submit'] {
220
- display: none;
221
- }
222
-
223
  #togglelabels {
224
  display: none;
225
  }
215
  right: 0;
216
  }
217
 
 
 
 
 
 
218
  #togglelabels {
219
  display: none;
220
  }
css/cptui.min.css CHANGED
@@ -1 +1 @@
1
- .posttypesui,.taxonomiesui{width:calc(100% - 300px)}.posttypesui .cptui-section:first-child,.taxonomiesui .cptui-section:first-child{margin-top:30px}.posttypesui .postbox-container,.taxonomiesui .postbox-container{width:100%}.posttypesui .postbox .toggle-indicator:before,.taxonomiesui .postbox .toggle-indicator:before{content:"\f142";display:inline-block;font:normal 20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.posttypesui .postbox.closed .handlediv .toggle-indicator:before,.taxonomiesui .postbox.closed .handlediv .toggle-indicator:before{content:"\f140"}.posttypesui .postbox .hndle,.taxonomiesui .postbox .hndle{cursor:pointer}.posttypesui .required,.taxonomiesui .required{color:red}.cptui-table #excerpt{display:inline-block;height:16px;margin:12px 4px 12px 0;width:auto}.cptui-table td.outter{vertical-align:top;width:50%}.cptui-edit .cptui-table textarea,.cptui-new .cptui-table textarea,.cptui-table input[type=text]{width:75%}.cptui-table .question:hover{cursor:pointer}.cptui-table th p{font-weight:400;font-size:12px}.cptui-table .cptui-slug-details{margin-top:15px}.cptui-table #slugchanged{color:red;font-weight:700}.cptui-table #slugchanged.hidemessage{display:none}.cptui-support #support .question{font-size:18px;font-weight:700}.cptui-support #support .question:before{content:"\f139";display:inline-block;font:normal 25px/1 dashicons;margin-left:-25px;position:absolute;-webkit-font-smoothing:antialiased}.cptui-support #support .question.active:before{content:"\f140"}.cptui-support #support .answer{margin:10px 0 0 20px}.cptui-support #support ol li{list-style:none}.cptui-support #support li{position:relative}.cptui-field-description{font-style:italic}#cptui_select_post_type,#cptui_select_taxonomy{margin-top:15px}.cptui_post_import,.cptui_tax_import{height:200px;margin-bottom:10px;resize:vertical;width:100%}.cptui_post_type_get_code,.cptui_tax_get_code{height:300px;resize:vertical;width:100%}.about-wrap .cptui-feature{overflow:visible!important;*zoom:1}.about-wrap .cptui-feature:after,.about-wrap .cptui-feature:before{content:" ";display:table}.about-wrap .cptui-feature:after{clear:both}.about-wrap h3+.cptui-feature{margin-top:0}.about-wrap .changelog h2{text-align:center}.about-wrap .feature-rest div{width:50%!important;padding-right:100px;box-sizing:border-box;margin:0!important}.about-wrap .feature-rest div.last-feature{padding-left:100px;padding-right:0}.about-wrap .feature-rest div.icon{width:0!important;padding:0;margin:0}.about-wrap .feature-rest div.icon:before{font-weight:400;width:100%;font-size:170px;line-height:125px;color:#9c5d90;display:inline-block;position:relative;text-align:center;speak:none;margin:0 0 0 -100px;content:"\e01d";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.rtl .about-wrap .feature-rest div{padding-left:100px}.rtl .about-wrap .feature-rest div.last-feature{padding-right:100px;padding-left:0}.rtl .about-wrap .feature-rest div.icon:before{margin:0 -100px 0 0}.about-wrap .about-integrations{background:#fff;margin:20px 0;padding:1px 20px 10px}.about-wrap .changelog h4{line-height:1.4}.about-wrap .cptui-about-text{margin-bottom:1em!important}.about-wrap .cptui-badge{position:absolute;top:0;right:0}#togglelabels,.js #cptui_select_post_type input[type=submit],.js #cptui_select_taxonomy input[type=submit]{display:none}.js #togglelabels{display:inline-block}.cptui-help{color:#424242;margin-left:4px;opacity:.5;text-decoration:none;width:16px}fieldset .cptui-help{position:relative;top:4px}.cptui-help:hover{color:#0074a2;opacity:1}.cptui-help:focus{box-shadow:none}#toplevel_page_cptui_main_menu img{height:20px;margin-top:-2px;width:20px}.visuallyhidden{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.cptui-section fieldset{border:1px solid #ccc;display:block;margin-bottom:30px;padding:10px;overflow:hidden}.js .cptui-section fieldset.toggledclosed{height:1px}.cptui-section legend{border:1px solid #ccc;border-bottom:0;font-size:14px;font-weight:700;padding:5px}.cptui-spacer{display:block;margin-top:25px}.wdspromos{float:right;margin-left:20px;margin-top:10px;width:275px}.wdspromos #mc_embed_signup{background:#fff;border:1px solid #ccc;clear:left;margin-bottom:10px}.wdspromos-about{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-line-pack:stretch;align-content:stretch;-ms-flex-align:start;align-items:flex-start;margin:20px 0}.wdspromos-about a:first-child,.wdspromos-about a:nth-child(2),.wdspromos-about a:nth-child(3){-ms-flex-order:0;order:0;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-item-align:auto;-ms-grid-row-align:auto;align-self:auto}.wdspromos-about p{padding:0 5px}.wdspromos-about p:first-child{padding-left:0}.wdspromos-about p:nth-child(4){padding-right:0}.no-js #cptui_choose_icon{display:none}.cptui-listings th{font-weight:700}.cptui-listings .post-type-listing th{width:16.66667%}.cptui-listings .taxonomy-listing th{width:20%}#poststuff{min-width:463px}@media screen and (min-width:768px){.cptui-badge{padding-top:142px;height:50px;width:173px;color:#fafafa;font-weight:700;font-size:14px;text-align:center;margin:0 -5px;background:url(../images/cptui-icon-173x173.png) no-repeat}}@media screen and (max-width:768px){.cptui-table #description{width:100%}.wdspromos-about{-ms-flex-wrap:wrap;flex-wrap:wrap}.wdspromos-about p{margin:5px auto}.wdspromos-about p:first-child{padding-left:5px}.wdspromos-about p:nth-child(4){padding-right:5px}}
1
+ .posttypesui,.taxonomiesui{width:calc(100% - 300px)}.posttypesui .cptui-section:first-child,.taxonomiesui .cptui-section:first-child{margin-top:30px}.posttypesui .postbox-container,.taxonomiesui .postbox-container{width:100%}.posttypesui .postbox .toggle-indicator:before,.taxonomiesui .postbox .toggle-indicator:before{content:"\f142";display:inline-block;font:normal 20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.posttypesui .postbox.closed .handlediv .toggle-indicator:before,.taxonomiesui .postbox.closed .handlediv .toggle-indicator:before{content:"\f140"}.posttypesui .postbox .hndle,.taxonomiesui .postbox .hndle{cursor:pointer}.posttypesui .required,.taxonomiesui .required{color:red}.cptui-table #excerpt{display:inline-block;height:16px;margin:12px 4px 12px 0;width:auto}.cptui-table td.outter{vertical-align:top;width:50%}.cptui-edit .cptui-table textarea,.cptui-new .cptui-table textarea,.cptui-table input[type=text]{width:75%}.cptui-table .question:hover{cursor:pointer}.cptui-table th p{font-weight:400;font-size:12px}.cptui-table .cptui-slug-details{margin-top:15px}.cptui-table #slugchanged{color:red;font-weight:700}.cptui-table #slugchanged.hidemessage{display:none}.cptui-support #support .question{font-size:18px;font-weight:700}.cptui-support #support .question:before{content:"\f139";display:inline-block;font:normal 25px/1 dashicons;margin-left:-25px;position:absolute;-webkit-font-smoothing:antialiased}.cptui-support #support .question.active:before{content:"\f140"}.cptui-support #support .answer{margin:10px 0 0 20px}.cptui-support #support ol li{list-style:none}.cptui-support #support li{position:relative}.cptui-field-description{font-style:italic}#cptui_select_post_type,#cptui_select_taxonomy{margin-top:15px}.cptui_post_import,.cptui_tax_import{height:200px;margin-bottom:10px;resize:vertical;width:100%}.cptui_post_type_get_code,.cptui_tax_get_code{height:300px;resize:vertical;width:100%}.about-wrap .cptui-feature{overflow:visible!important;*zoom:1}.about-wrap .cptui-feature:after,.about-wrap .cptui-feature:before{content:" ";display:table}.about-wrap .cptui-feature:after{clear:both}.about-wrap h3+.cptui-feature{margin-top:0}.about-wrap .changelog h2{text-align:center}.about-wrap .feature-rest div{width:50%!important;padding-right:100px;box-sizing:border-box;margin:0!important}.about-wrap .feature-rest div.last-feature{padding-left:100px;padding-right:0}.about-wrap .feature-rest div.icon{width:0!important;padding:0;margin:0}.about-wrap .feature-rest div.icon:before{font-weight:400;width:100%;font-size:170px;line-height:125px;color:#9c5d90;display:inline-block;position:relative;text-align:center;speak:none;margin:0 0 0 -100px;content:"\e01d";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.rtl .about-wrap .feature-rest div{padding-left:100px}.rtl .about-wrap .feature-rest div.last-feature{padding-right:100px;padding-left:0}.rtl .about-wrap .feature-rest div.icon:before{margin:0 -100px 0 0}.about-wrap .about-integrations{background:#fff;margin:20px 0;padding:1px 20px 10px}.about-wrap .changelog h4{line-height:1.4}.about-wrap .cptui-about-text{margin-bottom:1em!important}.about-wrap .cptui-badge{position:absolute;top:0;right:0}#togglelabels{display:none}.js #togglelabels{display:inline-block}.cptui-help{color:#424242;margin-left:4px;opacity:.5;text-decoration:none;width:16px}fieldset .cptui-help{position:relative;top:4px}.cptui-help:hover{color:#0074a2;opacity:1}.cptui-help:focus{box-shadow:none}#toplevel_page_cptui_main_menu img{height:20px;margin-top:-2px;width:20px}.visuallyhidden{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.cptui-section fieldset{border:1px solid #ccc;display:block;margin-bottom:30px;padding:10px;overflow:hidden}.js .cptui-section fieldset.toggledclosed{height:1px}.cptui-section legend{border:1px solid #ccc;border-bottom:0;font-size:14px;font-weight:700;padding:5px}.cptui-spacer{display:block;margin-top:25px}.wdspromos{float:right;margin-left:20px;margin-top:10px;width:275px}.wdspromos #mc_embed_signup{background:#fff;border:1px solid #ccc;clear:left;margin-bottom:10px}.wdspromos-about{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-line-pack:stretch;align-content:stretch;-ms-flex-align:start;align-items:flex-start;margin:20px 0}.wdspromos-about a:first-child,.wdspromos-about a:nth-child(2),.wdspromos-about a:nth-child(3){-ms-flex-order:0;order:0;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-item-align:auto;-ms-grid-row-align:auto;align-self:auto}.wdspromos-about p{padding:0 5px}.wdspromos-about p:first-child{padding-left:0}.wdspromos-about p:nth-child(4){padding-right:0}.no-js #cptui_choose_icon{display:none}.cptui-listings th{font-weight:700}.cptui-listings .post-type-listing th{width:16.66667%}.cptui-listings .taxonomy-listing th{width:20%}#poststuff{min-width:463px}@media screen and (min-width:768px){.cptui-badge{padding-top:142px;height:50px;width:173px;color:#fafafa;font-weight:700;font-size:14px;text-align:center;margin:0 -5px;background:url(../images/cptui-icon-173x173.png) no-repeat}}@media screen and (max-width:768px){.cptui-table #description{width:100%}.wdspromos-about{-ms-flex-wrap:wrap;flex-wrap:wrap}.wdspromos-about p{margin:5px auto}.wdspromos-about p:first-child{padding-left:5px}.wdspromos-about p:nth-child(4){padding-right:5px}}
css/cptui.scss CHANGED
@@ -199,12 +199,6 @@ $max-tablet: "screen and (max-width: 768px)";
199
  right: 0;
200
  }
201
  }
202
- .js {
203
- #cptui_select_post_type input[type='submit'],
204
- #cptui_select_taxonomy input[type='submit'] {
205
- display: none;
206
- }
207
- }
208
  #togglelabels {
209
  display: none;
210
  .js & {
199
  right: 0;
200
  }
201
  }
 
 
 
 
 
 
202
  #togglelabels {
203
  display: none;
204
  .js & {
custom-post-type-ui.php CHANGED
@@ -15,7 +15,7 @@ Plugin Name: Custom Post Type UI
15
  Plugin URI: https://github.com/WebDevStudios/custom-post-type-ui/
16
  Description: Admin panel for creating custom post types and custom taxonomies in WordPress
17
  Author: WebDevStudios
18
- Version: 1.5.7
19
  Author URI: https://webdevstudios.com/
20
  Text Domain: custom-post-type-ui
21
  Domain Path: /languages
@@ -27,8 +27,8 @@ if ( ! defined( 'ABSPATH' ) ) {
27
  exit;
28
  }
29
 
30
- define( 'CPT_VERSION', '1.5.7' ); // Left for legacy purposes.
31
- define( 'CPTUI_VERSION', '1.5.7' );
32
  define( 'CPTUI_WP_VERSION', get_bloginfo( 'version' ) );
33
 
34
  /**
15
  Plugin URI: https://github.com/WebDevStudios/custom-post-type-ui/
16
  Description: Admin panel for creating custom post types and custom taxonomies in WordPress
17
  Author: WebDevStudios
18
+ Version: 1.5.8
19
  Author URI: https://webdevstudios.com/
20
  Text Domain: custom-post-type-ui
21
  Domain Path: /languages
27
  exit;
28
  }
29
 
30
+ define( 'CPT_VERSION', '1.5.8' ); // Left for legacy purposes.
31
+ define( 'CPTUI_VERSION', '1.5.8' );
32
  define( 'CPTUI_WP_VERSION', get_bloginfo( 'version' ) );
33
 
34
  /**
inc/post-types.php CHANGED
@@ -177,7 +177,7 @@ function cptui_manage_post_types() {
177
  * @param string $value Text to use for the button.
178
  */
179
  ?>
180
- <input type="submit" class="button-secondary" name="cptui_select_post_type_submit" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_select', __( 'Select', 'custom-post-type-ui' ) ) ); ?>" />
181
  </form>
182
  <?php
183
 
177
  * @param string $value Text to use for the button.
178
  */
179
  ?>
180
+ <input type="submit" class="button-secondary" id="cptui_select_post_type_submit" name="cptui_select_post_type_submit" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_select', __( 'Select', 'custom-post-type-ui' ) ) ); ?>" />
181
  </form>
182
  <?php
183
 
inc/taxonomies.php CHANGED
@@ -179,7 +179,7 @@ function cptui_manage_taxonomies() {
179
  * @param string $value Text to use for the button.
180
  */
181
  ?>
182
- <input type="submit" class="button-secondary" name="cptui_select_taxonomy_submit" value="<?php echo esc_attr( apply_filters( 'cptui_taxonomy_submit_select', esc_attr__( 'Select', 'custom-post-type-ui' ) ) ); ?>" />
183
  </form>
184
  <?php
185
 
179
  * @param string $value Text to use for the button.
180
  */
181
  ?>
182
+ <input type="submit" class="button-secondary" id="cptui_select_taxonomy_submit" name="cptui_select_taxonomy_submit" value="<?php echo esc_attr( apply_filters( 'cptui_taxonomy_submit_select', esc_attr__( 'Select', 'custom-post-type-ui' ) ) ); ?>" />
183
  </form>
184
  <?php
185
 
inc/tools.php CHANGED
@@ -253,7 +253,10 @@ function cptui_get_single_taxonomy_registery( $taxonomy = array() ) {
253
  $show_in_nav_menus = $public;
254
  }
255
 
256
- $my_theme = wp_get_theme();
 
 
 
257
  $textdomain = $my_theme->get( 'TextDomain' );
258
  ?>
259
 
@@ -285,8 +288,8 @@ function cptui_get_single_taxonomy_registery( $taxonomy = array() ) {
285
  "query_var" => <?php echo disp_boolean( $taxonomy['query_var'] );?>,
286
  "rewrite" => <?php echo $rewrite; ?>,
287
  "show_admin_column" => <?php echo $taxonomy['show_admin_column']; ?>,
288
- "show_in_rest" => <?php echo disp_boolean( $taxonomy['show_in_rest'] ); ?>,
289
- "rest_base" => "<?php echo $taxonomy['rest_base']; ?>",
290
  "show_in_quick_edit" => <?php echo $show_in_quick_edit; ?>,
291
  );
292
  register_taxonomy( "<?php echo $taxonomy['name']; ?>", <?php echo $post_types; ?>, $args );
@@ -419,6 +422,22 @@ function cptui_get_single_post_type_registery( $post_type = array() ) {
419
  $post_type['show_in_rest'] = 'false';
420
  }
421
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
422
  $post_type['description'] = addslashes( $post_type['description'] );
423
 
424
  $my_theme = wp_get_theme();
@@ -456,10 +475,8 @@ function cptui_get_single_post_type_registery( $post_type = array() ) {
456
  "show_in_rest" => <?php echo disp_boolean( $post_type['show_in_rest'] ); ?>,
457
  "rest_base" => "<?php echo $post_type['rest_base']; ?>",
458
  "has_archive" => <?php echo $has_archive; ?>,
459
- "show_in_menu" => <?php echo disp_boolean( $post_type['show_in_menu'] ); ?>,
460
- <?php if ( ! empty( $post_type['show_in_menu_string'] ) ) { ?>
461
- "show_in_menu_string" => "<?php echo $post_type['show_in_menu_string']; ?>",
462
- <?php } ?>
463
  "exclude_from_search" => <?php echo disp_boolean( $post_type['exclude_from_search'] ); ?>,
464
  "capability_type" => "<?php echo $post_type['capability_type']; ?>",
465
  "map_meta_cap" => <?php echo disp_boolean( $post_type['map_meta_cap'] ); ?>,
253
  $show_in_nav_menus = $public;
254
  }
255
 
256
+ $show_in_rest = ( ! empty( $taxonomy['show_in_rest'] ) && false !== get_disp_boolean( $taxonomy['show_in_rest'] ) ) ? 'true' : 'false';
257
+ $rest_base = ( ! empty( $taxonomy['rest_base'] ) ) ? $taxonomy['rest_base'] : $taxonomy['name'];
258
+
259
+ $my_theme = wp_get_theme();
260
  $textdomain = $my_theme->get( 'TextDomain' );
261
  ?>
262
 
288
  "query_var" => <?php echo disp_boolean( $taxonomy['query_var'] );?>,
289
  "rewrite" => <?php echo $rewrite; ?>,
290
  "show_admin_column" => <?php echo $taxonomy['show_admin_column']; ?>,
291
+ "show_in_rest" => <?php echo $show_in_rest; ?>,
292
+ "rest_base" => "<?php echo $rest_base; ?>",
293
  "show_in_quick_edit" => <?php echo $show_in_quick_edit; ?>,
294
  );
295
  register_taxonomy( "<?php echo $taxonomy['name']; ?>", <?php echo $post_types; ?>, $args );
422
  $post_type['show_in_rest'] = 'false';
423
  }
424
 
425
+ $show_in_menu = get_disp_boolean( $post_type['show_in_menu'] );
426
+ if ( false !== $show_in_menu ) {
427
+ $show_in_menu = disp_boolean( $post_type['show_in_menu'] );
428
+ if ( ! empty( $post_type['show_in_menu_string'] ) ) {
429
+ $show_in_menu = '"' . $post_type['show_in_menu_string'] . '"';
430
+ }
431
+ } else {
432
+ $show_in_menu = disp_boolean( $post_type['show_in_menu'] );
433
+ }
434
+
435
+ $public = ( isset( $post_type['public'] ) ) ? disp_boolean( $post_type['public'] ) : 'true';
436
+ $show_in_nav_menus = ( ! empty( $post_type['show_in_nav_menus'] ) && false !== get_disp_boolean( $post_type['show_in_nav_menus'] ) ) ? 'true' : 'false';
437
+ if ( empty( $post_type['show_in_nav_menus'] ) ) {
438
+ $show_in_nav_menus = $public;
439
+ }
440
+
441
  $post_type['description'] = addslashes( $post_type['description'] );
442
 
443
  $my_theme = wp_get_theme();
475
  "show_in_rest" => <?php echo disp_boolean( $post_type['show_in_rest'] ); ?>,
476
  "rest_base" => "<?php echo $post_type['rest_base']; ?>",
477
  "has_archive" => <?php echo $has_archive; ?>,
478
+ "show_in_menu" => <?php echo $show_in_menu; ?>,
479
+ "show_in_nav_menus" => <?php echo $show_in_nav_menus; ?>,
 
 
480
  "exclude_from_search" => <?php echo disp_boolean( $post_type['exclude_from_search'] ); ?>,
481
  "capability_type" => "<?php echo $post_type['capability_type']; ?>",
482
  "map_meta_cap" => <?php echo disp_boolean( $post_type['map_meta_cap'] ); ?>,
inc/utility.php CHANGED
@@ -401,19 +401,19 @@ function cptui_get_ads() {
401
  */
402
  function cptui_default_ads( $ads = array() ) {
403
  $ads[] = array(
404
- 'url' => 'https://pluginize.com/plugins/custom-post-type-ui-extended/ref/pluginizeaff/?campaign=cptui-sidebar-extended',
405
  'image' => plugin_dir_url( dirname( __FILE__ ) ) . 'images/wds_ads/cptui-extended.png',
406
  'text' => 'Custom Post Type UI Extended product ad',
407
  );
408
 
409
  $ads[] = array(
410
- 'url' => 'https://pluginize.com/plugins/instago/ref/pluginizeaff/?campaign=cptui-sidebar-ig',
411
  'image' => plugin_dir_url( dirname( __FILE__ ) ) . 'images/wds_ads/instago.png',
412
  'text' => 'InstaGo product ad',
413
  );
414
 
415
  $ads[] = array(
416
- 'url' => 'https://pluginize.com/plugins/buddypages/ref/pluginizeaff/?campaign=cptui-sidebar-buddypages',
417
  'image' => plugin_dir_url( dirname( __FILE__ ) ) . 'images/wds_ads/buddypages.png',
418
  'text' => 'BuddyPages product ad',
419
  );
@@ -793,3 +793,23 @@ function cptui_post_type_supports( $post_type, $feature ) {
793
 
794
  return false;
795
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  */
402
  function cptui_default_ads( $ads = array() ) {
403
  $ads[] = array(
404
+ 'url' => 'https://pluginize.com/plugins/custom-post-type-ui-extended/?utm_source=cptui-sidebar&utm_medium=text&utm_campaign=cptui',
405
  'image' => plugin_dir_url( dirname( __FILE__ ) ) . 'images/wds_ads/cptui-extended.png',
406
  'text' => 'Custom Post Type UI Extended product ad',
407
  );
408
 
409
  $ads[] = array(
410
+ 'url' => 'https://pluginize.com/plugins/instago/?utm_source=cptui-sidebar&utm_medium=text&utm_campaign=instago',
411
  'image' => plugin_dir_url( dirname( __FILE__ ) ) . 'images/wds_ads/instago.png',
412
  'text' => 'InstaGo product ad',
413
  );
414
 
415
  $ads[] = array(
416
+ 'url' => 'https://pluginize.com/plugins/buddypages/?utm_source=cptui-sidebar&utm_medium=text&utm_campaign=buddypages',
417
  'image' => plugin_dir_url( dirname( __FILE__ ) ) . 'images/wds_ads/buddypages.png',
418
  'text' => 'BuddyPages product ad',
419
  );
793
 
794
  return false;
795
  }
796
+
797
+ /**
798
+ * Add missing post_format taxonomy support for CPTUI post types.
799
+ *
800
+ * Addresses bug wih previewing changes for published posts with post types that
801
+ * have post-formats support.
802
+ *
803
+ * @since 1.5.8
804
+ *
805
+ * @param array $post_types Array of CPTUI post types.
806
+ */
807
+ function cptui_published_post_format_fix( $post_types ) {
808
+ foreach ( $post_types as $type ) {
809
+ if ( in_array( 'post-formats', $type['supports'], true ) ) {
810
+ add_post_type_support( $type['name'], 'post-formats' );
811
+ register_taxonomy_for_object_type( 'post_format', $type['name'] );
812
+ }
813
+ }
814
+ }
815
+ add_action( 'cptui_post_register_post_types', 'cptui_published_post_format_fix' );
js/cptui.js CHANGED
@@ -8,6 +8,9 @@ postboxes.add_postbox_toggles(pagenow);
8
  */
9
  (function($) {
10
 
 
 
 
11
  if ('edit' === getParameterByName('action')) {
12
  // Store our original slug on page load for edit checking.
13
  var original_slug = $('#name').val();
8
  */
9
  (function($) {
10
 
11
+ $('#cptui_select_post_type_submit').hide();
12
+ $('#cptui_select_taxonomy_submit').hide();
13
+
14
  if ('edit' === getParameterByName('action')) {
15
  // Store our original slug on page load for edit checking.
16
  var original_slug = $('#name').val();
js/cptui.min.js CHANGED
@@ -1 +1 @@
1
- postboxes.add_postbox_toggles(pagenow),function($){function replaceDiacritics(s){for(var diacritics=[/[\300-\306]/g,/[\340-\346]/g,/[\310-\313]/g,/[\350-\353]/g,/[\314-\317]/g,/[\354-\357]/g,/[\322-\330]/g,/[\362-\370]/g,/[\331-\334]/g,/[\371-\374]/g,/[\321]/g,/[\361]/g,/[\307]/g,/[\347]/g],chars=["A","a","E","e","I","i","O","o","U","u","N","n","C","c"],i=0;i<diacritics.length;i++)s=s.replace(diacritics[i],chars[i]);return s}function replaceSpecialCharacters(s){return s=s.replace(/[^a-z0-9\s]/gi,"_")}function transliterate(word){return word.split("").map(function(char){return cyrillic[char]||char}).join("")}function getParameterByName(name,url){url||(url=window.location.href),name=name.replace(/[\[\]]/g,"\\$&");var regex=new RegExp("[?&]"+name+"(=([^&#]*)|&|#|$)"),results=regex.exec(url);return results?results[2]?decodeURIComponent(results[2].replace(/\+/g," ")):"":null}if("edit"===getParameterByName("action"))var original_slug=$("#name").val();$("#post_type").on("change",function(){$("#cptui_select_post_type").submit()}),$("#taxonomy").on("change",function(){$("#cptui_select_taxonomy").submit()}),$("#cpt_submit_delete").on("click",function(){return!!confirm(cptui_type_data.confirm)}),$("#support .question").each(function(){var tis=$(this),state=!1,answer=tis.next("div").slideUp();tis.on("click keydown",function(e){"keydown"===e.type&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),state=!state,answer.slideToggle(state),tis.toggleClass("active",state),tis.attr("aria-expanded",state.toString()),tis.focus())})}),$("#name").on("keyup",function(e){var value,original_value;if(value=original_value=$(this).val(),9!==e.keyCode&&37!==e.keyCode&&38!==e.keyCode&&39!==e.keyCode&&40!==e.keyCode&&(value=value.replace(/ /g,"_"),value=value.toLowerCase(),value=replaceDiacritics(value),value=transliterate(value),value=replaceSpecialCharacters(value),value!==original_value&&$(this).attr("value",value)),void 0!=original_slug){var $slugchanged=$("#slugchanged");value!=original_slug?$slugchanged.removeClass("hidemessage"):$slugchanged.addClass("hidemessage")}});var cyrillic={"Ё":"YO","Й":"I","Ц":"TS","У":"U","К":"K","Е":"E","Н":"N","Г":"G","Ш":"SH","Щ":"SCH","З":"Z","Х":"H","Ъ":"'","ё":"yo","й":"i","ц":"ts","у":"u","к":"k","е":"e","н":"n","г":"g","ш":"sh","щ":"sch","з":"z","х":"h","ъ":"'","Ф":"F","Ы":"I","В":"V","А":"a","П":"P","Р":"R","О":"O","Л":"L","Д":"D","Ж":"ZH","Э":"E","ф":"f","ы":"i","в":"v","а":"a","п":"p","р":"r","о":"o","л":"l","д":"d","ж":"zh","э":"e","Я":"Ya","Ч":"CH","С":"S","М":"M","И":"I","Т":"T","Ь":"'","Б":"B","Ю":"YU","я":"ya","ч":"ch","с":"s","м":"m","и":"i","т":"t","ь":"'","б":"b","ю":"yu"};if(void 0!=wp.media)var _custom_media=!0,_orig_send_attachment=wp.media.editor.send.attachment;$("#cptui_choose_icon").on("click",function(e){e.preventDefault();var button=$(this),id=jQuery("#menu_icon").attr("id");return _custom_media=!0,wp.media.editor.send.attachment=function(props,attachment){return _custom_media?void $("#"+id).val(attachment.url):_orig_send_attachment.apply(this,[props,attachment])},wp.media.editor.open(button),!1}),$("#togglelabels").on("click",function(e){e.preventDefault(),$("#labels_expand").toggleClass("toggledclosed")}),$("#togglesettings").on("click",function(e){e.preventDefault(),$("#settings_expand").toggleClass("toggledclosed")}),$("#labels_expand,#settings_expand").on("focus",function(e){$(this).hasClass("toggledclosed")&&$(this).toggleClass("toggledclosed")}),$("#labels_expand legend,#settings_expand legend").on("click",function(e){$(this).parent().toggleClass("toggledclosed")}),$(".cptui-help").on("click",function(e){e.preventDefault()}),$(".cptui-taxonomy-submit").on("click",function(e){0==$(".cptui-table :checkbox:checked").length&&(e.preventDefault(),alert(cptui_tax_data.no_associated_type))})}(jQuery);
1
+ postboxes.add_postbox_toggles(pagenow),function($){function replaceDiacritics(s){for(var diacritics=[/[\300-\306]/g,/[\340-\346]/g,/[\310-\313]/g,/[\350-\353]/g,/[\314-\317]/g,/[\354-\357]/g,/[\322-\330]/g,/[\362-\370]/g,/[\331-\334]/g,/[\371-\374]/g,/[\321]/g,/[\361]/g,/[\307]/g,/[\347]/g],chars=["A","a","E","e","I","i","O","o","U","u","N","n","C","c"],i=0;i<diacritics.length;i++)s=s.replace(diacritics[i],chars[i]);return s}function replaceSpecialCharacters(s){return s=s.replace(/[^a-z0-9\s]/gi,"_")}function transliterate(word){return word.split("").map(function(char){return cyrillic[char]||char}).join("")}if($("#cptui_select_post_type_submit").hide(),$("#cptui_select_taxonomy_submit").hide(),"edit"===function(name,url){url||(url=window.location.href),name=name.replace(/[\[\]]/g,"\\$&");var results=new RegExp("[?&]"+name+"(=([^&#]*)|&|#|$)").exec(url);return results?results[2]?decodeURIComponent(results[2].replace(/\+/g," ")):"":null}("action"))var original_slug=$("#name").val();$("#post_type").on("change",function(){$("#cptui_select_post_type").submit()}),$("#taxonomy").on("change",function(){$("#cptui_select_taxonomy").submit()}),$("#cpt_submit_delete").on("click",function(){return!!confirm(cptui_type_data.confirm)}),$("#support .question").each(function(){var tis=$(this),state=!1,answer=tis.next("div").slideUp();tis.on("click keydown",function(e){"keydown"===e.type&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),state=!state,answer.slideToggle(state),tis.toggleClass("active",state),tis.attr("aria-expanded",state.toString()),tis.focus())})}),$("#name").on("keyup",function(e){var value,original_value;if(value=original_value=$(this).val(),9!==e.keyCode&&37!==e.keyCode&&38!==e.keyCode&&39!==e.keyCode&&40!==e.keyCode&&(value=replaceSpecialCharacters(value=transliterate(value=replaceDiacritics(value=(value=value.replace(/ /g,"_")).toLowerCase()))))!==original_value&&$(this).attr("value",value),void 0!=original_slug){var $slugchanged=$("#slugchanged");value!=original_slug?$slugchanged.removeClass("hidemessage"):$slugchanged.addClass("hidemessage")}});var cyrillic={"Ё":"YO","Й":"I","Ц":"TS","У":"U","К":"K","Е":"E","Н":"N","Г":"G","Ш":"SH","Щ":"SCH","З":"Z","Х":"H","Ъ":"'","ё":"yo","й":"i","ц":"ts","у":"u","к":"k","е":"e","н":"n","г":"g","ш":"sh","щ":"sch","з":"z","х":"h","ъ":"'","Ф":"F","Ы":"I","В":"V","А":"a","П":"P","Р":"R","О":"O","Л":"L","Д":"D","Ж":"ZH","Э":"E","ф":"f","ы":"i","в":"v","а":"a","п":"p","р":"r","о":"o","л":"l","д":"d","ж":"zh","э":"e","Я":"Ya","Ч":"CH","С":"S","М":"M","И":"I","Т":"T","Ь":"'","Б":"B","Ю":"YU","я":"ya","ч":"ch","с":"s","м":"m","и":"i","т":"t","ь":"'","б":"b","ю":"yu"};if(void 0!=wp.media)var _custom_media=!0,_orig_send_attachment=wp.media.editor.send.attachment;$("#cptui_choose_icon").on("click",function(e){e.preventDefault();var button=$(this),id=jQuery("#menu_icon").attr("id");return _custom_media=!0,wp.media.editor.send.attachment=function(props,attachment){if(!_custom_media)return _orig_send_attachment.apply(this,[props,attachment]);$("#"+id).val(attachment.url)},wp.media.editor.open(button),!1}),$("#togglelabels").on("click",function(e){e.preventDefault(),$("#labels_expand").toggleClass("toggledclosed")}),$("#togglesettings").on("click",function(e){e.preventDefault(),$("#settings_expand").toggleClass("toggledclosed")}),$("#labels_expand,#settings_expand").on("focus",function(e){$(this).hasClass("toggledclosed")&&$(this).toggleClass("toggledclosed")}),$("#labels_expand legend,#settings_expand legend").on("click",function(e){$(this).parent().toggleClass("toggledclosed")}),$(".cptui-help").on("click",function(e){e.preventDefault()}),$(".cptui-taxonomy-submit").on("click",function(e){0==$(".cptui-table :checkbox:checked").length&&(e.preventDefault(),alert(cptui_tax_data.no_associated_type))})}(jQuery);
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: webdevstudios, pluginize, tw2113, vegasgeek, modemlooper, williams
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3084056
4
  Tags: custom post types, CPT, CMS, post, types, post type, taxonomy, tax, custom, content types, post types
5
  Requires at least: 4.6
6
- Tested up to: 4.9.4
7
- Stable tag: 1.5.7
8
  License: GPL-2.0+
9
  Requires PHP: 5.2
10
 
@@ -31,6 +31,14 @@ Official development of Custom Post Type UI is on GitHub, with official stable r
31
 
32
  == Changelog ==
33
 
 
 
 
 
 
 
 
 
34
  = 1.5.7 - 2018-03-07 =
35
  * Added: "output" added to blacklisted taxonomy slug list.
36
  * Fixed: Prevent potential fatal error with customized links in plugin list page.
@@ -39,7 +47,7 @@ Official development of Custom Post Type UI is on GitHub, with official stable r
39
 
40
  = 1.5.6 - 2017-11-09 =
41
  * Added: Added "custom_css", "customize_changeset", "author", and "post_type" as reserved post_types.
42
- * Fixed: The "Invalid JSON" error message was receiving the wrong color indicator for for the admin notice.
43
 
44
  = 1.5.5 - 2017-07-27 =
45
  * Fixed: Prevent possible conflicts with .required css selector by prefixing ours.
@@ -117,6 +125,14 @@ Official development of Custom Post Type UI is on GitHub, with official stable r
117
 
118
  == Upgrade Notice ==
119
 
 
 
 
 
 
 
 
 
120
  = 1.5.7 - 2018-03-07 =
121
  * Added: "output" added to blacklisted taxonomy slug list.
122
  * Fixed: Prevent potential fatal error with customized links in plugin list page.
@@ -125,7 +141,7 @@ Official development of Custom Post Type UI is on GitHub, with official stable r
125
 
126
  = 1.5.6 - 2017-11-09 =
127
  * Added: Added "custom_css", "customize_changeset", "author", and "post_type" as reserved post_types.
128
- * Fixed: The "Invalid JSON" error message was receiving the wrong color indicator for for the admin notice.
129
 
130
  = 1.5.5 - 2017-07-27 =
131
  * Fixed: Prevent possible conflicts with .required css selector by prefixing ours.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3084056
4
  Tags: custom post types, CPT, CMS, post, types, post type, taxonomy, tax, custom, content types, post types
5
  Requires at least: 4.6
6
+ Tested up to: 4.9.5
7
+ Stable tag: 1.5.8
8
  License: GPL-2.0+
9
  Requires PHP: 5.2
10
 
31
 
32
  == Changelog ==
33
 
34
+ = 1.5.8 - 2018-04-16 =
35
+ * Fixed: Corrected issue with "Get Code" area regarding post types and "show in menu" field values.
36
+ * Fixed: Add post_format taxonomy support for CPTUI post types that declare post formats support. This primarily addresses issues with previewing changes for existing post type posts with post_format support.
37
+ * Fixed: Add "show_in_nav_menus" settings/output to tools section.
38
+ * Fixed: "Undefined index" notices for show_in_rest and rest_base settings.
39
+ * Updated: Change how we hide submit button when editing exisitng post types or taxes so switching is available if a javascript error occurs.
40
+ * Updated sidebar links for Pluginize products.
41
+
42
  = 1.5.7 - 2018-03-07 =
43
  * Added: "output" added to blacklisted taxonomy slug list.
44
  * Fixed: Prevent potential fatal error with customized links in plugin list page.
47
 
48
  = 1.5.6 - 2017-11-09 =
49
  * Added: Added "custom_css", "customize_changeset", "author", and "post_type" as reserved post_types.
50
+ * Fixed: The "Invalid JSON" error message was receiving the wrong color indicator for the admin notice.
51
 
52
  = 1.5.5 - 2017-07-27 =
53
  * Fixed: Prevent possible conflicts with .required css selector by prefixing ours.
125
 
126
  == Upgrade Notice ==
127
 
128
+ = 1.5.8 - 2018-04-16 =
129
+ * Fixed: Corrected issue with "Get Code" area regarding post types and "show in menu" field values.
130
+ * Fixed: Add post_format taxonomy support for CPTUI post types that declare post formats support. This primarily addresses issues with previewing changes for existing post type posts with post_format support.
131
+ * Fixed: Add "show_in_nav_menus" settings/output to tools section.
132
+ * Fixed: "Undefined index" notices for show_in_rest and rest_base settings.
133
+ * Updated: Change how we hide submit button when editing exisitng post types or taxes so switching is available if a javascript error occurs.
134
+ * Updated sidebar links for Pluginize products.
135
+
136
  = 1.5.7 - 2018-03-07 =
137
  * Added: "output" added to blacklisted taxonomy slug list.
138
  * Fixed: Prevent potential fatal error with customized links in plugin list page.
141
 
142
  = 1.5.6 - 2017-11-09 =
143
  * Added: Added "custom_css", "customize_changeset", "author", and "post_type" as reserved post_types.
144
+ * Fixed: The "Invalid JSON" error message was receiving the wrong color indicator for the admin notice.
145
 
146
  = 1.5.5 - 2017-07-27 =
147
  * Fixed: Prevent possible conflicts with .required css selector by prefixing ours.