Custom Post Type UI - Version 1.3.4

Version Description

  • 2016-5-4 =
  • Fixed: moved WDS-based services "ads" to within the plugin itself. Will not request remote resources.
  • Fixed: Better output formatting if WDS/Pluginize "ads" failed to load images.
  • Fixed: undefined variable error in cptui.js
  • Added: Newsletter subscription form to stay uptodate with Custom Post Type UI & Custom Post Type UI Extended news.
  • Added: Support page/FAQ info regarding Pluginize and recent sidebar developments.
Download this release

Release Info

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

Code changes from version 1.3.3 to 1.3.4

css/cptui.css CHANGED
@@ -260,6 +260,9 @@ fieldset .cptui-help {
260
  width: 275px;
261
  }
262
 
263
- .wdspromos img {
 
 
 
264
  margin-bottom: 10px;
265
  }
260
  width: 275px;
261
  }
262
 
263
+ .wdspromos #mc_embed_signup {
264
+ background: #fff;
265
+ border: solid #cccccc 1px;
266
+ clear: left;
267
  margin-bottom: 10px;
268
  }
css/cptui.min.css CHANGED
@@ -1 +1 @@
1
- .posttypesui .cptui-section:first-child,.taxonomiesui .cptui-section:first-child{margin-top:30px}.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:50%}.cptui-table .question:hover{cursor:pointer}.cptui-table th p{font-weight:400;font-size:12px}.cptui-table .cptui-slug-details{margin-top:15px}#support .question{font-size:18px;font-weight:700}#support .question:before{content:"\f139";display:inline-block;font:normal 25px/1 dashicons;margin-left:-25px;position:absolute;-webkit-font-smoothing:antialiased}#support .question.active:before{content:"\f140"}#support .answer{margin:10px 0 0 20px}#support ol li{list-style:none}#support li{position:relative}.required{color:red}.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%}.one-third{width:33%}.valign{vertical-align:top}.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 .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-integrations{background:#fff;margin:20px 0;padding:1px 20px 10px}.changelog h4{line-height:1.4}.cptui-about-text{margin-bottom:1em!important}#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 img{margin-bottom:10px}
1
+ .posttypesui .cptui-section:first-child,.taxonomiesui .cptui-section:first-child{margin-top:30px}.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:50%}.cptui-table .question:hover{cursor:pointer}.cptui-table th p{font-weight:400;font-size:12px}.cptui-table .cptui-slug-details{margin-top:15px}#support .question{font-size:18px;font-weight:700}#support .question:before{content:"\f139";display:inline-block;font:normal 25px/1 dashicons;margin-left:-25px;position:absolute;-webkit-font-smoothing:antialiased}#support .question.active:before{content:"\f140"}#support .answer{margin:10px 0 0 20px}#support ol li{list-style:none}#support li{position:relative}.required{color:red}.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%}.one-third{width:33%}.valign{vertical-align:top}.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 .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-integrations{background:#fff;margin:20px 0;padding:1px 20px 10px}.changelog h4{line-height:1.4}.cptui-about-text{margin-bottom:1em!important}#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}
css/cptui.scss CHANGED
@@ -238,7 +238,10 @@
238
  margin-top: 10px;
239
  width: 275px;
240
 
241
- img {
 
 
 
242
  margin-bottom: 10px;
243
  }
244
  }
238
  margin-top: 10px;
239
  width: 275px;
240
 
241
+ #mc_embed_signup {
242
+ background: #fff;
243
+ border: solid rgb(204, 204, 204) 1px;
244
+ clear: left;
245
  margin-bottom: 10px;
246
  }
247
  }
custom-post-type-ui.php CHANGED
@@ -13,7 +13,7 @@ Plugin Name: Custom Post Type UI
13
  Plugin URI: https://github.com/WebDevStudios/custom-post-type-ui/
14
  Description: Admin panel for creating custom post types and custom taxonomies in WordPress
15
  Author: WebDevStudios
16
- Version: 1.3.3
17
  Author URI: https://webdevstudios.com/
18
  Text Domain: custom-post-type-ui
19
  Domain Path: /languages
@@ -25,8 +25,8 @@ if ( ! defined( 'ABSPATH' ) ) {
25
  exit;
26
  }
27
 
28
- define( 'CPT_VERSION', '1.3.3' ); // Left for legacy purposes.
29
- define( 'CPTUI_VERSION', '1.3.3' );
30
  define( 'CPTUI_WP_VERSION', get_bloginfo( 'version' ) );
31
 
32
  /**
13
  Plugin URI: https://github.com/WebDevStudios/custom-post-type-ui/
14
  Description: Admin panel for creating custom post types and custom taxonomies in WordPress
15
  Author: WebDevStudios
16
+ Version: 1.3.4
17
  Author URI: https://webdevstudios.com/
18
  Text Domain: custom-post-type-ui
19
  Domain Path: /languages
25
  exit;
26
  }
27
 
28
+ define( 'CPT_VERSION', '1.3.4' ); // Left for legacy purposes.
29
+ define( 'CPTUI_VERSION', '1.3.4' );
30
  define( 'CPTUI_WP_VERSION', get_bloginfo( 'version' ) );
31
 
32
  /**
images/wds_ads/apppresser.png ADDED
Binary file
images/wds_ads/cptuix-ad-3.png ADDED
Binary file
images/wds_ads/maintainn.png ADDED
Binary file
inc/import_export.php CHANGED
@@ -384,6 +384,7 @@ function cptui_get_single_post_type_registery( $post_type = array() ) {
384
  "labels" => $labels,
385
  "description" => "<?php echo $post_type['description']; ?>",
386
  "public" => <?php echo disp_boolean( $post_type['public'] ); ?>,
 
387
  "show_ui" => <?php echo disp_boolean( $post_type['show_ui'] ); ?>,
388
  "show_in_rest" => <?php echo disp_boolean( $post_type['show_in_rest'] ); ?>,
389
  "rest_base" => "<?php echo $post_type['rest_base']; ?>",
384
  "labels" => $labels,
385
  "description" => "<?php echo $post_type['description']; ?>",
386
  "public" => <?php echo disp_boolean( $post_type['public'] ); ?>,
387
+ "publicly_queryable" => <?php echo disp_boolean( $post_type['publicly_queryable'] ); ?>,
388
  "show_ui" => <?php echo disp_boolean( $post_type['show_ui'] ); ?>,
389
  "show_in_rest" => <?php echo disp_boolean( $post_type['show_in_rest'] ); ?>,
390
  "rest_base" => "<?php echo $post_type['rest_base']; ?>",
inc/post-types.php CHANGED
@@ -66,7 +66,7 @@ function cptui_post_type_tabs( $tabs = array(), $current_page = '' ) {
66
  'text' => __( 'Add New Post Type', 'custom-post-type-ui' ),
67
  'classes' => $classes,
68
  'url' => cptui_admin_url( 'admin.php?page=cptui_manage_' . $current_page ),
69
- 'aria-selected' => 'false'
70
  );
71
 
72
  $action = cptui_get_current_action();
@@ -248,7 +248,7 @@ function cptui_manage_post_types() {
248
  'labeltext' => esc_html__( 'Plural Label', 'custom-post-type-ui' ),
249
  'aftertext' => esc_html__( '(e.g. Movies)', 'custom-post-type-ui' ),
250
  'helptext' => esc_html__( 'Used for the post type admin menu item.', 'custom-post-type-ui' ),
251
- 'required' => true
252
  ) );
253
 
254
  echo $ui->get_text_input( array(
@@ -258,7 +258,7 @@ function cptui_manage_post_types() {
258
  'labeltext' => esc_html__( 'Singular Label', 'custom-post-type-ui' ),
259
  'aftertext' => esc_html__( '(e.g. Movie)', 'custom-post-type-ui' ),
260
  'helptext' => esc_html__( 'Used when a singular label is needed.', 'custom-post-type-ui' ),
261
- 'required' => true
262
  ) );
263
  ?>
264
  </table>
@@ -316,7 +316,7 @@ function cptui_manage_post_types() {
316
  </p>
317
  <?php
318
  $fieldset_classes = ( 'edit' == $tab ) ? '' : 'toggledclosed';
319
- echo $ui->get_fieldset_start( array( 'id' => 'labels_expand', 'classes' => array( $fieldset_classes ) ) );
320
  echo $ui->get_legend_start();
321
  esc_html_e( 'Additional labels', 'custom-post-type-ui' );
322
  echo $ui->get_legend_end();
@@ -334,7 +334,7 @@ function cptui_manage_post_types() {
334
  'cols' => '40',
335
  'textvalue' => ( isset( $current['description'] ) ) ? esc_textarea( $current['description'] ) : '',
336
  'labeltext' => __( 'Post Type Description', 'custom-post-type-ui' ),
337
- 'helptext' => esc_attr__( 'Perhaps describe what your custom post type is used for?', 'custom-post-type-ui' )
338
  ) );
339
 
340
  echo $ui->get_text_input( array(
@@ -343,7 +343,7 @@ function cptui_manage_post_types() {
343
  'namearray' => 'cpt_labels',
344
  'name' => 'menu_name',
345
  'textvalue' => ( isset( $current['labels']['menu_name'] ) ) ? esc_attr( $current['labels']['menu_name'] ) : '',
346
- 'aftertext' => __( '(e.g. My Movies)', 'custom-post-type-ui' )
347
  ) );
348
 
349
  echo $ui->get_text_input( array(
@@ -352,7 +352,7 @@ function cptui_manage_post_types() {
352
  'namearray' => 'cpt_labels',
353
  'name' => 'all_items',
354
  'textvalue' => ( isset( $current['labels']['all_items'] ) ) ? esc_attr( $current['labels']['all_items'] ) : '',
355
- 'aftertext' => __( '(e.g. All Movies)', 'custom-post-type-ui' )
356
  ) );
357
 
358
  echo $ui->get_text_input( array(
@@ -361,7 +361,7 @@ function cptui_manage_post_types() {
361
  'namearray' => 'cpt_labels',
362
  'name' => 'add_new',
363
  'textvalue' => ( isset( $current['labels']['add_new'] ) ) ? esc_attr( $current['labels']['add_new'] ) : '',
364
- 'aftertext' => __( '(e.g. Add New)', 'custom-post-type-ui' )
365
  ) );
366
 
367
  echo $ui->get_text_input( array(
@@ -370,7 +370,7 @@ function cptui_manage_post_types() {
370
  'namearray' => 'cpt_labels',
371
  'name' => 'add_new_item',
372
  'textvalue' => ( isset( $current['labels']['add_new_item'] ) ) ? esc_attr( $current['labels']['add_new_item'] ) : '',
373
- 'aftertext' => __( '(e.g. Add New Movie)', 'custom-post-type-ui' )
374
  ) );
375
 
376
  echo $ui->get_text_input( array(
@@ -379,7 +379,7 @@ function cptui_manage_post_types() {
379
  'namearray' => 'cpt_labels',
380
  'name' => 'edit_item',
381
  'textvalue' => ( isset( $current['labels']['edit_item'] ) ) ? esc_attr( $current['labels']['edit_item'] ) : '',
382
- 'aftertext' => __( '(e.g. Edit Movie)', 'custom-post-type-ui' )
383
  ) );
384
 
385
  echo $ui->get_text_input( array(
@@ -388,7 +388,7 @@ function cptui_manage_post_types() {
388
  'namearray' => 'cpt_labels',
389
  'name' => 'new_item',
390
  'textvalue' => ( isset( $current['labels']['new_item'] ) ) ? esc_attr( $current['labels']['new_item'] ) : '',
391
- 'aftertext' => __( '(e.g. New Movie)', 'custom-post-type-ui' )
392
  ) );
393
 
394
  echo $ui->get_text_input( array(
@@ -397,7 +397,7 @@ function cptui_manage_post_types() {
397
  'namearray' => 'cpt_labels',
398
  'name' => 'view_item',
399
  'textvalue' => ( isset( $current['labels']['view_item'] ) ) ? esc_attr( $current['labels']['view_item'] ) : '',
400
- 'aftertext' => __( '(e.g. View Movie)', 'custom-post-type-ui' )
401
  ) );
402
 
403
  echo $ui->get_text_input( array(
@@ -406,7 +406,7 @@ function cptui_manage_post_types() {
406
  'namearray' => 'cpt_labels',
407
  'name' => 'search_items',
408
  'textvalue' => ( isset( $current['labels']['search_items'] ) ) ? esc_attr( $current['labels']['search_items'] ) : '',
409
- 'aftertext' => __( '(e.g. Search Movie)', 'custom-post-type-ui' )
410
  ) );
411
 
412
  echo $ui->get_text_input( array(
@@ -415,7 +415,7 @@ function cptui_manage_post_types() {
415
  'namearray' => 'cpt_labels',
416
  'name' => 'not_found',
417
  'textvalue' => ( isset( $current['labels']['not_found'] ) ) ? esc_attr( $current['labels']['not_found'] ) : '',
418
- 'aftertext' => __( '(e.g. No Movies found)', 'custom-post-type-ui' )
419
  ) );
420
 
421
  echo $ui->get_text_input( array(
@@ -424,7 +424,7 @@ function cptui_manage_post_types() {
424
  'namearray' => 'cpt_labels',
425
  'name' => 'not_found_in_trash',
426
  'textvalue' => ( isset( $current['labels']['not_found_in_trash'] ) ) ? esc_attr( $current['labels']['not_found_in_trash'] ) : '',
427
- 'aftertext' => __( '(e.g. No Movies found in Trash)', 'custom-post-type-ui' )
428
  ) );
429
 
430
  echo $ui->get_text_input( array(
@@ -433,7 +433,7 @@ function cptui_manage_post_types() {
433
  'namearray' => 'cpt_labels',
434
  'name' => 'parent',
435
  'textvalue' => ( isset( $current['labels']['parent'] ) ) ? esc_attr( $current['labels']['parent'] ) : '',
436
- 'aftertext' => __( '(e.g. Parent Movie)', 'custom-post-type-ui' )
437
  ) );
438
 
439
  echo $ui->get_text_input( array(
@@ -442,7 +442,7 @@ function cptui_manage_post_types() {
442
  'namearray' => 'cpt_labels',
443
  'name' => 'featured_image',
444
  'textvalue' => ( isset( $current['labels']['featured_image'] ) ) ? esc_attr( $current['labels']['featured_image'] ) : '',
445
- 'aftertext' => __( '(e.g. Featured image for this movie)', 'custom-post-type-ui' )
446
  ) );
447
 
448
  echo $ui->get_text_input( array(
@@ -451,7 +451,7 @@ function cptui_manage_post_types() {
451
  'namearray' => 'cpt_labels',
452
  'name' => 'set_featured_image',
453
  'textvalue' => ( isset( $current['labels']['set_featured_image'] ) ) ? esc_attr( $current['labels']['set_featured_image'] ) : '',
454
- 'aftertext' => __( '(e.g. Set featured image for this movie)', 'custom-post-type-ui' )
455
  ) );
456
 
457
  echo $ui->get_text_input( array(
@@ -460,7 +460,7 @@ function cptui_manage_post_types() {
460
  'namearray' => 'cpt_labels',
461
  'name' => 'remove_featured_image',
462
  'textvalue' => ( isset( $current['labels']['remove_featured_image'] ) ) ? esc_attr( $current['labels']['remove_featured_image'] ) : '',
463
- 'aftertext' => __( '(e.g. Remove featured image for this movie)', 'custom-post-type-ui' )
464
  ) );
465
 
466
  echo $ui->get_text_input( array(
@@ -469,7 +469,7 @@ function cptui_manage_post_types() {
469
  'namearray' => 'cpt_labels',
470
  'name' => 'use_featured_image',
471
  'textvalue' => ( isset( $current['labels']['use_featured_image'] ) ) ? esc_attr( $current['labels']['use_featured_image'] ) : '',
472
- 'aftertext' => __( '(e.g. Use as featured image for this movie)', 'custom-post-type-ui' )
473
  ) );
474
 
475
  echo $ui->get_text_input( array(
@@ -478,7 +478,7 @@ function cptui_manage_post_types() {
478
  'namearray' => 'cpt_labels',
479
  'name' => 'archives',
480
  'textvalue' => ( isset( $current['labels']['archives'] ) ) ? esc_attr( $current['labels']['archives'] ) : '',
481
- 'aftertext' => __( '(e.g. Movie archives)', 'custom-post-type-ui' )
482
  ) );
483
 
484
  echo $ui->get_text_input( array(
@@ -487,7 +487,7 @@ function cptui_manage_post_types() {
487
  'namearray' => 'cpt_labels',
488
  'name' => 'insert_into_item',
489
  'textvalue' => ( isset( $current['labels']['insert_into_item'] ) ) ? esc_attr( $current['labels']['insert_into_item'] ) : '',
490
- 'aftertext' => __( '(e.g. Insert into movie)', 'custom-post-type-ui' )
491
  ) );
492
 
493
  echo $ui->get_text_input( array(
@@ -496,7 +496,7 @@ function cptui_manage_post_types() {
496
  'namearray' => 'cpt_labels',
497
  'name' => 'uploaded_to_this_item',
498
  'textvalue' => ( isset( $current['labels']['uploaded_to_this_item'] ) ) ? esc_attr( $current['labels']['uploaded_to_this_item'] ) : '',
499
- 'aftertext' => __( '(e.g. Uploaded to this movie)', 'custom-post-type-ui' )
500
  ) );
501
 
502
  echo $ui->get_text_input( array(
@@ -505,7 +505,7 @@ function cptui_manage_post_types() {
505
  'namearray' => 'cpt_labels',
506
  'name' => 'filter_items_list',
507
  'textvalue' => ( isset( $current['labels']['filter_items_list'] ) ) ? esc_attr( $current['labels']['filter_items_list'] ) : '',
508
- 'aftertext' => __( '(e.g. Filter movies list)', 'custom-post-type-ui' )
509
  ) );
510
 
511
  echo $ui->get_text_input( array(
@@ -514,7 +514,7 @@ function cptui_manage_post_types() {
514
  'namearray' => 'cpt_labels',
515
  'name' => 'items_list_navigation',
516
  'textvalue' => ( isset( $current['labels']['items_list_navigation'] ) ) ? esc_attr( $current['labels']['items_list_navigation'] ) : '',
517
- 'aftertext' => __( '(e.g. Movies list navigation)', 'custom-post-type-ui' )
518
  ) );
519
 
520
  echo $ui->get_text_input( array(
@@ -523,7 +523,7 @@ function cptui_manage_post_types() {
523
  'namearray' => 'cpt_labels',
524
  'name' => 'items_list',
525
  'textvalue' => ( isset( $current['labels']['items_list'] ) ) ? esc_attr( $current['labels']['items_list'] ) : '',
526
- 'aftertext' => __( '(e.g. Movies list)', 'custom-post-type-ui' )
527
  ) );
528
  ?>
529
  </table>
@@ -535,7 +535,7 @@ function cptui_manage_post_types() {
535
  </p>
536
  <?php
537
  $fieldset_classes = '';
538
- echo $ui->get_fieldset_start( array( 'id' => 'settings_expand', 'classes' => array( $fieldset_classes ) ) );
539
  echo $ui->get_legend_start();
540
  esc_html_e( 'Settings', 'custom-post-type-ui' );
541
  echo $ui->get_legend_end();
@@ -545,7 +545,7 @@ function cptui_manage_post_types() {
545
  $select = array(
546
  'options' => array(
547
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ) ),
548
- array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ), 'default' => 'true' )
549
  )
550
  );
551
  $selected = ( isset( $current ) ) ? disp_boolean( $current['public'] ) : '';
@@ -556,7 +556,7 @@ function cptui_manage_post_types() {
556
  'labeltext' => __( 'Public', 'custom-post-type-ui' ),
557
  'aftertext' => __( '(CPTUI default: true)', 'custom-post-type-ui' ),
558
  'helptext' => esc_attr__( 'WordPress core defaults to false. CPTUI defaults to true for user sake. Whether posts of this type should be shown in the admin UI and is publicly queryable.', 'custom-post-type-ui' ),
559
- 'selections' => $select
560
  ) );
561
 
562
  $select = array(
@@ -579,7 +579,7 @@ function cptui_manage_post_types() {
579
  $select = array(
580
  'options' => array(
581
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ) ),
582
- array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ), 'default' => 'true' )
583
  )
584
  );
585
  $selected = ( isset( $current ) && ! empty( $current['show_in_nav_menus'] ) ) ? disp_boolean( $current['show_in_nav_menus'] ) : '';
@@ -590,13 +590,13 @@ function cptui_manage_post_types() {
590
  'labeltext' => __( 'Show in Nav Menus', 'custom-post-type-ui' ),
591
  'aftertext' => __( '(CPTUI default: true)', 'custom-post-type-ui' ),
592
  'helptext' => esc_attr__( 'Whether post type is available for selection in navigation menus.', 'custom-post-type-ui' ),
593
- 'selections' => $select
594
  ) );
595
 
596
  $select = array(
597
  'options' => array(
598
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ), 'default' => 'false' ),
599
- array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ) )
600
  )
601
  );
602
  $selected = ( isset( $current ) && ! empty( $current['show_in_rest'] ) ) ? disp_boolean( $current['show_in_rest'] ) : '';
@@ -627,7 +627,7 @@ function cptui_manage_post_types() {
627
  $select = array(
628
  'options' => array(
629
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ), 'default' => 'true' ),
630
- array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ) )
631
  )
632
  );
633
  $selected = ( isset( $current ) ) ? disp_boolean( $current['has_archive'] ) : '';
@@ -637,7 +637,7 @@ function cptui_manage_post_types() {
637
  'name' => 'has_archive',
638
  'aftertext' => __( '(default: false)', 'custom-post-type-ui' ),
639
  'selections' => $select,
640
- 'wrap' => false
641
  ) );
642
 
643
  echo '<br/>';
@@ -648,14 +648,14 @@ function cptui_manage_post_types() {
648
  'textvalue' => ( isset( $current['has_archive_string'] ) ) ? esc_attr( $current['has_archive_string'] ) : '',
649
  'helptext' => esc_attr__( 'Slug to be used for archive URL.', 'custom-post-type-ui' ),
650
  'helptext_after'=> true,
651
- 'wrap' => false
652
  ) );
653
  echo $ui->get_td_end() . $ui->get_tr_end();
654
 
655
  $select = array(
656
  'options' => array(
657
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ), 'default' => 'true' ),
658
- array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ) )
659
  )
660
  );
661
  $selected = ( isset( $current ) ) ? disp_boolean( $current['exclude_from_search'] ) : '';
@@ -666,7 +666,7 @@ function cptui_manage_post_types() {
666
  'labeltext' => __( 'Exclude From Search', 'custom-post-type-ui' ),
667
  'aftertext' => __( '(default: false)', 'custom-post-type-ui' ),
668
  'helptext' => esc_attr__( 'Whether to exclude posts with this post type from front end search results.', 'custom-post-type-ui' ),
669
- 'selections' => $select
670
  ) );
671
 
672
  echo $ui->get_text_input( array(
@@ -680,7 +680,7 @@ function cptui_manage_post_types() {
680
  $select = array(
681
  'options' => array(
682
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ), 'default' => 'true' ),
683
- array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ) )
684
  )
685
  );
686
  $selected = ( isset( $current ) ) ? disp_boolean( $current['hierarchical'] ) : '';
@@ -691,13 +691,13 @@ function cptui_manage_post_types() {
691
  'labeltext' => __( 'Hierarchical', 'custom-post-type-ui' ),
692
  'aftertext' => __( '(default: false)', 'custom-post-type-ui' ),
693
  'helptext' => esc_attr__( 'Whether the post type can have parent-child relationships', 'custom-post-type-ui' ),
694
- 'selections' => $select
695
  ) );
696
 
697
  $select = array(
698
  'options' => array(
699
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ) ),
700
- array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ), 'default' => 'true' )
701
  )
702
  );
703
  $selected = ( isset( $current ) ) ? disp_boolean( $current['rewrite'] ) : '';
@@ -708,7 +708,7 @@ function cptui_manage_post_types() {
708
  'labeltext' => __( 'Rewrite', 'custom-post-type-ui' ),
709
  'aftertext' => __( '(default: true)', 'custom-post-type-ui' ),
710
  'helptext' => esc_attr__( 'Whether or not WordPress should use rewrites for this post type', 'custom-post-type-ui' ),
711
- 'selections' => $select
712
  ) );
713
 
714
  echo $ui->get_text_input( array(
@@ -723,7 +723,7 @@ function cptui_manage_post_types() {
723
  $select = array(
724
  'options' => array(
725
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ) ),
726
- array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ), 'default' => 'true' )
727
  )
728
  );
729
  $selected = ( isset( $current ) ) ? disp_boolean( $current['rewrite_withfront'] ) : '';
@@ -734,13 +734,13 @@ function cptui_manage_post_types() {
734
  'labeltext' => __( 'With Front', 'custom-post-type-ui' ),
735
  'aftertext' => __( '(default: true)', 'custom-post-type-ui' ),
736
  'helptext' => esc_attr__( 'Should the permastruct be prepended with the front base.', 'custom-post-type-ui' ),
737
- 'selections' => $select
738
  ) );
739
 
740
  $select = array(
741
  'options' => array(
742
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ) ),
743
- array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ), 'default' => 'true' )
744
  )
745
  );
746
  $selected = ( isset( $current ) ) ? disp_boolean( $current['query_var'] ) : '';
@@ -751,7 +751,7 @@ function cptui_manage_post_types() {
751
  'labeltext' => __( 'Query Var', 'custom-post-type-ui' ),
752
  'aftertext' => __( '(default: true)', 'custom-post-type-ui' ),
753
  'helptext' => esc_attr__( 'Sets the query_var key for this post type.', 'custom-post-type-ui' ),
754
- 'selections' => $select
755
  ) );
756
 
757
  echo $ui->get_text_input( array(
@@ -773,7 +773,7 @@ function cptui_manage_post_types() {
773
  'namearray' => 'cpt_custom_post_type',
774
  'name' => 'menu_position',
775
  'textvalue' => ( isset( $current['menu_position'] ) ) ? esc_attr( $current['menu_position'] ) : '',
776
- 'wrap' => false
777
  ) );
778
  echo $ui->get_td_end() . $ui->get_tr_end();
779
 
@@ -786,7 +786,7 @@ function cptui_manage_post_types() {
786
  $select = array(
787
  'options' => array(
788
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ) ),
789
- array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ), 'default' => 'true' )
790
  )
791
  );
792
  $selected = ( isset( $current ) ) ? disp_boolean( $current['show_in_menu'] ) : '';
@@ -796,7 +796,7 @@ function cptui_manage_post_types() {
796
  'name' => 'show_in_menu',
797
  'aftertext' => __( '(default: true)', 'custom-post-type-ui' ),
798
  'selections' => $select,
799
- 'wrap' => false
800
  ) );
801
 
802
  echo '<br/>';
@@ -807,7 +807,7 @@ function cptui_manage_post_types() {
807
  'textvalue' => ( isset( $current['show_in_menu_string'] ) ) ? esc_attr( $current['show_in_menu_string'] ) : '',
808
  'helptext' => esc_attr__( 'Top-level page file name to make post type a sub-menu of.', 'custom-post-type-ui' ),
809
  'helptext_after'=> true,
810
- 'wrap' => false
811
  ) );
812
  echo $ui->get_td_end() . $ui->get_tr_end();
813
 
@@ -846,7 +846,7 @@ function cptui_manage_post_types() {
846
  'labeltext' => __( 'Title' , 'custom-post-type-ui' ),
847
  'helptext' => esc_attr__( 'Adds the title meta box when creating content for this custom post type', 'custom-post-type-ui' ),
848
  'default' => true,
849
- 'wrap' => false
850
  ) );
851
 
852
  $editor_checked = ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'editor', $current['supports'] ) ) ? 'true' : 'false';
@@ -862,7 +862,7 @@ function cptui_manage_post_types() {
862
  'labeltext' => __( 'Editor' , 'custom-post-type-ui' ),
863
  'helptext' => esc_attr__( 'Adds the content editor meta box when creating content for this custom post type', 'custom-post-type-ui' ),
864
  'default' => true,
865
- 'wrap' => false
866
  ) );
867
 
868
  $thumb_checked = ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'thumbnail', $current['supports'] ) ) ? 'true' : 'false';
@@ -878,7 +878,7 @@ function cptui_manage_post_types() {
878
  'labeltext' => __( 'Featured Image', 'custom-post-type-ui' ),
879
  'helptext' => esc_attr__( 'Adds the featured image meta box when creating content for this custom post type', 'custom-post-type-ui' ),
880
  'default' => true,
881
- 'wrap' => false
882
  ) );
883
 
884
  echo $ui->get_check_input( array(
@@ -890,7 +890,7 @@ function cptui_manage_post_types() {
890
  'labeltext' => __( 'Excerpt' , 'custom-post-type-ui' ),
891
  'helptext' => esc_attr__( 'Adds the excerpt meta box when creating content for this custom post type', 'custom-post-type-ui' ),
892
  'default' => true,
893
- 'wrap' => false
894
  ) );
895
 
896
  echo $ui->get_check_input( array(
@@ -902,7 +902,7 @@ function cptui_manage_post_types() {
902
  'labeltext' => __( 'Trackbacks' , 'custom-post-type-ui' ),
903
  'helptext' => esc_attr__( 'Adds the trackbacks meta box when creating content for this custom post type', 'custom-post-type-ui' ),
904
  'default' => true,
905
- 'wrap' => false
906
  ) );
907
 
908
  echo $ui->get_check_input( array(
@@ -914,7 +914,7 @@ function cptui_manage_post_types() {
914
  'labeltext' => __( 'Custom Fields' , 'custom-post-type-ui' ),
915
  'helptext' => esc_attr__( 'Adds the custom fields meta box when creating content for this custom post type', 'custom-post-type-ui' ),
916
  'default' => true,
917
- 'wrap' => false
918
  ) );
919
 
920
  echo $ui->get_check_input( array(
@@ -926,7 +926,7 @@ function cptui_manage_post_types() {
926
  'labeltext' => __( 'Comments' , 'custom-post-type-ui' ),
927
  'helptext' => esc_attr__( 'Adds the comments meta box when creating content for this custom post type', 'custom-post-type-ui' ),
928
  'default' => true,
929
- 'wrap' => false
930
  ) );
931
 
932
  echo $ui->get_check_input( array(
@@ -938,7 +938,7 @@ function cptui_manage_post_types() {
938
  'labeltext' => __( 'Revisions' , 'custom-post-type-ui' ),
939
  'helptext' => esc_attr__( 'Adds the revisions meta box when creating content for this custom post type', 'custom-post-type-ui' ),
940
  'default' => true,
941
- 'wrap' => false
942
  ) );
943
 
944
  echo $ui->get_check_input( array(
@@ -950,7 +950,7 @@ function cptui_manage_post_types() {
950
  'labeltext' => __( 'Author' , 'custom-post-type-ui' ),
951
  'helptext' => esc_attr__( 'Adds the author meta box when creating content for this custom post type', 'custom-post-type-ui' ),
952
  'default' => true,
953
- 'wrap' => false
954
  ) );
955
 
956
  echo $ui->get_check_input( array(
@@ -962,7 +962,7 @@ function cptui_manage_post_types() {
962
  'labeltext' => __( 'Page Attributes' , 'custom-post-type-ui' ),
963
  'helptext' => esc_attr__( 'Adds the page attribute meta box when creating content for this custom post type', 'custom-post-type-ui' ),
964
  'default' => true,
965
- 'wrap' => false
966
  ) );
967
 
968
  echo $ui->get_check_input( array(
@@ -974,7 +974,7 @@ function cptui_manage_post_types() {
974
  'labeltext' => __( 'Post Formats' , 'custom-post-type-ui' ),
975
  'helptext' => esc_attr__( 'Adds post format support', 'custom-post-type-ui' ),
976
  'default' => true,
977
- 'wrap' => false
978
  ) );
979
 
980
  echo $ui->get_p( __( 'Use the option below to explicitly set "supports" to false.', 'custom-post-type-ui' ) );
@@ -988,7 +988,7 @@ function cptui_manage_post_types() {
988
  'labeltext' => __( 'None' , 'custom-post-type-ui' ),
989
  'helptext' => esc_attr__( 'Remove all support features', 'custom-post-type-ui' ),
990
  'default' => false,
991
- 'wrap' => false
992
  ) );
993
 
994
  echo $ui->get_fieldset_end() . $ui->get_td_end() . $ui->get_tr_end();
@@ -1002,7 +1002,7 @@ function cptui_manage_post_types() {
1002
  'textvalue' => ( isset( $current['custom_supports'] ) ) ? esc_attr( $current['custom_supports'] ) : '',
1003
  'helptext' => esc_attr__( 'Provide custom support slugs here.', 'custom-post-type-ui' ),
1004
  'helptext_after'=> true,
1005
- 'wrap' => false
1006
  ) );
1007
  echo $ui->get_td_end() . $ui->get_tr_end();
1008
 
@@ -1335,9 +1335,9 @@ function cptui_update_post_type( $data = array() ) {
1335
  unset( $data['cpt_labels'][ $key ] );
1336
  }
1337
 
1338
- $label = str_replace( '"', '', htmlspecialchars_decode( $label ) );
1339
- $label = htmlspecialchars( $label, ENT_QUOTES );
1340
- $label = trim( $label );
1341
  $data['cpt_labels'][ $key ] = stripslashes_deep( $label );
1342
  }
1343
 
@@ -1357,46 +1357,46 @@ function cptui_update_post_type( $data = array() ) {
1357
  $singular_label = htmlspecialchars( stripslashes( $singular_label ), ENT_QUOTES );
1358
  }
1359
 
1360
- $name = trim( $data['cpt_custom_post_type']['name'] );
1361
- $description = stripslashes_deep( $data['cpt_custom_post_type']['description'] );
1362
- $rest_base = trim( $data['cpt_custom_post_type']['rest_base'] );
1363
- $has_archive_string = trim( $data['cpt_custom_post_type']['has_archive_string'] );
1364
- $capability_type = trim( $data['cpt_custom_post_type']['capability_type'] );
1365
- $rewrite_slug = trim( $data['cpt_custom_post_type']['rewrite_slug'] );
1366
- $query_var_slug = trim( $data['cpt_custom_post_type']['query_var_slug'] );
1367
- $menu_position = trim( $data['cpt_custom_post_type']['menu_position'] );
1368
  $show_in_menu_string = trim( $data['cpt_custom_post_type']['show_in_menu_string'] );
1369
- $menu_icon = trim( $data['cpt_custom_post_type']['menu_icon'] );
1370
- $custom_supports = trim( $data['cpt_custom_post_type']['custom_supports'] );
1371
 
1372
  $post_types[ $data['cpt_custom_post_type']['name'] ] = array(
1373
- 'name' => $name,
1374
- 'label' => $label,
1375
- 'singular_label' => $singular_label,
1376
- 'description' => $description,
1377
- 'public' => disp_boolean( $data['cpt_custom_post_type']['public'] ),
1378
- 'show_ui' => disp_boolean( $data['cpt_custom_post_type']['show_ui'] ),
1379
- 'show_in_nav_menus' => disp_boolean( $data['cpt_custom_post_type']['show_in_nav_menus'] ),
1380
- 'show_in_rest' => disp_boolean( $data['cpt_custom_post_type']['show_in_rest'] ),
1381
- 'rest_base' => $rest_base,
1382
- 'has_archive' => disp_boolean( $data['cpt_custom_post_type']['has_archive'] ),
1383
- 'has_archive_string' => $has_archive_string,
1384
- 'exclude_from_search' => disp_boolean( $data['cpt_custom_post_type']['exclude_from_search'] ),
1385
- 'capability_type' => $capability_type,
1386
- 'hierarchical' => disp_boolean( $data['cpt_custom_post_type']['hierarchical'] ),
1387
- 'rewrite' => disp_boolean( $data['cpt_custom_post_type']['rewrite'] ),
1388
- 'rewrite_slug' => $rewrite_slug,
1389
- 'rewrite_withfront' => disp_boolean( $data['cpt_custom_post_type']['rewrite_withfront'] ),
1390
- 'query_var' => disp_boolean( $data['cpt_custom_post_type']['query_var'] ),
1391
- 'query_var_slug' => $query_var_slug,
1392
- 'menu_position' => $menu_position,
1393
- 'show_in_menu' => disp_boolean( $data['cpt_custom_post_type']['show_in_menu'] ),
1394
- 'show_in_menu_string' => $show_in_menu_string,
1395
- 'menu_icon' => $menu_icon,
1396
- 'supports' => $data['cpt_supports'],
1397
- 'taxonomies' => $data['cpt_addon_taxes'],
1398
- 'labels' => $data['cpt_labels'],
1399
- 'custom_supports' => $custom_supports
1400
  );
1401
 
1402
  /**
@@ -1449,7 +1449,7 @@ function cptui_reserved_post_types() {
1449
  'nav_menu_item',
1450
  'action',
1451
  'order',
1452
- 'theme'
1453
  );
1454
 
1455
  /**
@@ -1487,7 +1487,7 @@ function cptui_reserved_post_types() {
1487
  function cptui_convert_post_type_posts( $original_slug = '', $new_slug = '' ) {
1488
  $args = array(
1489
  'posts_per_page' => -1,
1490
- 'post_type' => $original_slug
1491
  );
1492
  $convert = new WP_Query( $args );
1493
 
66
  'text' => __( 'Add New Post Type', 'custom-post-type-ui' ),
67
  'classes' => $classes,
68
  'url' => cptui_admin_url( 'admin.php?page=cptui_manage_' . $current_page ),
69
+ 'aria-selected' => 'false',
70
  );
71
 
72
  $action = cptui_get_current_action();
248
  'labeltext' => esc_html__( 'Plural Label', 'custom-post-type-ui' ),
249
  'aftertext' => esc_html__( '(e.g. Movies)', 'custom-post-type-ui' ),
250
  'helptext' => esc_html__( 'Used for the post type admin menu item.', 'custom-post-type-ui' ),
251
+ 'required' => true,
252
  ) );
253
 
254
  echo $ui->get_text_input( array(
258
  'labeltext' => esc_html__( 'Singular Label', 'custom-post-type-ui' ),
259
  'aftertext' => esc_html__( '(e.g. Movie)', 'custom-post-type-ui' ),
260
  'helptext' => esc_html__( 'Used when a singular label is needed.', 'custom-post-type-ui' ),
261
+ 'required' => true,
262
  ) );
263
  ?>
264
  </table>
316
  </p>
317
  <?php
318
  $fieldset_classes = ( 'edit' == $tab ) ? '' : 'toggledclosed';
319
+ echo $ui->get_fieldset_start( array( 'id' => 'labels_expand', 'classes' => array( $fieldset_classes ), ) );
320
  echo $ui->get_legend_start();
321
  esc_html_e( 'Additional labels', 'custom-post-type-ui' );
322
  echo $ui->get_legend_end();
334
  'cols' => '40',
335
  'textvalue' => ( isset( $current['description'] ) ) ? esc_textarea( $current['description'] ) : '',
336
  'labeltext' => __( 'Post Type Description', 'custom-post-type-ui' ),
337
+ 'helptext' => esc_attr__( 'Perhaps describe what your custom post type is used for?', 'custom-post-type-ui' ),
338
  ) );
339
 
340
  echo $ui->get_text_input( array(
343
  'namearray' => 'cpt_labels',
344
  'name' => 'menu_name',
345
  'textvalue' => ( isset( $current['labels']['menu_name'] ) ) ? esc_attr( $current['labels']['menu_name'] ) : '',
346
+ 'aftertext' => __( '(e.g. My Movies)', 'custom-post-type-ui' ),
347
  ) );
348
 
349
  echo $ui->get_text_input( array(
352
  'namearray' => 'cpt_labels',
353
  'name' => 'all_items',
354
  'textvalue' => ( isset( $current['labels']['all_items'] ) ) ? esc_attr( $current['labels']['all_items'] ) : '',
355
+ 'aftertext' => __( '(e.g. All Movies)', 'custom-post-type-ui' ),
356
  ) );
357
 
358
  echo $ui->get_text_input( array(
361
  'namearray' => 'cpt_labels',
362
  'name' => 'add_new',
363
  'textvalue' => ( isset( $current['labels']['add_new'] ) ) ? esc_attr( $current['labels']['add_new'] ) : '',
364
+ 'aftertext' => __( '(e.g. Add New)', 'custom-post-type-ui' ),
365
  ) );
366
 
367
  echo $ui->get_text_input( array(
370
  'namearray' => 'cpt_labels',
371
  'name' => 'add_new_item',
372
  'textvalue' => ( isset( $current['labels']['add_new_item'] ) ) ? esc_attr( $current['labels']['add_new_item'] ) : '',
373
+ 'aftertext' => __( '(e.g. Add New Movie)', 'custom-post-type-ui' ),
374
  ) );
375
 
376
  echo $ui->get_text_input( array(
379
  'namearray' => 'cpt_labels',
380
  'name' => 'edit_item',
381
  'textvalue' => ( isset( $current['labels']['edit_item'] ) ) ? esc_attr( $current['labels']['edit_item'] ) : '',
382
+ 'aftertext' => __( '(e.g. Edit Movie)', 'custom-post-type-ui' ),
383
  ) );
384
 
385
  echo $ui->get_text_input( array(
388
  'namearray' => 'cpt_labels',
389
  'name' => 'new_item',
390
  'textvalue' => ( isset( $current['labels']['new_item'] ) ) ? esc_attr( $current['labels']['new_item'] ) : '',
391
+ 'aftertext' => __( '(e.g. New Movie)', 'custom-post-type-ui' ),
392
  ) );
393
 
394
  echo $ui->get_text_input( array(
397
  'namearray' => 'cpt_labels',
398
  'name' => 'view_item',
399
  'textvalue' => ( isset( $current['labels']['view_item'] ) ) ? esc_attr( $current['labels']['view_item'] ) : '',
400
+ 'aftertext' => __( '(e.g. View Movie)', 'custom-post-type-ui' ),
401
  ) );
402
 
403
  echo $ui->get_text_input( array(
406
  'namearray' => 'cpt_labels',
407
  'name' => 'search_items',
408
  'textvalue' => ( isset( $current['labels']['search_items'] ) ) ? esc_attr( $current['labels']['search_items'] ) : '',
409
+ 'aftertext' => __( '(e.g. Search Movie)', 'custom-post-type-ui' ),
410
  ) );
411
 
412
  echo $ui->get_text_input( array(
415
  'namearray' => 'cpt_labels',
416
  'name' => 'not_found',
417
  'textvalue' => ( isset( $current['labels']['not_found'] ) ) ? esc_attr( $current['labels']['not_found'] ) : '',
418
+ 'aftertext' => __( '(e.g. No Movies found)', 'custom-post-type-ui' ),
419
  ) );
420
 
421
  echo $ui->get_text_input( array(
424
  'namearray' => 'cpt_labels',
425
  'name' => 'not_found_in_trash',
426
  'textvalue' => ( isset( $current['labels']['not_found_in_trash'] ) ) ? esc_attr( $current['labels']['not_found_in_trash'] ) : '',
427
+ 'aftertext' => __( '(e.g. No Movies found in Trash)', 'custom-post-type-ui' ),
428
  ) );
429
 
430
  echo $ui->get_text_input( array(
433
  'namearray' => 'cpt_labels',
434
  'name' => 'parent',
435
  'textvalue' => ( isset( $current['labels']['parent'] ) ) ? esc_attr( $current['labels']['parent'] ) : '',
436
+ 'aftertext' => __( '(e.g. Parent Movie)', 'custom-post-type-ui' ),
437
  ) );
438
 
439
  echo $ui->get_text_input( array(
442
  'namearray' => 'cpt_labels',
443
  'name' => 'featured_image',
444
  'textvalue' => ( isset( $current['labels']['featured_image'] ) ) ? esc_attr( $current['labels']['featured_image'] ) : '',
445
+ 'aftertext' => __( '(e.g. Featured image for this movie)', 'custom-post-type-ui' ),
446
  ) );
447
 
448
  echo $ui->get_text_input( array(
451
  'namearray' => 'cpt_labels',
452
  'name' => 'set_featured_image',
453
  'textvalue' => ( isset( $current['labels']['set_featured_image'] ) ) ? esc_attr( $current['labels']['set_featured_image'] ) : '',
454
+ 'aftertext' => __( '(e.g. Set featured image for this movie)', 'custom-post-type-ui' ),
455
  ) );
456
 
457
  echo $ui->get_text_input( array(
460
  'namearray' => 'cpt_labels',
461
  'name' => 'remove_featured_image',
462
  'textvalue' => ( isset( $current['labels']['remove_featured_image'] ) ) ? esc_attr( $current['labels']['remove_featured_image'] ) : '',
463
+ 'aftertext' => __( '(e.g. Remove featured image for this movie)', 'custom-post-type-ui' ),
464
  ) );
465
 
466
  echo $ui->get_text_input( array(
469
  'namearray' => 'cpt_labels',
470
  'name' => 'use_featured_image',
471
  'textvalue' => ( isset( $current['labels']['use_featured_image'] ) ) ? esc_attr( $current['labels']['use_featured_image'] ) : '',
472
+ 'aftertext' => __( '(e.g. Use as featured image for this movie)', 'custom-post-type-ui' ),
473
  ) );
474
 
475
  echo $ui->get_text_input( array(
478
  'namearray' => 'cpt_labels',
479
  'name' => 'archives',
480
  'textvalue' => ( isset( $current['labels']['archives'] ) ) ? esc_attr( $current['labels']['archives'] ) : '',
481
+ 'aftertext' => __( '(e.g. Movie archives)', 'custom-post-type-ui' ),
482
  ) );
483
 
484
  echo $ui->get_text_input( array(
487
  'namearray' => 'cpt_labels',
488
  'name' => 'insert_into_item',
489
  'textvalue' => ( isset( $current['labels']['insert_into_item'] ) ) ? esc_attr( $current['labels']['insert_into_item'] ) : '',
490
+ 'aftertext' => __( '(e.g. Insert into movie)', 'custom-post-type-ui' ),
491
  ) );
492
 
493
  echo $ui->get_text_input( array(
496
  'namearray' => 'cpt_labels',
497
  'name' => 'uploaded_to_this_item',
498
  'textvalue' => ( isset( $current['labels']['uploaded_to_this_item'] ) ) ? esc_attr( $current['labels']['uploaded_to_this_item'] ) : '',
499
+ 'aftertext' => __( '(e.g. Uploaded to this movie)', 'custom-post-type-ui' ),
500
  ) );
501
 
502
  echo $ui->get_text_input( array(
505
  'namearray' => 'cpt_labels',
506
  'name' => 'filter_items_list',
507
  'textvalue' => ( isset( $current['labels']['filter_items_list'] ) ) ? esc_attr( $current['labels']['filter_items_list'] ) : '',
508
+ 'aftertext' => __( '(e.g. Filter movies list)', 'custom-post-type-ui' ),
509
  ) );
510
 
511
  echo $ui->get_text_input( array(
514
  'namearray' => 'cpt_labels',
515
  'name' => 'items_list_navigation',
516
  'textvalue' => ( isset( $current['labels']['items_list_navigation'] ) ) ? esc_attr( $current['labels']['items_list_navigation'] ) : '',
517
+ 'aftertext' => __( '(e.g. Movies list navigation)', 'custom-post-type-ui' ),
518
  ) );
519
 
520
  echo $ui->get_text_input( array(
523
  'namearray' => 'cpt_labels',
524
  'name' => 'items_list',
525
  'textvalue' => ( isset( $current['labels']['items_list'] ) ) ? esc_attr( $current['labels']['items_list'] ) : '',
526
+ 'aftertext' => __( '(e.g. Movies list)', 'custom-post-type-ui' ),
527
  ) );
528
  ?>
529
  </table>
535
  </p>
536
  <?php
537
  $fieldset_classes = '';
538
+ echo $ui->get_fieldset_start( array( 'id' => 'settings_expand', 'classes' => array( $fieldset_classes ), ) );
539
  echo $ui->get_legend_start();
540
  esc_html_e( 'Settings', 'custom-post-type-ui' );
541
  echo $ui->get_legend_end();
545
  $select = array(
546
  'options' => array(
547
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ) ),
548
+ array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ), 'default' => 'true' ),
549
  )
550
  );
551
  $selected = ( isset( $current ) ) ? disp_boolean( $current['public'] ) : '';
556
  'labeltext' => __( 'Public', 'custom-post-type-ui' ),
557
  'aftertext' => __( '(CPTUI default: true)', 'custom-post-type-ui' ),
558
  'helptext' => esc_attr__( 'WordPress core defaults to false. CPTUI defaults to true for user sake. Whether posts of this type should be shown in the admin UI and is publicly queryable.', 'custom-post-type-ui' ),
559
+ 'selections' => $select,
560
  ) );
561
 
562
  $select = array(
579
  $select = array(
580
  'options' => array(
581
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ) ),
582
+ array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ), 'default' => 'true' ),
583
  )
584
  );
585
  $selected = ( isset( $current ) && ! empty( $current['show_in_nav_menus'] ) ) ? disp_boolean( $current['show_in_nav_menus'] ) : '';
590
  'labeltext' => __( 'Show in Nav Menus', 'custom-post-type-ui' ),
591
  'aftertext' => __( '(CPTUI default: true)', 'custom-post-type-ui' ),
592
  'helptext' => esc_attr__( 'Whether post type is available for selection in navigation menus.', 'custom-post-type-ui' ),
593
+ 'selections' => $select,
594
  ) );
595
 
596
  $select = array(
597
  'options' => array(
598
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ), 'default' => 'false' ),
599
+ array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ) ),
600
  )
601
  );
602
  $selected = ( isset( $current ) && ! empty( $current['show_in_rest'] ) ) ? disp_boolean( $current['show_in_rest'] ) : '';
627
  $select = array(
628
  'options' => array(
629
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ), 'default' => 'true' ),
630
+ array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ) ),
631
  )
632
  );
633
  $selected = ( isset( $current ) ) ? disp_boolean( $current['has_archive'] ) : '';
637
  'name' => 'has_archive',
638
  'aftertext' => __( '(default: false)', 'custom-post-type-ui' ),
639
  'selections' => $select,
640
+ 'wrap' => false,
641
  ) );
642
 
643
  echo '<br/>';
648
  'textvalue' => ( isset( $current['has_archive_string'] ) ) ? esc_attr( $current['has_archive_string'] ) : '',
649
  'helptext' => esc_attr__( 'Slug to be used for archive URL.', 'custom-post-type-ui' ),
650
  'helptext_after'=> true,
651
+ 'wrap' => false,
652
  ) );
653
  echo $ui->get_td_end() . $ui->get_tr_end();
654
 
655
  $select = array(
656
  'options' => array(
657
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ), 'default' => 'true' ),
658
+ array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ) ),
659
  )
660
  );
661
  $selected = ( isset( $current ) ) ? disp_boolean( $current['exclude_from_search'] ) : '';
666
  'labeltext' => __( 'Exclude From Search', 'custom-post-type-ui' ),
667
  'aftertext' => __( '(default: false)', 'custom-post-type-ui' ),
668
  'helptext' => esc_attr__( 'Whether to exclude posts with this post type from front end search results.', 'custom-post-type-ui' ),
669
+ 'selections' => $select,
670
  ) );
671
 
672
  echo $ui->get_text_input( array(
680
  $select = array(
681
  'options' => array(
682
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ), 'default' => 'true' ),
683
+ array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ) ),
684
  )
685
  );
686
  $selected = ( isset( $current ) ) ? disp_boolean( $current['hierarchical'] ) : '';
691
  'labeltext' => __( 'Hierarchical', 'custom-post-type-ui' ),
692
  'aftertext' => __( '(default: false)', 'custom-post-type-ui' ),
693
  'helptext' => esc_attr__( 'Whether the post type can have parent-child relationships', 'custom-post-type-ui' ),
694
+ 'selections' => $select,
695
  ) );
696
 
697
  $select = array(
698
  'options' => array(
699
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ) ),
700
+ array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ), 'default' => 'true' ),
701
  )
702
  );
703
  $selected = ( isset( $current ) ) ? disp_boolean( $current['rewrite'] ) : '';
708
  'labeltext' => __( 'Rewrite', 'custom-post-type-ui' ),
709
  'aftertext' => __( '(default: true)', 'custom-post-type-ui' ),
710
  'helptext' => esc_attr__( 'Whether or not WordPress should use rewrites for this post type', 'custom-post-type-ui' ),
711
+ 'selections' => $select,
712
  ) );
713
 
714
  echo $ui->get_text_input( array(
723
  $select = array(
724
  'options' => array(
725
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ) ),
726
+ array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ), 'default' => 'true' ),
727
  )
728
  );
729
  $selected = ( isset( $current ) ) ? disp_boolean( $current['rewrite_withfront'] ) : '';
734
  'labeltext' => __( 'With Front', 'custom-post-type-ui' ),
735
  'aftertext' => __( '(default: true)', 'custom-post-type-ui' ),
736
  'helptext' => esc_attr__( 'Should the permastruct be prepended with the front base.', 'custom-post-type-ui' ),
737
+ 'selections' => $select,
738
  ) );
739
 
740
  $select = array(
741
  'options' => array(
742
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ) ),
743
+ array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ), 'default' => 'true' ),
744
  )
745
  );
746
  $selected = ( isset( $current ) ) ? disp_boolean( $current['query_var'] ) : '';
751
  'labeltext' => __( 'Query Var', 'custom-post-type-ui' ),
752
  'aftertext' => __( '(default: true)', 'custom-post-type-ui' ),
753
  'helptext' => esc_attr__( 'Sets the query_var key for this post type.', 'custom-post-type-ui' ),
754
+ 'selections' => $select,
755
  ) );
756
 
757
  echo $ui->get_text_input( array(
773
  'namearray' => 'cpt_custom_post_type',
774
  'name' => 'menu_position',
775
  'textvalue' => ( isset( $current['menu_position'] ) ) ? esc_attr( $current['menu_position'] ) : '',
776
+ 'wrap' => false,
777
  ) );
778
  echo $ui->get_td_end() . $ui->get_tr_end();
779
 
786
  $select = array(
787
  'options' => array(
788
  array( 'attr' => '0', 'text' => __( 'False', 'custom-post-type-ui' ) ),
789
+ array( 'attr' => '1', 'text' => __( 'True', 'custom-post-type-ui' ), 'default' => 'true' ),
790
  )
791
  );
792
  $selected = ( isset( $current ) ) ? disp_boolean( $current['show_in_menu'] ) : '';
796
  'name' => 'show_in_menu',
797
  'aftertext' => __( '(default: true)', 'custom-post-type-ui' ),
798
  'selections' => $select,
799
+ 'wrap' => false,
800
  ) );
801
 
802
  echo '<br/>';
807
  'textvalue' => ( isset( $current['show_in_menu_string'] ) ) ? esc_attr( $current['show_in_menu_string'] ) : '',
808
  'helptext' => esc_attr__( 'Top-level page file name to make post type a sub-menu of.', 'custom-post-type-ui' ),
809
  'helptext_after'=> true,
810
+ 'wrap' => false,
811
  ) );
812
  echo $ui->get_td_end() . $ui->get_tr_end();
813
 
846
  'labeltext' => __( 'Title' , 'custom-post-type-ui' ),
847
  'helptext' => esc_attr__( 'Adds the title meta box when creating content for this custom post type', 'custom-post-type-ui' ),
848
  'default' => true,
849
+ 'wrap' => false,
850
  ) );
851
 
852
  $editor_checked = ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'editor', $current['supports'] ) ) ? 'true' : 'false';
862
  'labeltext' => __( 'Editor' , 'custom-post-type-ui' ),
863
  'helptext' => esc_attr__( 'Adds the content editor meta box when creating content for this custom post type', 'custom-post-type-ui' ),
864
  'default' => true,
865
+ 'wrap' => false,
866
  ) );
867
 
868
  $thumb_checked = ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'thumbnail', $current['supports'] ) ) ? 'true' : 'false';
878
  'labeltext' => __( 'Featured Image', 'custom-post-type-ui' ),
879
  'helptext' => esc_attr__( 'Adds the featured image meta box when creating content for this custom post type', 'custom-post-type-ui' ),
880
  'default' => true,
881
+ 'wrap' => false,
882
  ) );
883
 
884
  echo $ui->get_check_input( array(
890
  'labeltext' => __( 'Excerpt' , 'custom-post-type-ui' ),
891
  'helptext' => esc_attr__( 'Adds the excerpt meta box when creating content for this custom post type', 'custom-post-type-ui' ),
892
  'default' => true,
893
+ 'wrap' => false,
894
  ) );
895
 
896
  echo $ui->get_check_input( array(
902
  'labeltext' => __( 'Trackbacks' , 'custom-post-type-ui' ),
903
  'helptext' => esc_attr__( 'Adds the trackbacks meta box when creating content for this custom post type', 'custom-post-type-ui' ),
904
  'default' => true,
905
+ 'wrap' => false,
906
  ) );
907
 
908
  echo $ui->get_check_input( array(
914
  'labeltext' => __( 'Custom Fields' , 'custom-post-type-ui' ),
915
  'helptext' => esc_attr__( 'Adds the custom fields meta box when creating content for this custom post type', 'custom-post-type-ui' ),
916
  'default' => true,
917
+ 'wrap' => false,
918
  ) );
919
 
920
  echo $ui->get_check_input( array(
926
  'labeltext' => __( 'Comments' , 'custom-post-type-ui' ),
927
  'helptext' => esc_attr__( 'Adds the comments meta box when creating content for this custom post type', 'custom-post-type-ui' ),
928
  'default' => true,
929
+ 'wrap' => false,
930
  ) );
931
 
932
  echo $ui->get_check_input( array(
938
  'labeltext' => __( 'Revisions' , 'custom-post-type-ui' ),
939
  'helptext' => esc_attr__( 'Adds the revisions meta box when creating content for this custom post type', 'custom-post-type-ui' ),
940
  'default' => true,
941
+ 'wrap' => false,
942
  ) );
943
 
944
  echo $ui->get_check_input( array(
950
  'labeltext' => __( 'Author' , 'custom-post-type-ui' ),
951
  'helptext' => esc_attr__( 'Adds the author meta box when creating content for this custom post type', 'custom-post-type-ui' ),
952
  'default' => true,
953
+ 'wrap' => false,
954
  ) );
955
 
956
  echo $ui->get_check_input( array(
962
  'labeltext' => __( 'Page Attributes' , 'custom-post-type-ui' ),
963
  'helptext' => esc_attr__( 'Adds the page attribute meta box when creating content for this custom post type', 'custom-post-type-ui' ),
964
  'default' => true,
965
+ 'wrap' => false,
966
  ) );
967
 
968
  echo $ui->get_check_input( array(
974
  'labeltext' => __( 'Post Formats' , 'custom-post-type-ui' ),
975
  'helptext' => esc_attr__( 'Adds post format support', 'custom-post-type-ui' ),
976
  'default' => true,
977
+ 'wrap' => false,
978
  ) );
979
 
980
  echo $ui->get_p( __( 'Use the option below to explicitly set "supports" to false.', 'custom-post-type-ui' ) );
988
  'labeltext' => __( 'None' , 'custom-post-type-ui' ),
989
  'helptext' => esc_attr__( 'Remove all support features', 'custom-post-type-ui' ),
990
  'default' => false,
991
+ 'wrap' => false,
992
  ) );
993
 
994
  echo $ui->get_fieldset_end() . $ui->get_td_end() . $ui->get_tr_end();
1002
  'textvalue' => ( isset( $current['custom_supports'] ) ) ? esc_attr( $current['custom_supports'] ) : '',
1003
  'helptext' => esc_attr__( 'Provide custom support slugs here.', 'custom-post-type-ui' ),
1004
  'helptext_after'=> true,
1005
+ 'wrap' => false,
1006
  ) );
1007
  echo $ui->get_td_end() . $ui->get_tr_end();
1008
 
1335
  unset( $data['cpt_labels'][ $key ] );
1336
  }
1337
 
1338
+ $label = str_replace( '"', '', htmlspecialchars_decode( $label ) );
1339
+ $label = htmlspecialchars( $label, ENT_QUOTES );
1340
+ $label = trim( $label );
1341
  $data['cpt_labels'][ $key ] = stripslashes_deep( $label );
1342
  }
1343
 
1357
  $singular_label = htmlspecialchars( stripslashes( $singular_label ), ENT_QUOTES );
1358
  }
1359
 
1360
+ $name = trim( $data['cpt_custom_post_type']['name'] );
1361
+ $description = stripslashes_deep( $data['cpt_custom_post_type']['description'] );
1362
+ $rest_base = trim( $data['cpt_custom_post_type']['rest_base'] );
1363
+ $has_archive_string = trim( $data['cpt_custom_post_type']['has_archive_string'] );
1364
+ $capability_type = trim( $data['cpt_custom_post_type']['capability_type'] );
1365
+ $rewrite_slug = trim( $data['cpt_custom_post_type']['rewrite_slug'] );
1366
+ $query_var_slug = trim( $data['cpt_custom_post_type']['query_var_slug'] );
1367
+ $menu_position = trim( $data['cpt_custom_post_type']['menu_position'] );
1368
  $show_in_menu_string = trim( $data['cpt_custom_post_type']['show_in_menu_string'] );
1369
+ $menu_icon = trim( $data['cpt_custom_post_type']['menu_icon'] );
1370
+ $custom_supports = trim( $data['cpt_custom_post_type']['custom_supports'] );
1371
 
1372
  $post_types[ $data['cpt_custom_post_type']['name'] ] = array(
1373
+ 'name' => $name,
1374
+ 'label' => $label,
1375
+ 'singular_label' => $singular_label,
1376
+ 'description' => $description,
1377
+ 'public' => disp_boolean( $data['cpt_custom_post_type']['public'] ),
1378
+ 'show_ui' => disp_boolean( $data['cpt_custom_post_type']['show_ui'] ),
1379
+ 'show_in_nav_menus' => disp_boolean( $data['cpt_custom_post_type']['show_in_nav_menus'] ),
1380
+ 'show_in_rest' => disp_boolean( $data['cpt_custom_post_type']['show_in_rest'] ),
1381
+ 'rest_base' => $rest_base,
1382
+ 'has_archive' => disp_boolean( $data['cpt_custom_post_type']['has_archive'] ),
1383
+ 'has_archive_string' => $has_archive_string,
1384
+ 'exclude_from_search' => disp_boolean( $data['cpt_custom_post_type']['exclude_from_search'] ),
1385
+ 'capability_type' => $capability_type,
1386
+ 'hierarchical' => disp_boolean( $data['cpt_custom_post_type']['hierarchical'] ),
1387
+ 'rewrite' => disp_boolean( $data['cpt_custom_post_type']['rewrite'] ),
1388
+ 'rewrite_slug' => $rewrite_slug,
1389
+ 'rewrite_withfront' => disp_boolean( $data['cpt_custom_post_type']['rewrite_withfront'] ),
1390
+ 'query_var' => disp_boolean( $data['cpt_custom_post_type']['query_var'] ),
1391
+ 'query_var_slug' => $query_var_slug,
1392
+ 'menu_position' => $menu_position,
1393
+ 'show_in_menu' => disp_boolean( $data['cpt_custom_post_type']['show_in_menu'] ),
1394
+ 'show_in_menu_string' => $show_in_menu_string,
1395
+ 'menu_icon' => $menu_icon,
1396
+ 'supports' => $data['cpt_supports'],
1397
+ 'taxonomies' => $data['cpt_addon_taxes'],
1398
+ 'labels' => $data['cpt_labels'],
1399
+ 'custom_supports' => $custom_supports,
1400
  );
1401
 
1402
  /**
1449
  'nav_menu_item',
1450
  'action',
1451
  'order',
1452
+ 'theme',
1453
  );
1454
 
1455
  /**
1487
  function cptui_convert_post_type_posts( $original_slug = '', $new_slug = '' ) {
1488
  $args = array(
1489
  'posts_per_page' => -1,
1490
+ 'post_type' => $original_slug,
1491
  );
1492
  $convert = new WP_Query( $args );
1493
 
inc/support.php CHANGED
@@ -53,117 +53,179 @@ function cptui_support() {
53
  */
54
  do_action( 'cptui_main_page_before_faq' ); ?>
55
 
56
- <h1><?php _e( 'Custom Post Type UI Support', 'custom-post-type-ui' ); ?></h1>
57
 
58
  <p><?php printf(
59
- __( 'Please note that this plugin will NOT handle display of registered post types or taxonomies in your current theme. It will simply register them for you. If all else fails, visit us on the %s', 'custom-post-type-ui' ),
60
- '<a href="https://www.wordpress.org/support/plugin/custom-post-type-ui/">' . __( 'Support Forums', 'custom-post-type-ui' ) . '</a>'
 
 
 
61
  ); ?></p>
62
 
63
  <table id="support" class="form-table cptui-table">
64
  <tr>
65
  <td class="outter">
66
- <h2><?php _e( 'General', 'custom-post-type-ui' ); ?></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  <ol id="questions_general">
68
  <li>
69
- <span tabindex="0" class="question" aria-controls="q1" aria-expanded="false"><?php _e( 'I have post types with spaces in their slug and can not successfully delete them. How can I fix that?', 'custom-post-type-ui' ); ?></span>
70
- <div class="answer" id="q1"><?php _e( 'Visit the Import/Export page and copy the export code into the import side on the left. Replace the space with an underscore and then click "Import". You should be able to delete the individual post types afterwards.', 'custom-post-type-ui' ); ?>
71
  </div>
72
  </li>
73
  <li>
74
- <span tabindex="0" class="question" aria-controls="q2" aria-expanded="false"><?php _e( 'I changed my custom post type name and now I can not get to my posts. How do I get them back?', 'custom-post-type-ui' ); ?></span>
75
- <div class="answer" id="q2"><?php _e( 'You can either change the custom post type name back to the original name or try the Post Type Switcher plugin', 'custom-post-type-ui' ); ?>
76
  <a href="https://wordpress.org/plugins/post-type-switcher/" target="_blank">https://wordpress.org/extend/plugins/post-type-switcher/</a>
77
  </div>
78
  </li>
79
  <li>
80
- <span tabindex="0" class="question" aria-controls="q3" aria-expanded="false"><?php _e( 'I changed my custom post type or taxonomy slug and now I have duplicates shown. How do I remove the duplicate?', 'custom-post-type-ui' ); ?></span>
81
- <div class="answer" id="q3"><?php _e( 'Renaming the slug for a post type or taxonomy creates a new entry in our saved option which gets registered as its own post type or taxonomy. Since the settings will be mirrored from the previous slug, you will just need to delete the previous version\'s entry.', 'custom-post-type-ui' ); ?> <a href="https://wordpress.org/plugins/post-type-switcher/" target="_blank">https://wordpress.org/extend/plugins/post-type-switcher/</a></div>
82
  </li>
83
  <li>
84
- <span tabindex="0" class="question" aria-controls="q4" aria-expanded="false"><?php _e( 'I have added post thumbnail and/or post format support to my post type, but those do not appear when adding a post type post.', 'custom-post-type-ui' ); ?></span>
85
- <div class="answer" id="q4"><?php _e( 'Make sure your theme has post "post-thumbnails" theme support enabled.', 'custom-post-type-ui' ); ?> <a href="https://codex.wordpress.org/Function_Reference/add_theme_support" target="_blank">https://codex.wordpress.org/Function_Reference/add_theme_support</a></div>
86
  </li>
87
  <li>
88
- <span tabindex="0" class="question" aria-controls="q5" aria-expanded="false"><?php _e( 'Do you have any recommendations for an alternative to Visual Composer?', 'custom-post-type-ui' ); ?></span>
89
- <div class="answer" id="q5"><?php _e( 'We recommend using VelocityPage.', 'custom-post-type-ui' ); ?>
90
  <a href="https://velocitypage.com" target="_blank">https://velocitypage.com</a>
91
  </div>
92
  </li>
93
  <li>
94
- <span tabindex="0" class="question" aria-controls="q6" aria-expanded="false"><?php _e( 'Is there any way to get CPTUI-registered post types working with Visual Composer Media Grid?', 'custom-post-type-ui' ); ?></span>
95
 
96
- <div class="answer" id="q6"><?php _e( 'Please see the solution from the following forum support thread.', 'custom-post-type-ui' ); ?>
97
  <a href="https://wordpress.org/support/topic/custom-post-type-and-visual-composer-grid-block?replies=11#post-7111458" target="_blank">https://wordpress.org/support/topic/custom-post-type-and-visual-composer-grid-block?replies=11#post-7111458</a>
98
  </div>
99
  </li>
100
  </ol>
101
  </td>
 
 
102
  <td class="outter">
103
- <h2><?php _e( 'Front-end Display', 'custom-post-type-ui' ); ?></h2>
104
  <ol id="questions_front">
105
  <li>
106
- <span tabindex="0" class="question" aria-controls="q7" aria-expanded="false"><?php _e( 'What template files should I edit to alter my post type display?', 'custom-post-type-ui' ); ?></span>
107
- <div class="answer" id="q7"><?php printf( __( 'Please visit the %sTemplate Hierarchy%s page on the WordPress codex for details about available templates.', 'custom-post-type-ui' ),
108
- '<a href="https://codex.wordpress.org/Template_Hierarchy" target="_blank">',
109
- '</a>'
110
- ); ?>
 
 
111
  </div>
112
  </li>
113
  <li>
114
- <span tabindex="0" class="question" aria-controls="q8" aria-expanded="false"><?php _e( 'How do I display my custom post type on my site?', 'custom-post-type-ui' ); ?></span>
115
- <div class="answer" id="q8"><?php printf( __( 'You will need to utilize the %sWP_Query%s class to handle display in custom locations. If you have set the post type to have archives, the archive url should be something like "http://www.mysite.com/post-type-slug"', 'custom-post-type-ui' ),
116
- '<a href="https://codex.wordpress.org/Class_Reference/WP_Query" target="_blank">',
117
- '</a>'
118
- ); ?></div>
 
 
 
 
 
 
119
  </li>
120
  <li>
121
- <span tabindex="0" class="question" aria-controls="q9" aria-expanded="false"><?php _e( 'I have added categories and tags to my custom post type, but they do not appear in the archives.', 'custom-post-type-ui' ); ?></span>
122
- <div class="answer" id="q9"><?php printf( __( 'You will need to add your newly created post type to the types that the category and tag archives query for. You can see a tutorial on how to do that at %s', 'custom-post-type-ui' ),
123
  '<a href="https://wpmu.org/add-custom-post-types-to-tags-and-categories-in-wordpress/" target="_blank">https://wpmu.org/add-custom-post-types-to-tags-and-categories-in-wordpress/</a>'
124
  ); ?> </div>
125
  </li>
126
  </ol>
127
  </td>
128
- </tr>
129
- <tr>
130
  <td class="outter">
131
- <h2><?php _e( 'Advanced', 'custom-post-type-ui' ); ?></h2>
132
  <ol id="questions_advanced">
133
  <li>
134
- <span tabindex="0" class="question" aria-controls="q10" aria-expanded="false"><?php _e( 'How do I add custom metaboxes to my post type?', 'custom-post-type-ui' ); ?></span>
135
- <div class="answer" id="q10"><?php printf(
136
- __( 'We recommend checking out %s, the latest iteration of "Custom Metaboxes and Fields for WordPress". Both are maintained by WebDevStudios.', 'custom-post-type-ui' ),
137
- '<a href="https://wordpress.org/plugins/cmb2/" target="_blank">CMB2</a>'
138
- ); ?>
 
139
  </div>
140
  </li>
141
  <li>
142
- <span tabindex="0" class="question" aria-controls="q11" aria-expanded="false"><?php _e( 'How do I add a newly registered taxonomy to a post type that already exists?', 'custom-post-type-ui' ); ?></span>
143
- <div class="answer" id="q11"><?php printf(
144
- __( 'Check out the %s function for documentation and usage examples.', 'custom-post-type-ui' ),
145
- '<a href="https://codex.wordpress.org/Function_Reference/register_taxonomy_for_object_type" target="_blank">register_taxonomy_for_object_type()</a>'
 
146
  ); ?>
147
  </div>
148
  </li>
149
  <li>
150
- <span tabindex="0" class="question" aria-controls="q12" aria-expanded="false"><?php _e( 'Post relationships?', 'custom-post-type-ui' ); ?></span>
151
- <div class="answer" id="q12"><?php printf( __( '%s has an excellent %spost%s introducing users to the %sPosts 2 Posts%s plugin that should be a good start.', 'custom-post-type-ui' ),
152
- 'Pippin Williamson',
153
- '<a href="https://pippinsplugins.com/introduction-posts-2-posts-plugin/" target="_blank">',
154
- '</a>',
155
- '<a href="https://wordpress.org/plugins/posts-to-posts/" target="_blank">',
156
- '</a>'
157
- ); ?></div>
 
 
158
  </li>
159
  <li>
160
- <span tabindex="0" class="question" aria-controls="q13" aria-expanded="false"><?php _e( 'Is there any function reference list?', 'custom-post-type-ui' ); ?></span>
161
- <div class="answer" id="q13"><?php printf( __( '%s has compiled a nice list of functions used by our plugin. Note not all will be useful as they are attached to hooks.', 'custom-post-type-ui' ),
162
  '<a href="http://hookr.io/plugins/custom-post-type-ui/1.0.5/all/#index=c" target="_blank">Hookr.io</a>' ); ?></div>
163
  </li>
164
  <li>
165
- <span tabindex="0" class="question" aria-controls="q14" aria-expanded="false"><?php _e( 'How do I filter the "enter title here" text in the post editor screen?', 'custom-post-type-ui' ); ?></span>
166
- <div class="answer" id="q14"><p><?php _e( 'Change text inside the post/page editor title field. Should be able to adapt as necessary.', 'custom-post-type-ui' ); ?></p>
167
  <pre><code>function my_custom_title_text( $title ){
168
  global $post;
169
  if ( 'ENTER POST TYPE SLUG HERE' == $post->post_type )
53
  */
54
  do_action( 'cptui_main_page_before_faq' ); ?>
55
 
56
+ <h1><?php esc_html_e( 'Custom Post Type UI Support', 'custom-post-type-ui' ); ?></h1>
57
 
58
  <p><?php printf(
59
+ esc_html__( 'Please note that %s this plugin will not handle display %s of registered post types or taxonomies in your current theme. It simply registers them for you. To display your data, check out %s. If all else fails, visit us on the %s', 'custom-post-type-ui' ),
60
+ '<strong>',
61
+ '</strong>',
62
+ '<a href="https://pluginize.com/product/custom-post-type-ui-extended/?utm_source=faq&utm_medium=text&utm_campaign=cptui">' . esc_html__( 'CPTUI Extended' ) . '</a>',
63
+ '<a href="https://www.wordpress.org/support/plugin/custom-post-type-ui/">' . esc_html__( 'Support Forums', 'custom-post-type-ui' ) . '</a>'
64
  ); ?></p>
65
 
66
  <table id="support" class="form-table cptui-table">
67
  <tr>
68
  <td class="outter">
69
+ <h2><?php esc_html_e( 'Pluginize', 'custom-post-type-ui' ); ?></h2>
70
+ <ol id="questions_pluginize">
71
+ <li>
72
+ <span tabindex="0" class="question" aria-controls="q1" aria-expanded="false"><?php esc_html_e( 'What is Pluginize?', 'custom-post-type-ui' ); ?></span>
73
+ <div class="answer" id="q1"><?php esc_html_e( 'Pluginize is a marketplace of plugins by WebDevStudios.', 'custom-post-type-ui' ); ?>
74
+ </div>
75
+ </li>
76
+ <li>
77
+ <span tabindex="0" class="question" aria-controls="q2" aria-expanded="false"><?php esc_html_e( 'What does Pluginize offer?', 'custom-post-type-ui' ); ?></span>
78
+ <div class="answer" id="q2"><?php esc_html_e( 'Pluginize offers both free and paid WordPress plugins.', 'custom-post-type-ui' ); ?>
79
+ </div>
80
+ </li>
81
+ <li>
82
+ <span tabindex="0" class="question" aria-controls="q3" aria-expanded="false"><?php esc_html_e( 'Will these ad spots ever show third-party data?', 'custom-post-type-ui' ); ?></span>
83
+ <div class="answer" id="q3"><?php esc_html_e( 'No. These spots are intended for and will only be used for other available WebDevStudios products and services.', 'custom-post-type-ui' ); ?>
84
+ </div>
85
+ </li>
86
+ <li>
87
+ <span tabindex="0" class="question" aria-controls="q4" aria-expanded="false"><?php esc_html_e( 'How can I remove the ads that suddenly started showing up?', 'custom-post-type-ui' ); ?></span>
88
+ <div class="answer" id="q4"><?php
89
+ printf(
90
+ esc_html__( 'You can have them automatically removed from display via a purchased copy of %s.', 'custom-post-type-ui' ),
91
+ sprintf( '<a href="%s">%s</a>',
92
+ 'https://pluginize.com/product/custom-post-type-ui-extended/?utm_source=faq&utm_medium=text&utm_campaign=cptui',
93
+ 'Custom Post Type UI Extended'
94
+ )
95
+ ); ?>
96
+ </div>
97
+ </li>
98
+ <li>
99
+ <span tabindex="0" class="question" aria-controls="q5" aria-expanded="false"><?php esc_html_e( 'Are these ad spots tracking my personal information in any way?', 'custom-post-type-ui' ); ?></span>
100
+ <div class="answer" id="q5"><?php esc_html_e( 'No, there is no data being sent out from your site with these. The only way anything is tracked is via UTM parameters for WebDevStudios\'s analytics so we can get an idea of where traffic is coming from. Those are only tracked if you actually click on an ad spot.', 'custom-post-type-ui' ); ?>
101
+ </div>
102
+ </li>
103
+ <li>
104
+ <span tabindex="0" class="question" aria-controls="q6" aria-expanded="false"><?php esc_html_e( 'Do I still need Custom Post Type UI if I purchase and install Custom Post Type UI Extended?', 'custom-post-type-ui' ); ?></span>
105
+ <div class="answer" id="q6"><?php esc_html_e( 'Yes you will. The Custom Post Type UI Extended is not a replacement of the free version with added extra features. It acts based on the data made available trhough Custom Post Type UI', 'custom-post-type-ui' ); ?>
106
+ </div>
107
+ </li>
108
+ <li>
109
+ <span tabindex="0" class="question" aria-controls="q7" aria-expanded="false"><?php esc_html_e( 'Does Custom Post Type UI Extended require multisite?', 'custom-post-type-ui' ); ?></span>
110
+ <div class="answer" id="q7"><?php esc_html_e( 'No it does not. The Shortcode builder is not multisite dependent and will work with either setup.', 'custom-post-type-ui' ); ?>
111
+ </div>
112
+ </li>
113
+ </ol>
114
+ </td>
115
+ <td class="outter">
116
+ <h2><?php esc_html_e( 'General', 'custom-post-type-ui' ); ?></h2>
117
  <ol id="questions_general">
118
  <li>
119
+ <span tabindex="0" class="question" aria-controls="q8" aria-expanded="false"><?php esc_html_e( 'I have post types with spaces in their slug and can not successfully delete them. How can I fix that?', 'custom-post-type-ui' ); ?></span>
120
+ <div class="answer" id="q8"><?php esc_html_e( 'Visit the Import/Export page and copy the export code into the import side on the left. Replace the space with an underscore and then click "Import". You should be able to delete the individual post types afterwards.', 'custom-post-type-ui' ); ?>
121
  </div>
122
  </li>
123
  <li>
124
+ <span tabindex="0" class="question" aria-controls="q9" aria-expanded="false"><?php esc_html_e( 'I changed my custom post type name and now I can not get to my posts. How do I get them back?', 'custom-post-type-ui' ); ?></span>
125
+ <div class="answer" id="q9"><?php esc_html_e( 'You can either change the custom post type name back to the original name or try the Post Type Switcher plugin', 'custom-post-type-ui' ); ?>
126
  <a href="https://wordpress.org/plugins/post-type-switcher/" target="_blank">https://wordpress.org/extend/plugins/post-type-switcher/</a>
127
  </div>
128
  </li>
129
  <li>
130
+ <span tabindex="0" class="question" aria-controls="q10" aria-expanded="false"><?php esc_html_e( 'I changed my custom post type or taxonomy slug and now I have duplicates shown. How do I remove the duplicate?', 'custom-post-type-ui' ); ?></span>
131
+ <div class="answer" id="q10"><?php esc_html_e( 'Renaming the slug for a post type or taxonomy creates a new entry in our saved option which gets registered as its own post type or taxonomy. Since the settings will be mirrored from the previous slug, you will just need to delete the previous version\'s entry.', 'custom-post-type-ui' ); ?> <a href="https://wordpress.org/plugins/post-type-switcher/" target="_blank">https://wordpress.org/extend/plugins/post-type-switcher/</a></div>
132
  </li>
133
  <li>
134
+ <span tabindex="0" class="question" aria-controls="q11" aria-expanded="false"><?php esc_html_e( 'I have added post thumbnail and/or post format support to my post type, but those do not appear when adding a post type post.', 'custom-post-type-ui' ); ?></span>
135
+ <div class="answer" id="q11"><?php esc_html_e( 'Make sure your theme has post "post-thumbnails" theme support enabled.', 'custom-post-type-ui' ); ?> <a href="https://codex.wordpress.org/Function_Reference/add_theme_support" target="_blank">https://codex.wordpress.org/Function_Reference/add_theme_support</a></div>
136
  </li>
137
  <li>
138
+ <span tabindex="0" class="question" aria-controls="q12" aria-expanded="false"><?php esc_html_e( 'Do you have any recommendations for an alternative to Visual Composer?', 'custom-post-type-ui' ); ?></span>
139
+ <div class="answer" id="q12"><?php esc_html_e( 'We recommend using VelocityPage.', 'custom-post-type-ui' ); ?>
140
  <a href="https://velocitypage.com" target="_blank">https://velocitypage.com</a>
141
  </div>
142
  </li>
143
  <li>
144
+ <span tabindex="0" class="question" aria-controls="q13" aria-expanded="false"><?php esc_html_e( 'Is there any way to get CPTUI-registered post types working with Visual Composer Media Grid?', 'custom-post-type-ui' ); ?></span>
145
 
146
+ <div class="answer" id="q13"><?php esc_html_e( 'Please see the solution from the following forum support thread.', 'custom-post-type-ui' ); ?>
147
  <a href="https://wordpress.org/support/topic/custom-post-type-and-visual-composer-grid-block?replies=11#post-7111458" target="_blank">https://wordpress.org/support/topic/custom-post-type-and-visual-composer-grid-block?replies=11#post-7111458</a>
148
  </div>
149
  </li>
150
  </ol>
151
  </td>
152
+ </tr>
153
+ <tr>
154
  <td class="outter">
155
+ <h2><?php esc_html_e( 'Front-end Display', 'custom-post-type-ui' ); ?></h2>
156
  <ol id="questions_front">
157
  <li>
158
+ <span tabindex="0" class="question" aria-controls="q14" aria-expanded="false"><?php esc_html_e( 'What template files should I edit to alter my post type display?', 'custom-post-type-ui' ); ?></span>
159
+ <div class="answer" id="q14"><?php
160
+ printf(
161
+ esc_html__( 'Please visit the %sTemplate Hierarchy%s page on the WordPress codex for details about available templates.', 'custom-post-type-ui' ),
162
+ '<a href="https://codex.wordpress.org/Template_Hierarchy" target="_blank">',
163
+ '</a>'
164
+ ); ?>
165
  </div>
166
  </li>
167
  <li>
168
+ <span tabindex="0" class="question" aria-controls="q15" aria-expanded="false"><?php esc_html_e( 'How do I display my custom post type on my site?', 'custom-post-type-ui' ); ?></span>
169
+ <div class="answer" id="q15"><?php
170
+ printf(
171
+ esc_html__( 'We encourage checking out %s for easily displaying post type content wherever you can utilize a shortcode. If you prefer to handle on your own, you will need to utilize the %s class to handle display in custom locations. If you have set the post type to have archives, the archive url should be something like "http://www.mysite.com/post-type-slug"', 'custom-post-type-ui' ),
172
+ sprintf( '<a href="%s">%s</a>',
173
+ 'https://pluginize.com/product/custom-post-type-ui-extended/?utm_source=faq&utm_medium=text&utm_campaign=cptui',
174
+ 'Custom Post Type UI Extended'
175
+ ),
176
+ '<a href="https://codex.wordpress.org/Class_Reference/WP_Query" target="_blank">WP_Query</a>'
177
+ ); ?>
178
+ </div>
179
  </li>
180
  <li>
181
+ <span tabindex="0" class="question" aria-controls="q16" aria-expanded="false"><?php esc_html_e( 'I have added categories and tags to my custom post type, but they do not appear in the archives.', 'custom-post-type-ui' ); ?></span>
182
+ <div class="answer" id="q16"><?php printf( esc_html__( 'You will need to add your newly created post type to the types that the category and tag archives query for. You can see a tutorial on how to do that at %s', 'custom-post-type-ui' ),
183
  '<a href="https://wpmu.org/add-custom-post-types-to-tags-and-categories-in-wordpress/" target="_blank">https://wpmu.org/add-custom-post-types-to-tags-and-categories-in-wordpress/</a>'
184
  ); ?> </div>
185
  </li>
186
  </ol>
187
  </td>
 
 
188
  <td class="outter">
189
+ <h2><?php esc_html_e( 'Advanced', 'custom-post-type-ui' ); ?></h2>
190
  <ol id="questions_advanced">
191
  <li>
192
+ <span tabindex="0" class="question" aria-controls="q17" aria-expanded="false"><?php esc_html_e( 'How do I add custom metaboxes to my post type?', 'custom-post-type-ui' ); ?></span>
193
+ <div class="answer" id="q17"><?php
194
+ printf(
195
+ esc_html__( 'We recommend checking out %s, the latest iteration of "Custom Metaboxes and Fields for WordPress". Both are maintained by WebDevStudios.', 'custom-post-type-ui' ),
196
+ '<a href="https://wordpress.org/plugins/cmb2/" target="_blank">CMB2</a>'
197
+ ); ?>
198
  </div>
199
  </li>
200
  <li>
201
+ <span tabindex="0" class="question" aria-controls="q18" aria-expanded="false"><?php esc_html_e( 'How do I add a newly registered taxonomy to a post type that already exists?', 'custom-post-type-ui' ); ?></span>
202
+ <div class="answer" id="q18"><?php
203
+ printf(
204
+ esc_html__( 'Check out the %s function for documentation and usage examples.', 'custom-post-type-ui' ),
205
+ '<a href="https://codex.wordpress.org/Function_Reference/register_taxonomy_for_object_type" target="_blank">register_taxonomy_for_object_type()</a>'
206
  ); ?>
207
  </div>
208
  </li>
209
  <li>
210
+ <span tabindex="0" class="question" aria-controls="q19" aria-expanded="false"><?php esc_html_e( 'Post relationships?', 'custom-post-type-ui' ); ?></span>
211
+ <div class="answer" id="q19"><?php
212
+ printf(
213
+ esc_html__( '%s has an excellent %spost%s introducing users to the %sPosts 2 Posts%s plugin that should be a good start.', 'custom-post-type-ui' ),
214
+ 'Pippin Williamson',
215
+ '<a href="https://pippinsplugins.com/introduction-posts-2-posts-plugin/" target="_blank">',
216
+ '</a>',
217
+ '<a href="https://wordpress.org/plugins/posts-to-posts/" target="_blank">',
218
+ '</a>'
219
+ ); ?></div>
220
  </li>
221
  <li>
222
+ <span tabindex="0" class="question" aria-controls="q20" aria-expanded="false"><?php esc_html_e( 'Is there any function reference list?', 'custom-post-type-ui' ); ?></span>
223
+ <div class="answer" id="q20"><?php printf( esc_html__( '%s has compiled a nice list of functions used by our plugin. Note not all will be useful as they are attached to hooks.', 'custom-post-type-ui' ),
224
  '<a href="http://hookr.io/plugins/custom-post-type-ui/1.0.5/all/#index=c" target="_blank">Hookr.io</a>' ); ?></div>
225
  </li>
226
  <li>
227
+ <span tabindex="0" class="question" aria-controls="q21" aria-expanded="false"><?php esc_html_e( 'How do I filter the "enter title here" text in the post editor screen?', 'custom-post-type-ui' ); ?></span>
228
+ <div class="answer" id="q21"><p><?php esc_html_e( 'Change text inside the post/page editor title field. Should be able to adapt as necessary.', 'custom-post-type-ui' ); ?></p>
229
  <pre><code>function my_custom_title_text( $title ){
230
  global $post;
231
  if ( 'ENTER POST TYPE SLUG HERE' == $post->post_type )
inc/utility.php CHANGED
@@ -287,38 +287,130 @@ function cptui_get_post_type_exists( $slug = '', $data = array() ) {
287
  * @internal
288
  */
289
  function cptui_products_sidebar() {
290
- if ( false === ( $ads = get_transient( 'wds_promos' ) ) ) {
291
- $ads = wp_remote_get( 'https://webdevstudios.com/assets/wds.json' );
292
 
293
- if ( 200 === wp_remote_retrieve_response_code( $ads ) ) {
294
- $ads = json_decode( wp_remote_retrieve_body( $ads ) );
295
- set_transient( 'wds_promos', $ads, DAY_IN_SECONDS );
296
- }
297
- }
298
 
 
299
  if ( ! empty( $ads ) ) {
300
- echo '<div class="wdspromos">';
301
  foreach ( $ads as $ad ) {
302
- $the_ad = $ad->text;
303
- $image = wp_remote_get( $ad->image );
304
- if ( 200 === wp_remote_retrieve_response_code( $image ) ) {
305
- $the_ad = sprintf(
306
- '<img src="%s" alt="%s">',
307
- $ad->image,
308
- $ad->text
309
- );
310
- }
311
 
 
 
 
 
 
 
 
312
  printf(
313
- '<a href="%s">%s</a>',
314
- $ad->url,
315
  $the_ad
316
  );
317
  }
318
- echo '</div>';
319
-
320
  }
 
321
 
322
  }
323
  add_action( 'cptui_below_post_type_tab_menu', 'cptui_products_sidebar' );
324
  add_action( 'cptui_below_taxonomy_tab_menu', 'cptui_products_sidebar' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  * @internal
288
  */
289
  function cptui_products_sidebar() {
 
 
290
 
291
+ echo '<div class="wdspromos">';
292
+
293
+ cptui_newsletter_form();
 
 
294
 
295
+ $ads = cptui_get_ads();
296
  if ( ! empty( $ads ) ) {
 
297
  foreach ( $ads as $ad ) {
 
 
 
 
 
 
 
 
 
298
 
299
+ $the_ad = sprintf(
300
+ '<img src="%s" alt="%s">',
301
+ esc_attr( $ad['image'] ),
302
+ esc_attr( $ad['text'] )
303
+ );
304
+
305
+ // Escaping $the_ad breaks the html.
306
  printf(
307
+ '<p><a href="%s">%s</a></p>',
308
+ esc_url( $ad['url'] ),
309
  $the_ad
310
  );
311
  }
 
 
312
  }
313
+ echo '</div>';
314
 
315
  }
316
  add_action( 'cptui_below_post_type_tab_menu', 'cptui_products_sidebar' );
317
  add_action( 'cptui_below_taxonomy_tab_menu', 'cptui_products_sidebar' );
318
+
319
+ /**
320
+ * Outputs our newsletter signup form.
321
+ *
322
+ * @since 1.3.4
323
+ * @internal
324
+ */
325
+ function cptui_newsletter_form() {
326
+ ?>
327
+ <!-- Begin MailChimp Signup Form -->
328
+ <link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
329
+ <div id="mc_embed_signup">
330
+ <form action="//webdevstudios.us1.list-manage.com/subscribe/post?u=67169b098c99de702c897d63e&amp;id=9cb1c7472e" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
331
+ <div id="mc_embed_signup_scroll">
332
+ <p><strong><?php esc_html_e( 'Get email updates from pluginize.com about Custom Post Type UI', 'custom-post-type-ui' ); ?></strong></p>
333
+ <div class="mc-field-group">
334
+ <label for="mce-EMAIL"><?php esc_html_e( 'Email Address', 'custom-post-type-ui' ); ?></label>
335
+ <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
336
+ </div>
337
+ <div id="mce-responses" class="clear">
338
+ <div class="response" id="mce-error-response" style="display:none"></div>
339
+ <div class="response" id="mce-success-response" style="display:none"></div>
340
+ </div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
341
+ <div style="position: absolute; left: -5000px;" aria-hidden="true">
342
+ <input type="text" name="b_67169b098c99de702c897d63e_9cb1c7472e" tabindex="-1" value=""></div>
343
+ <div class="clear">
344
+ <input type="submit" value="<?php esc_attr_e( 'Subscribe', 'custom-post-type-ui' ); ?>" name="subscribe" id="mc-embedded-subscribe" class="button">
345
+ </div>
346
+ </div>
347
+ </form>
348
+ </div>
349
+ <script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script>
350
+ <script type='text/javascript'>(function ($) {
351
+ window.fnames = new Array();
352
+ window.ftypes = new Array();
353
+ fnames[0] = 'EMAIL';
354
+ ftypes[0] = 'email';
355
+ }(jQuery));
356
+ var $mcj = jQuery.noConflict(true);</script>
357
+ <!--End mc_embed_signup-->
358
+ <?php
359
+ }
360
+
361
+ /**
362
+ * Fetch all set ads to be displayed.
363
+ *
364
+ * @since 1.3.4
365
+ *
366
+ * @return array
367
+ */
368
+ function cptui_get_ads() {
369
+
370
+ /**
371
+ * Filters the array of ads to iterate over.
372
+ *
373
+ * Each index in the ads array should have a url index with the url to link to,
374
+ * an image index specifying an image location to load from, and a text index used
375
+ * for alt attribute text.
376
+ *
377
+ * @since 1.3.4
378
+ *
379
+ * @param array $value Array of ads to iterate over. Default empty.
380
+ */
381
+ $ads = (array) apply_filters( 'cptui_ads', array() );
382
+ return $ads;
383
+ }
384
+
385
+ /**
386
+ * Add our default ads to the ads filter.
387
+ *
388
+ * @since 1.3.4
389
+ *
390
+ * @internal
391
+ *
392
+ * @param array $ads Array of ads set so far.
393
+ * @return array $ads Array of newly constructed ads.
394
+ */
395
+ function cptui_default_ads( $ads = array() ) {
396
+ $ads[] = array(
397
+ 'url' => 'https://pluginize.com/product/custom-post-type-ui-extended/?utm_source=sidebar-v3&utm_medium=banner&utm_campaign=cptui',
398
+ 'image' => plugin_dir_url( dirname( __FILE__ ) ) . 'images/wds_ads/cptuix-ad-3.png',
399
+ 'text' => 'Custom Post Type UI Extended product ad',
400
+ );
401
+
402
+ $ads[] = array(
403
+ 'url' => 'https://apppresser.com/?utm_source=pluginize&utm_medium=plugin&utm_campaign=cptui',
404
+ 'image' => plugin_dir_url( dirname( __FILE__ ) ) . 'images/wds_ads/apppresser.png',
405
+ 'text' => 'AppPresser product ad',
406
+ );
407
+
408
+ $ads[] = array(
409
+ 'url' => 'https://maintainn.com/?utm_source=Pluginize&utm_medium=Plugin-Sidebar&utm_campaign=CPTUI',
410
+ 'image' => plugin_dir_url( dirname( __FILE__ ) ) . 'images/wds_ads/maintainn.png',
411
+ 'text' => 'Maintainn product ad',
412
+ );
413
+
414
+ return $ads;
415
+ }
416
+ add_filter( 'cptui_ads', 'cptui_default_ads' );
js/cptui.js CHANGED
@@ -64,8 +64,10 @@
64
  return s;
65
  }
66
 
67
- var _custom_media = true,
68
- _orig_send_attachment = wp.media.editor.send.attachment;
 
 
69
 
70
  $('#cptui_choose_icon').on('click',function(e){
71
  e.preventDefault();
64
  return s;
65
  }
66
 
67
+ if ( undefined != wp.media ) {
68
+ var _custom_media = true,
69
+ _orig_send_attachment = wp.media.editor.send.attachment;
70
+ }
71
 
72
  $('#cptui_choose_icon').on('click',function(e){
73
  e.preventDefault();
js/cptui.min.js CHANGED
@@ -1 +1 @@
1
- !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}$("#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=$(this).val();value=value.replace(/ /g,"_"),value=value.toLowerCase(),value=replaceDiacritics(value),$(this).attr("value",value)});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()})}(jQuery);
1
+ !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}if($("#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=$(this).val();value=value.replace(/ /g,"_"),value=value.toLowerCase(),value=replaceDiacritics(value),$(this).attr("value",value)}),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()})}(jQuery);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: custom post types, CPT, CMS, post, types, post type, cck, taxonomy, tax, custom
5
  Requires at least: 4.2
6
  Tested up to: 4.5
7
- Stable tag: 1.3.3
8
  License: GPLv2
9
 
10
  Admin UI for creating custom post types and custom taxonomies in WordPress
@@ -13,10 +13,12 @@ Admin UI for creating custom post types and custom taxonomies in WordPress
13
 
14
  This plugin provides an easy to use interface for creating and administrating custom post types and taxonomies in WordPress. This plugin is created for WordPress 3.0 and higher.
15
 
16
- Please note that Custom Post Type UI alone will not display post types or taxonomies data in customized places within your site; it simply registers them for you to use. Check out [Custom Post Type UI Extended](https://pluginize.com/product/custom-post-type-ui-extended/?utm_source=cptui-wporg&utm_medium=text&utm_campaign=cptui_description) for an easy way to display post type content from any registered types on your site, including those created with Custom Post Type UI and more.
17
 
18
  All official development on this plugin is on GitHub. New releases are still published here on WordPress.org. The version shown here should be considered the latest stable release. You can find the repo at [https://github.com/WebDevStudios/custom-post-type-ui](https://github.com/WebDevStudios/custom-post-type-ui). Please file confirmed issues, bugs, and enhancement ideas there, when possible.
19
 
 
 
20
  == Screenshots ==
21
 
22
  1. Add new post type screen and tab.
@@ -33,6 +35,13 @@ All official development on this plugin is on GitHub. New releases are still pub
33
 
34
  == Changelog ==
35
 
 
 
 
 
 
 
 
36
  = 1.3.3 - 2016-4-5 =
37
  * Revert Changes for ajax/heartbeat API requests before post type registration. 3rd party or other plugins were breaking because post types were not registered.
38
 
@@ -208,6 +217,13 @@ All official development on this plugin is on GitHub. New releases are still pub
208
 
209
  == Upgrade Notice ==
210
 
 
 
 
 
 
 
 
211
  = 1.3.3 - 2016-4-5 =
212
  * Revert Changes for ajax/heartbeat API requests before post type registration. 3rd party or other plugins were breaking because post types were not registered.
213
 
4
  Tags: custom post types, CPT, CMS, post, types, post type, cck, taxonomy, tax, custom
5
  Requires at least: 4.2
6
  Tested up to: 4.5
7
+ Stable tag: 1.3.4
8
  License: GPLv2
9
 
10
  Admin UI for creating custom post types and custom taxonomies in WordPress
13
 
14
  This plugin provides an easy to use interface for creating and administrating custom post types and taxonomies in WordPress. This plugin is created for WordPress 3.0 and higher.
15
 
16
+ Please note that Custom Post Type UI alone will not display post types or taxonomies data in customized places within your site; it simply registers them for you to use. Check out [Custom Post Type UI Extended](https://pluginize.com/product/custom-post-type-ui-extended/?utm_source=cptui-desription&utm_medium=text&utm_campaign=wporg) for an easy way to display post type content from any registered types on your site, including those created with Custom Post Type UI and more.
17
 
18
  All official development on this plugin is on GitHub. New releases are still published here on WordPress.org. The version shown here should be considered the latest stable release. You can find the repo at [https://github.com/WebDevStudios/custom-post-type-ui](https://github.com/WebDevStudios/custom-post-type-ui). Please file confirmed issues, bugs, and enhancement ideas there, when possible.
19
 
20
+ [Pluginize](https://pluginize.com/?utm_source=cptui&utm_medium=text&utm_campaign=wporg) was launched in 2016 by [WebDevStudios](https://webdevstudios.com/) to promote, support, and house all of their [WordPress products](https://pluginize.com/shop/?utm_source=cptui-&utm_medium=text&utm_campaign=wporg). Pluginize is not only [creating new products for WordPress all the time, like CPTUI Extended](https://pluginize.com/product/custom-post-type-ui-extended/?utm_source=cptui&utm_medium=text&utm_campaign=wporg), but also provides ongoing support and development for WordPress community favorites like [CMB2](https://wordpress.org/plugins/cmb2/) and more.
21
+
22
  == Screenshots ==
23
 
24
  1. Add new post type screen and tab.
35
 
36
  == Changelog ==
37
 
38
+ = 1.3.4 - 2016-5-4 =
39
+ * Fixed: moved WDS-based services "ads" to within the plugin itself. Will not request remote resources.
40
+ * Fixed: Better output formatting if WDS/Pluginize "ads" failed to load images.
41
+ * Fixed: undefined variable error in cptui.js
42
+ * Added: Newsletter subscription form to stay uptodate with Custom Post Type UI &amp; Custom Post Type UI Extended news.
43
+ * Added: Support page/FAQ info regarding Pluginize and recent sidebar developments.
44
+
45
  = 1.3.3 - 2016-4-5 =
46
  * Revert Changes for ajax/heartbeat API requests before post type registration. 3rd party or other plugins were breaking because post types were not registered.
47
 
217
 
218
  == Upgrade Notice ==
219
 
220
+ = 1.3.4 - 2016-5-4 =
221
+ * Fixed: moved WDS-based services "ads" to within the plugin itself. Will not request remote resources.
222
+ * Fixed: Better output formatting if WDS/Pluginize "ads" failed to load images.
223
+ * Fixed: undefined variable error in cptui.js
224
+ * Added: Newsletter subscription form to stay uptodate with Custom Post Type UI &amp; Custom Post Type UI Extended news.
225
+ * Added: Support page/FAQ info regarding Pluginize and recent sidebar developments.
226
+
227
  = 1.3.3 - 2016-4-5 =
228
  * Revert Changes for ajax/heartbeat API requests before post type registration. 3rd party or other plugins were breaking because post types were not registered.
229