Custom Post Types and Custom Fields creator – WCK - Version 1.2.7

Version Description

  • Added Heading field type
  • Added Colorpicker field type
  • Added Currency field type
  • Added number of rows and readonly options to the textarea field
  • Added error notice for users with a php version lower than 5.3.0 on the settings page
Download this release

Release Info

Developer madalin.ungureanu
Plugin Icon 128x128 Custom Post Types and Custom Fields creator – WCK
Version 1.2.7
Comparing to
See all releases

Code changes from version 1.2.6 to 1.2.7

css/wck-cfc.css CHANGED
@@ -1,18 +1,28 @@
1
- #wck_cfc_fields .row-options, #wck_cfc_fields .row-attach-upload-to-post, #wck_cfc_fields .row-cpt{
2
  display:none;
3
  }
4
 
5
  #container_wck_cfc_fields .row-options,
6
  #container_wck_cfc_fields .row-attach-upload-to-post,
7
- #container_wck_cfc_fields .row-cpt{
 
 
8
  display:none;
9
  }
10
 
 
 
 
 
 
 
11
  #container_wck_cfc_fields .element_type_cpt-select .row-cpt,
12
  #container_wck_cfc_fields .element_type_checkbox .row-options,
13
  #container_wck_cfc_fields .element_type_select .row-options,
14
  #container_wck_cfc_fields .element_type_radio .row-options,
15
- #container_wck_cfc_fields .element_type_upload .row-attach-upload-to-post{
 
 
16
  display:block;
17
  }
18
 
1
+ #wck_cfc_fields .row-options, #wck_cfc_fields .row-attach-upload-to-post, #wck_cfc_fields .row-cpt, #wck_cfc_fields .row-number-of-rows, #wck_cfc_fields .row-readonly{
2
  display:none;
3
  }
4
 
5
  #container_wck_cfc_fields .row-options,
6
  #container_wck_cfc_fields .row-attach-upload-to-post,
7
+ #container_wck_cfc_fields .row-cpt,
8
+ #container_wck_cfc_fields .row-number-of-rows,
9
+ #container_wck_cfc_fields .row-readonly{
10
  display:none;
11
  }
12
 
13
+ #container_wck_cfc_fields .element_type_heading .row-required,
14
+ #container_wck_cfc_fields .element_type_heading .row-default-value,
15
+ #container_wck_cfc_fields .element_type_heading .slug-title {
16
+ display: none;
17
+ }
18
+
19
  #container_wck_cfc_fields .element_type_cpt-select .row-cpt,
20
  #container_wck_cfc_fields .element_type_checkbox .row-options,
21
  #container_wck_cfc_fields .element_type_select .row-options,
22
  #container_wck_cfc_fields .element_type_radio .row-options,
23
+ #container_wck_cfc_fields .element_type_upload .row-attach-upload-to-post,
24
+ #container_wck_cfc_fields .element_type_textarea .row-number-of-rows,
25
+ #container_wck_cfc_fields .element_type_textarea .row-readonly{
26
  display:block;
27
  }
28
 
js/wck-cfc.js CHANGED
@@ -1,7 +1,4 @@
1
  jQuery(function(){
2
-
3
-
4
-
5
  jQuery(document).on( 'change', '#wck_cfc_fields #field-type', function () {
6
  value = jQuery(this).val();
7
 
@@ -24,7 +21,26 @@ jQuery(function(){
24
  }
25
  else{
26
  jQuery( '#wck_cfc_fields .row-cpt' ).hide();
27
- } });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  jQuery(document).on( 'change', '#container_wck_cfc_fields #field-type', function () {
30
  value = jQuery(this).val();
@@ -47,7 +63,24 @@ jQuery(function(){
47
  }
48
  else{
49
  jQuery(this).parent().parent().parent().children(".row-cpt").hide();
50
- }
51
-
52
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  });
1
  jQuery(function(){
 
 
 
2
  jQuery(document).on( 'change', '#wck_cfc_fields #field-type', function () {
3
  value = jQuery(this).val();
4
 
21
  }
22
  else{
23
  jQuery( '#wck_cfc_fields .row-cpt' ).hide();
24
+ }
25
+
26
+ if( value == 'textarea' ){
27
+ jQuery( '#wck_cfc_fields .row-number-of-rows' ).show();
28
+ jQuery( '#wck_cfc_fields .row-readonly' ).show();
29
+ }
30
+ else{
31
+ jQuery( '#wck_cfc_fields .row-number-of-rows' ).hide();
32
+ jQuery( '#wck_cfc_fields .row-readonly' ).hide();
33
+ }
34
+
35
+ if( value == 'heading' ) {
36
+ jQuery( '#wck_cfc_fields .row-required' ).hide();
37
+ jQuery( '#wck_cfc_fields .row-default-value' ).hide();
38
+ } else {
39
+ jQuery( '#wck_cfc_fields .row-required' ).show();
40
+ jQuery( '#wck_cfc_fields .row-default-value' ).show();
41
+ }
42
+
43
+ });
44
 
45
  jQuery(document).on( 'change', '#container_wck_cfc_fields #field-type', function () {
46
  value = jQuery(this).val();
63
  }
64
  else{
65
  jQuery(this).parent().parent().parent().children(".row-cpt").hide();
66
+ }
67
+
68
+ if( value == 'textarea' ){
69
+ jQuery(this).parent().parent().parent().children(".row-number-of-rows").show();
70
+ jQuery(this).parent().parent().parent().children(".row-readonly").show();
71
+ }
72
+ else{
73
+ jQuery(this).parent().parent().parent().children(".row-number-of-rows").hide();
74
+ jQuery(this).parent().parent().parent().children(".row-readonly").hide();
75
+ }
76
+
77
+ if( value == 'heading' ) {
78
+ jQuery( this ).parent().parent().parent().children( ".row-required" ).hide();
79
+ jQuery( this ).parent().parent().parent().children( ".row-default-value" ).hide();
80
+ } else {
81
+ jQuery( this ).parent().parent().parent().children( ".row-required" ).show();
82
+ jQuery( this ).parent().parent().parent().children( ".row-default-value" ).show();
83
+ }
84
+
85
+ });
86
  });
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
- === WCK - Custom Fields and Custom Post Types Creator ===
2
 
3
  Contributors: cozmoslabs, reflectionmedia, madalin.ungureanu, sareiodata, adispiac
4
  Donate link: http://www.cozmoslabs.com/wordpress-creation-kit/
5
- Tags: custom fields, custom field, wordpress custom fields, advanced custom fields, custom post type, custom post types, post types, cpt, post type, repeater fields, repeater, repeatable fields, meta box, metabox, taxonomy, taxonomies, custom taxonomy, custom taxonomies, custom, custom fields creator, post meta, meta, get_post_meta, post creator, cck, content types, types
6
 
7
  Requires at least: 3.1
8
  Tested up to: 4.5.2
9
- Stable tag: 1.2.6
10
 
11
  A must have tool for creating custom fields, custom post types and taxonomies, fast and without any programming knowledge.
12
 
@@ -143,6 +143,13 @@ Creating a taxonomy generally automatically creates a special query variable usi
143
  10. Taxonomy listing
144
 
145
  == Changelog ==
 
 
 
 
 
 
 
146
  = 1.2.6 =
147
  * Small change in saving single metaboxes
148
  * Fixed a possible conflict with ACF Pro
1
+ === WCK - Custom Post Types and Custom Fields Creator ===
2
 
3
  Contributors: cozmoslabs, reflectionmedia, madalin.ungureanu, sareiodata, adispiac
4
  Donate link: http://www.cozmoslabs.com/wordpress-creation-kit/
5
+ Tags: custom fields, custom field, wordpress custom fields, custom post type, custom post types, repeater fields, meta box, metabox, custom taxonomy, custom fields creator, post meta
6
 
7
  Requires at least: 3.1
8
  Tested up to: 4.5.2
9
+ Stable tag: 1.2.7
10
 
11
  A must have tool for creating custom fields, custom post types and taxonomies, fast and without any programming knowledge.
12
 
143
  10. Taxonomy listing
144
 
145
  == Changelog ==
146
+ = 1.2.7 =
147
+ * Added Heading field type
148
+ * Added Colorpicker field type
149
+ * Added Currency field type
150
+ * Added number of rows and readonly options to the textarea field
151
+ * Added error notice for users with a php version lower than 5.3.0 on the settings page
152
+
153
  = 1.2.6 =
154
  * Small change in saving single metaboxes
155
  * Fixed a possible conflict with ACF Pro
wck-cfc.php CHANGED
@@ -149,7 +149,7 @@ function wck_cfc_create_box(){
149
  new Wordpress_Creation_Kit( $args );
150
 
151
  /* set up field types */
152
- $field_types = array( 'text', 'textarea', 'select', 'checkbox', 'radio', 'upload', 'wysiwyg editor', 'datepicker', 'country select', 'user select', 'cpt select' );
153
  $field_types = apply_filters( 'wck_field_types', $field_types );
154
 
155
  /* setup post types */
@@ -164,7 +164,9 @@ function wck_cfc_create_box(){
164
  array( 'type' => 'select', 'title' => __( 'CPT', 'wck' ), 'slug' => 'cpt', 'options' => $post_types, 'default' => 'post', 'description' => __( 'Select what custom post type should be used in the CPT Select.', 'wck' ) ),
165
  array( 'type' => 'text', 'title' => __( 'Default Value', 'wck' ), 'slug' => 'default-value', 'description' => __( 'Default value of the field. For Checkboxes if there are multiple values separate them with a ",". For an Upload field input an attachment id.', 'wck' ) ),
166
  array( 'type' => 'text', 'title' => __( 'Options', 'wck' ), 'slug' => 'options', 'description' => __( 'Options for field types "select", "checkbox" and "radio". For multiple options separate them with a ",". You can use the following structure if you want the label to be different from the value: %LabelOne%valueone,%LabelTwo%valuetwo,%LabelThree%valuethree', 'wck' ) ),
167
- array( 'type' => 'checkbox', 'title' => __( 'Attach upload to post', 'wck' ), 'slug' => 'attach-upload-to-post', 'description' => __( 'Uploads will be attached to the post if this is checked', 'wck' ), 'options' => array( 'yes' ), 'default' => 'yes' )
 
 
168
  ) );
169
 
170
 
@@ -263,6 +265,12 @@ function wck_cfc_create_boxes_args(){
263
  if( !empty( $wck_cfc_field['attach-upload-to-post'] ) )
264
  $fields_inner_array['attach_to_post'] = $wck_cfc_field['attach-upload-to-post'] == 'yes' ? true : false;
265
 
 
 
 
 
 
 
266
  $fields_array[] = $fields_inner_array;
267
  }
268
  }
@@ -645,7 +653,7 @@ add_filter( 'wck_field_types', 'wck_cfc_filter_field_types' );
645
  function wck_cfc_filter_field_types( $field_types ){
646
  $wck_premium_update = WCK_PLUGIN_DIR.'/update/';
647
  if ( !file_exists ($wck_premium_update . 'update-checker.php'))
648
- $field_types = array( 'text', 'textarea', 'select', 'checkbox', 'radio', 'upload', 'wysiwyg editor' );
649
 
650
  return $field_types;
651
  }
149
  new Wordpress_Creation_Kit( $args );
150
 
151
  /* set up field types */
152
+ $field_types = array( 'heading', 'text', 'textarea', 'select', 'checkbox', 'radio', 'upload', 'wysiwyg editor', 'datepicker', 'colorpicker', 'country select', 'user select', 'cpt select', 'currency select' );
153
  $field_types = apply_filters( 'wck_field_types', $field_types );
154
 
155
  /* setup post types */
164
  array( 'type' => 'select', 'title' => __( 'CPT', 'wck' ), 'slug' => 'cpt', 'options' => $post_types, 'default' => 'post', 'description' => __( 'Select what custom post type should be used in the CPT Select.', 'wck' ) ),
165
  array( 'type' => 'text', 'title' => __( 'Default Value', 'wck' ), 'slug' => 'default-value', 'description' => __( 'Default value of the field. For Checkboxes if there are multiple values separate them with a ",". For an Upload field input an attachment id.', 'wck' ) ),
166
  array( 'type' => 'text', 'title' => __( 'Options', 'wck' ), 'slug' => 'options', 'description' => __( 'Options for field types "select", "checkbox" and "radio". For multiple options separate them with a ",". You can use the following structure if you want the label to be different from the value: %LabelOne%valueone,%LabelTwo%valuetwo,%LabelThree%valuethree', 'wck' ) ),
167
+ array( 'type' => 'checkbox', 'title' => __( 'Attach upload to post', 'wck' ), 'slug' => 'attach-upload-to-post', 'description' => __( 'Uploads will be attached to the post if this is checked', 'wck' ), 'options' => array( 'yes' ), 'default' => 'yes' ),
168
+ array( 'type' => 'text', 'title' => __( 'Number of rows', 'wck' ), 'slug' => 'number-of-rows', 'description' => __( 'Number of rows for the textarea', 'wck' ), 'default' => '5' ),
169
+ array( 'type' => 'select', 'title' => __( 'Readonly', 'wck' ), 'slug' => 'readonly', 'options' => array( 'false', 'true' ), 'default' => 'false', 'description' => __( 'Whether the textarea is readonly or not', 'wck' ) ),
170
  ) );
171
 
172
 
265
  if( !empty( $wck_cfc_field['attach-upload-to-post'] ) )
266
  $fields_inner_array['attach_to_post'] = $wck_cfc_field['attach-upload-to-post'] == 'yes' ? true : false;
267
 
268
+ if( !empty( $wck_cfc_field['number-of-rows'] ) )
269
+ $fields_inner_array['number_of_rows'] = trim( $wck_cfc_field['number-of-rows'] );
270
+
271
+ if( !empty( $wck_cfc_field['readonly'] ) )
272
+ $fields_inner_array['readonly'] = $wck_cfc_field['readonly'] == 'true' ? true : false;
273
+
274
  $fields_array[] = $fields_inner_array;
275
  }
276
  }
653
  function wck_cfc_filter_field_types( $field_types ){
654
  $wck_premium_update = WCK_PLUGIN_DIR.'/update/';
655
  if ( !file_exists ($wck_premium_update . 'update-checker.php'))
656
+ $field_types = array( 'text', 'textarea', 'select', 'checkbox', 'radio', 'upload', 'wysiwyg editor', 'heading', 'colorpicker', 'currency select' );
657
 
658
  return $field_types;
659
  }
wck-sas.php CHANGED
@@ -90,6 +90,14 @@ function wck_sas_welcome($hook){
90
  $default_plugin_headers = get_plugin_data($plugin_path);
91
  $plugin_name = $default_plugin_headers['Name'];
92
  $plugin_version = $default_plugin_headers['Version'];
 
 
 
 
 
 
 
 
93
  ?>
94
  <div class="wrap about-wrap">
95
  <h1><?php printf( __( 'Welcome to %s', 'wck' ), $plugin_name ); ?></h1>
90
  $default_plugin_headers = get_plugin_data($plugin_path);
91
  $plugin_name = $default_plugin_headers['Name'];
92
  $plugin_version = $default_plugin_headers['Version'];
93
+
94
+ if( version_compare(PHP_VERSION, '5.3.0') < 0 ) { ?>
95
+ <div class="notice-error notice">
96
+ <p>
97
+ <?php _e('<strong>You are using a very old version of PHP</strong> (5.2.x or older) which has serious security and performance issues. Please ask your hoster to provide you with an upgrade path to 5.6 or 7.0','wck'); ?>
98
+ </p>
99
+ </div>
100
+ <?php }
101
  ?>
102
  <div class="wrap about-wrap">
103
  <h1><?php printf( __( 'Welcome to %s', 'wck' ), $plugin_name ); ?></h1>
wck.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WCK - Custom Fields and Custom Post Types Creator
4
  Description: WordPress Creation Kit consists of three tools that can help you create and maintain custom post types, custom taxonomies and most importantly, custom fields and metaboxes for your posts, pages or CPT's.
5
  Author: Cozmoslabs, Madalin Ungureanu, Cristian Antohe
6
- Version: 1.2.6
7
  Author URI: http://www.cozmoslabs.com
8
 
9
  License: GPL2
3
  Plugin Name: WCK - Custom Fields and Custom Post Types Creator
4
  Description: WordPress Creation Kit consists of three tools that can help you create and maintain custom post types, custom taxonomies and most importantly, custom fields and metaboxes for your posts, pages or CPT's.
5
  Author: Cozmoslabs, Madalin Ungureanu, Cristian Antohe
6
+ Version: 1.2.7
7
  Author URI: http://www.cozmoslabs.com
8
 
9
  License: GPL2
wordpress-creation-kit-api/assets/colorpicker/colorpicker.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ .iris-picker {
2
+ z-index: 999 !important;
3
+ position: absolute !important;
4
+ }
wordpress-creation-kit-api/assets/currency/currency-select.php ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * Array with the currency ISO code and associated currency name
5
+ *
6
+ * @return array
7
+ *
8
+ */
9
+ function wck_get_currencies() {
10
+
11
+ $currencies = array(
12
+ 'ALL' => __( 'Albania Lek', 'wck' ),
13
+ 'AFN' => __( 'Afghanistan Afghani', 'wck' ),
14
+ 'ARS' => __( 'Argentina Peso', 'wck' ),
15
+ 'AWG' => __( 'Aruba Guilder', 'wkc' ),
16
+ 'AUD' => __( 'Australia Dollar', 'wck' ),
17
+ 'AZN' => __( 'Azerbaijan New Manat', 'wck' ),
18
+ 'BSD' => __( 'Bahamas Dollar', 'wck' ),
19
+ 'BBD' => __( 'Barbados Dollar','wck' ),
20
+ 'BDT' => __( 'Bangladeshi taka','wck' ),
21
+ 'BYR' => __( 'Belarus Ruble','wck' ),
22
+ 'BZD' => __( 'Belize Dollar','wck' ),
23
+ 'BMD' => __( 'Bermuda Dollar','wck' ),
24
+ 'BOB' => __( 'Bolivia Boliviano','wck' ),
25
+ 'BAM' => __( 'Bosnia and Herzegovina Convertible Marka','wck' ),
26
+ 'BWP' => __( 'Botswana Pula','wck' ),
27
+ 'BGN' => __( 'Bulgaria Lev','wck' ),
28
+ 'BRL' => __( 'Brazil Real','wck' ),
29
+ 'BND' => __( 'Brunei Darussalam Dollar','wck' ),
30
+ 'KHR' => __( 'Cambodia Riel','wck' ),
31
+ 'CAD' => __( 'Canada Dollar','wck' ),
32
+ 'KYD' => __( 'Cayman Islands Dollar','wck' ),
33
+ 'CLP' => __( 'Chile Peso','wck' ),
34
+ 'CNY' => __( 'China Yuan Renminbi','wck' ),
35
+ 'COP' => __( 'Colombia Peso','wck' ),
36
+ 'CRC' => __( 'Costa Rica Colon','wck' ),
37
+ 'HRK' => __( 'Croatia Kuna','wck' ),
38
+ 'CUP' => __( 'Cuba Peso','wck' ),
39
+ 'CZK' => __( 'Czech Republic Koruna','wck' ),
40
+ 'DKK' => __( 'Denmark Krone','wck' ),
41
+ 'DOP' => __( 'Dominican Republic Peso','wck' ),
42
+ 'XCD' => __( 'East Caribbean Dollar','wck' ),
43
+ 'EGP' => __( 'Egypt Pound','wck' ),
44
+ 'SVC' => __( 'El Salvador Colon','wck' ),
45
+ 'EEK' => __( 'Estonia Kroon','wck' ),
46
+ 'EUR' => __( 'Euro','wck' ),
47
+ 'FKP' => __( 'Falkland Islands (Malvinas) Pound','wck' ),
48
+ 'FJD' => __( 'Fiji Dollar','wck' ),
49
+ 'GHC' => __( 'Ghana Cedis','wck' ),
50
+ 'GIP' => __( 'Gibraltar Pound','wck' ),
51
+ 'GTQ' => __( 'Guatemala Quetzal','wck' ),
52
+ 'GGP' => __( 'Guernsey Pound','wck' ),
53
+ 'GYD' => __( 'Guyana Dollar','wck' ),
54
+ 'HNL' => __( 'Honduras Lempira','wck' ),
55
+ 'HKD' => __( 'Hong Kong Dollar','wck' ),
56
+ 'HUF' => __( 'Hungary Forint','wck' ),
57
+ 'ISK' => __( 'Iceland Krona','wck' ),
58
+ 'INR' => __( 'India Rupee','wck' ),
59
+ 'IDR' => __( 'Indonesia Rupiah','wck' ),
60
+ 'IRR' => __( 'Iran Rial','wck' ),
61
+ 'IMP' => __( 'Isle of Man Pound','wck' ),
62
+ 'ILS' => __( 'Israel Shekel','wck' ),
63
+ 'JMD' => __( 'Jamaica Dollar','wck' ),
64
+ 'JPY' => __( 'Japan Yen','wck' ),
65
+ 'JEP' => __( 'Jersey Pound','wck' ),
66
+ 'KZT' => __( 'Kazakhstan Tenge','wck' ),
67
+ 'KPW' => __( 'Korea (North) Won','wck' ),
68
+ 'KRW' => __( 'Korea (South) Won','wck' ),
69
+ 'KGS' => __( 'Kyrgyzstan Som','wck' ),
70
+ 'LAK' => __( 'Laos Kip','wck' ),
71
+ 'LVL' => __( 'Latvia Lat','wck' ),
72
+ 'LBP' => __( 'Lebanon Pound','wck' ),
73
+ 'LRD' => __( 'Liberia Dollar','wck' ),
74
+ 'LTL' => __( 'Lithuania Litas','wck' ),
75
+ 'MKD' => __( 'Macedonia Denar','wck' ),
76
+ 'MYR' => __( 'Malaysia Ringgit','wck' ),
77
+ 'MUR' => __( 'Mauritius Rupee','wck' ),
78
+ 'MXN' => __( 'Mexico Peso','wck' ),
79
+ 'MNT' => __( 'Mongolia Tughrik','wck' ),
80
+ 'MZN' => __( 'Mozambique Metical','wck' ),
81
+ 'NAD' => __( 'Namibia Dollar','wck' ),
82
+ 'NPR' => __( 'Nepal Rupee','wck' ),
83
+ 'ANG' => __( 'Netherlands Antilles Guilder','wck' ),
84
+ 'NZD' => __( 'New Zealand Dollar','wck' ),
85
+ 'NIO' => __( 'Nicaragua Cordoba','wck' ),
86
+ 'NGN' => __( 'Nigeria Naira','wck' ),
87
+ 'NOK' => __( 'Norway Krone','wck' ),
88
+ 'OMR' => __( 'Oman Rial', 'wck' ),
89
+ 'PKR' => __( 'Pakistan Rupee', 'wck' ),
90
+ 'PAB' => __( 'Panama Balboa', 'wck' ),
91
+ 'PYG' => __( 'Paraguay Guarani', 'wck' ),
92
+ 'PEN' => __( 'Peru Nuevo Sol', 'wck' ),
93
+ 'PHP' => __( 'Philippines Peso', 'wck' ),
94
+ 'PLN' => __( 'Poland Zloty', 'wck' ),
95
+ 'QAR' => __( 'Qatar Riyal', 'wck' ),
96
+ 'RON' => __( 'Romania New Leu', 'wck' ),
97
+ 'RUB' => __( 'Russia Ruble', 'wck' ),
98
+ 'SHP' => __( 'Saint Helena Pound', 'wck' ),
99
+ 'SAR' => __( 'Saudi Arabia Riyal', 'wck' ),
100
+ 'RSD' => __( 'Serbia Dinar', 'wck' ),
101
+ 'SCR' => __( 'Seychelles Rupee', 'wck' ),
102
+ 'SGD' => __( 'Singapore Dollar', 'wck' ),
103
+ 'SBD' => __( 'Solomon Islands Dollar', 'wck' ),
104
+ 'SOS' => __( 'Somalia Shilling', 'wck' ),
105
+ 'ZAR' => __( 'South Africa Rand', 'wck' ),
106
+ 'LKR' => __( 'Sri Lanka Rupee', 'wck' ),
107
+ 'SEK' => __( 'Sweden Krona', 'wck' ),
108
+ 'CHF' => __( 'Switzerland Franc', 'wck' ),
109
+ 'SRD' => __( 'Suriname Dollar', 'wck' ),
110
+ 'SYP' => __( 'Syria Pound', 'wck' ),
111
+ 'TWD' => __( 'Taiwan New Dollar', 'wck' ),
112
+ 'THB' => __( 'Thailand Baht', 'wck' ),
113
+ 'TTD' => __( 'Trinidad and Tobago Dollar', 'wck' ),
114
+ 'TRY' => __( 'Turkey Lira', 'wck' ),
115
+ 'TRL' => __( 'Turkey Lira', 'wck' ),
116
+ 'TVD' => __( 'Tuvalu Dollar', 'wck' ),
117
+ 'UAH' => __( 'Ukraine Hryvna', 'wck' ),
118
+ 'GBP' => __( 'United Kingdom Pound', 'wck' ),
119
+ 'UGX' => __( 'Uganda Shilling', 'wck' ),
120
+ 'USD' => __( 'US Dollar', 'wck' ),
121
+ 'UYU' => __( 'Uruguay Peso', 'wck' ),
122
+ 'UZS' => __( 'Uzbekistan Som', 'wck' ),
123
+ 'VEF' => __( 'Venezuela Bolivar', 'wck' ),
124
+ 'VND' => __( 'Viet Nam Dong', 'wck' ),
125
+ 'YER' => __( 'Yemen Rial', 'wck' ),
126
+ 'ZWD' => __( 'Zimbabwe Dollar', 'wck' )
127
+ );
128
+
129
+ return apply_filters( 'wck_get_currencies', $currencies );
130
+
131
+ }
132
+
133
+
134
+ /*
135
+ * Returns the currency symbol for a given currency code
136
+ *
137
+ * @param string $currency_code
138
+ *
139
+ * @return string
140
+ *
141
+ */
142
+ function wck_get_currency_symbol( $currency_code ) {
143
+
144
+ $currency_symbols = array(
145
+ 'AED' => '&#1583;.&#1573;', // ?
146
+ 'AFN' => '&#65;&#102;',
147
+ 'ALL' => '&#76;&#101;&#107;',
148
+ 'AMD' => '',
149
+ 'ANG' => '&#402;',
150
+ 'AOA' => '&#75;&#122;', // ?
151
+ 'ARS' => '&#36;',
152
+ 'AUD' => '&#36;',
153
+ 'AWG' => '&#402;',
154
+ 'AZN' => '&#1084;&#1072;&#1085;',
155
+ 'BAM' => '&#75;&#77;',
156
+ 'BBD' => '&#36;',
157
+ 'BDT' => '&#2547;', // ?
158
+ 'BGN' => '&#1083;&#1074;',
159
+ 'BHD' => '.&#1583;.&#1576;', // ?
160
+ 'BIF' => '&#70;&#66;&#117;', // ?
161
+ 'BMD' => '&#36;',
162
+ 'BND' => '&#36;',
163
+ 'BOB' => '&#36;&#98;',
164
+ 'BRL' => '&#82;&#36;',
165
+ 'BSD' => '&#36;',
166
+ 'BTN' => '&#78;&#117;&#46;', // ?
167
+ 'BWP' => '&#80;',
168
+ 'BYR' => '&#112;&#46;',
169
+ 'BZD' => '&#66;&#90;&#36;',
170
+ 'CAD' => '&#36;',
171
+ 'CDF' => '&#70;&#67;',
172
+ 'CHF' => '&#67;&#72;&#70;',
173
+ 'CLF' => '', // ?
174
+ 'CLP' => '&#36;',
175
+ 'CNY' => '&#165;',
176
+ 'COP' => '&#36;',
177
+ 'CRC' => '&#8353;',
178
+ 'CUP' => '&#8396;',
179
+ 'CVE' => '&#36;', // ?
180
+ 'CZK' => '&#75;&#269;',
181
+ 'DJF' => '&#70;&#100;&#106;', // ?
182
+ 'DKK' => '&#107;&#114;',
183
+ 'DOP' => '&#82;&#68;&#36;',
184
+ 'DZD' => '&#1583;&#1580;', // ?
185
+ 'EGP' => '&#163;',
186
+ 'ETB' => '&#66;&#114;',
187
+ 'EUR' => '&#8364;',
188
+ 'FJD' => '&#36;',
189
+ 'FKP' => '&#163;',
190
+ 'GBP' => '&#163;',
191
+ 'GEL' => '&#4314;', // ?
192
+ 'GHS' => '&#162;',
193
+ 'GIP' => '&#163;',
194
+ 'GMD' => '&#68;', // ?
195
+ 'GNF' => '&#70;&#71;', // ?
196
+ 'GTQ' => '&#81;',
197
+ 'GYD' => '&#36;',
198
+ 'HKD' => '&#36;',
199
+ 'HNL' => '&#76;',
200
+ 'HRK' => '&#107;&#110;',
201
+ 'HTG' => '&#71;', // ?
202
+ 'HUF' => '&#70;&#116;',
203
+ 'IDR' => '&#82;&#112;',
204
+ 'ILS' => '&#8362;',
205
+ 'INR' => '&#8377;',
206
+ 'IQD' => '&#1593;.&#1583;', // ?
207
+ 'IRR' => '&#65020;',
208
+ 'ISK' => '&#107;&#114;',
209
+ 'JEP' => '&#163;',
210
+ 'JMD' => '&#74;&#36;',
211
+ 'JOD' => '&#74;&#68;', // ?
212
+ 'JPY' => '&#165;',
213
+ 'KES' => '&#75;&#83;&#104;', // ?
214
+ 'KGS' => '&#1083;&#1074;',
215
+ 'KHR' => '&#6107;',
216
+ 'KMF' => '&#67;&#70;', // ?
217
+ 'KPW' => '&#8361;',
218
+ 'KRW' => '&#8361;',
219
+ 'KWD' => '&#1583;.&#1603;', // ?
220
+ 'KYD' => '&#36;',
221
+ 'KZT' => '&#1083;&#1074;',
222
+ 'LAK' => '&#8365;',
223
+ 'LBP' => '&#163;',
224
+ 'LKR' => '&#8360;',
225
+ 'LRD' => '&#36;',
226
+ 'LSL' => '&#76;', // ?
227
+ 'LTL' => '&#76;&#116;',
228
+ 'LVL' => '&#76;&#115;',
229
+ 'LYD' => '&#1604;.&#1583;', // ?
230
+ 'MAD' => '&#1583;.&#1605;.', //?
231
+ 'MDL' => '&#76;',
232
+ 'MGA' => '&#65;&#114;', // ?
233
+ 'MKD' => '&#1076;&#1077;&#1085;',
234
+ 'MMK' => '&#75;',
235
+ 'MNT' => '&#8366;',
236
+ 'MOP' => '&#77;&#79;&#80;&#36;', // ?
237
+ 'MRO' => '&#85;&#77;', // ?
238
+ 'MUR' => '&#8360;', // ?
239
+ 'MVR' => '.&#1923;', // ?
240
+ 'MWK' => '&#77;&#75;',
241
+ 'MXN' => '&#36;',
242
+ 'MYR' => '&#82;&#77;',
243
+ 'MZN' => '&#77;&#84;',
244
+ 'NAD' => '&#36;',
245
+ 'NGN' => '&#8358;',
246
+ 'NIO' => '&#67;&#36;',
247
+ 'NOK' => '&#107;&#114;',
248
+ 'NPR' => '&#8360;',
249
+ 'NZD' => '&#36;',
250
+ 'OMR' => '&#65020;',
251
+ 'PAB' => '&#66;&#47;&#46;',
252
+ 'PEN' => '&#83;&#47;&#46;',
253
+ 'PGK' => '&#75;', // ?
254
+ 'PHP' => '&#8369;',
255
+ 'PKR' => '&#8360;',
256
+ 'PLN' => '&#122;&#322;',
257
+ 'PYG' => '&#71;&#115;',
258
+ 'QAR' => '&#65020;',
259
+ 'RON' => '&#108;&#101;&#105;',
260
+ 'RSD' => '&#1044;&#1080;&#1085;&#46;',
261
+ 'RUB' => '&#1088;&#1091;&#1073;',
262
+ 'RWF' => '&#1585;.&#1587;',
263
+ 'SAR' => '&#65020;',
264
+ 'SBD' => '&#36;',
265
+ 'SCR' => '&#8360;',
266
+ 'SDG' => '&#163;', // ?
267
+ 'SEK' => '&#107;&#114;',
268
+ 'SGD' => '&#36;',
269
+ 'SHP' => '&#163;',
270
+ 'SLL' => '&#76;&#101;', // ?
271
+ 'SOS' => '&#83;',
272
+ 'SRD' => '&#36;',
273
+ 'STD' => '&#68;&#98;', // ?
274
+ 'SVC' => '&#36;',
275
+ 'SYP' => '&#163;',
276
+ 'SZL' => '&#76;', // ?
277
+ 'THB' => '&#3647;',
278
+ 'TJS' => '&#84;&#74;&#83;', // ? TJS (guess)
279
+ 'TMT' => '&#109;',
280
+ 'TND' => '&#1583;.&#1578;',
281
+ 'TOP' => '&#84;&#36;',
282
+ 'TRY' => '&#8356;', // New Turkey Lira (old symbol used)
283
+ 'TTD' => '&#36;',
284
+ 'TWD' => '&#78;&#84;&#36;',
285
+ 'TZS' => '',
286
+ 'UAH' => '&#8372;',
287
+ 'UGX' => '&#85;&#83;&#104;',
288
+ 'USD' => '&#36;',
289
+ 'UYU' => '&#36;&#85;',
290
+ 'UZS' => '&#1083;&#1074;',
291
+ 'VEF' => '&#66;&#115;',
292
+ 'VND' => '&#8363;',
293
+ 'VUV' => '&#86;&#84;',
294
+ 'WST' => '&#87;&#83;&#36;',
295
+ 'XAF' => '&#70;&#67;&#70;&#65;',
296
+ 'XCD' => '&#36;',
297
+ 'XDR' => '',
298
+ 'XOF' => '',
299
+ 'XPF' => '&#70;',
300
+ 'YER' => '&#65020;',
301
+ 'ZAR' => '&#82;',
302
+ 'ZMK' => '&#90;&#75;', // ?
303
+ 'ZWL' => '&#90;&#36;',
304
+ );
305
+
306
+ if( !empty( $currency_symbols[$currency_code] ) )
307
+ return $currency_symbols[$currency_code];
308
+ else
309
+ return '';
310
+
311
+ }
wordpress-creation-kit-api/fields/colorpicker.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @param string $meta Meta name.
3
+ * @param array $details Contains the details for the field.
4
+ * @param string $value Contains input value;
5
+ * @param string $context Context where the function is used. Depending on it some actions are preformed.;
6
+ * @return string $element input element html string. */
7
+
8
+ $element .= '<input type="text" name="'. $single_prefix . esc_attr( Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ) ) .'" id="';
9
+ if( !empty( $frontend_prefix ) )
10
+ $element .= $frontend_prefix;
11
+ $element .= esc_attr( Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ) ) .'" value="'. ( ! empty( $value ) ? esc_attr( $value ) : esc_attr( $details['default'] ) ) .'" data-default-color="'. ( ! empty( $details['default'] ) ? esc_attr( $details['default'] ) : '' ) .'" class="mb-colorpicker mb-field"/>';
12
+ $element .= '<script type="text/javascript">
13
+ jQuery( document ).ready( function( $ ) {
14
+ $( ".mb-colorpicker" ).iris( {} );
15
+
16
+ $( document ).click( function( e ) {
17
+ if( ! $( e.target ).is( ".mb-colorpicker, .iris-picker, .iris-picker-inner, .iris-slider, .iris-slider-offset, .iris-square-handle, .iris-square-value" ) ) {
18
+ $( ".mb-colorpicker" ).iris( "hide" );
19
+ }
20
+ } );
21
+
22
+ $( ".mb-colorpicker" ).click( function( event ) {
23
+ $( ".mb-colorpicker" ).iris( "hide" );
24
+ $( this ).iris( "show" );
25
+ } );
26
+ } );
27
+ </script>';
28
+ ?>
wordpress-creation-kit-api/fields/currency select.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @param string $meta Meta name.
3
+ * @param array $details Contains the details for the field.
4
+ * @param string $value Contains input value;
5
+ * @param string $context Context where the function is used. Depending on it some actions are preformed.;
6
+ * @return string $element input element html string. */
7
+
8
+ require_once( plugin_dir_path(__FILE__) . '../assets/currency/currency-select.php' );
9
+
10
+ $currencies = wck_get_currencies();
11
+
12
+ $element .= '<select name="'. $single_prefix . esc_attr( Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ) ) .'" id="';
13
+ if( !empty( $frontend_prefix ) )
14
+ $element .= $frontend_prefix;
15
+ $element .= esc_attr( Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ) ) .'" class="mb-currency-select mb-field" >';
16
+ $element .= '<option value="">'. __('...Choose', 'wck') .'</option>';
17
+ if( !empty( $currencies ) ){
18
+ foreach( $currencies as $currency_code => $currency_name ){
19
+ $currency_symbol = wck_get_currency_symbol( $currency_code );
20
+
21
+ $currency_name = ( empty( $currency_symbol ) ? $currency_name : $currency_name . ' (' . $currency_symbol . ')' );
22
+
23
+ $element .= '<option value="'. esc_attr( $currency_code ) .'" '. selected( $currency_code, $value, false ) .' >'. esc_html( $currency_name ) .'</option>';
24
+ }
25
+ }
26
+ $element .= '</select>';
27
+ ?>
wordpress-creation-kit-api/fields/heading.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @param string $meta Meta name.
3
+ * @param array $details Contains the details for the field.
4
+ * @param string $value Contains input value;
5
+ * @param string $context Context where the function is used. Depending on it some actions are preformed.;
6
+ * @return string $element input element html string. */
7
+
8
+ $item_title = esc_attr( $details['title'] );
9
+ $element .= '<h3>' . $item_title . '</h3>';
10
+ ?>
wordpress-creation-kit-api/fields/textarea.php CHANGED
@@ -4,9 +4,16 @@
4
  * @param string $value Contains input value;
5
  * @param string $context Context where the function is used. Depending on it some actions are preformed.;
6
  * @return string $element input element html string. */
7
-
8
- $element .= '<textarea name="'. $single_prefix . esc_attr( Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ) ) .'" id="';
 
 
 
 
9
  if( !empty( $frontend_prefix ) )
10
  $element .= $frontend_prefix;
11
- $element .= esc_attr( Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ) ) .'" style="vertical-align:top;" class="mb-textarea mb-field">'. esc_html( $value ) .'</textarea>';
 
 
 
12
  ?>
4
  * @param string $value Contains input value;
5
  * @param string $context Context where the function is used. Depending on it some actions are preformed.;
6
  * @return string $element input element html string. */
7
+
8
+ $number_of_rows = 5;
9
+ if( !empty( $details['number_of_rows'] ) && is_numeric( trim( $details['number_of_rows'] ) ) )
10
+ $number_of_rows = trim( $details['number_of_rows'] );
11
+
12
+ $element .= '<textarea name="'. $single_prefix . esc_attr( Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ) ) .'" rows="'. esc_attr( $number_of_rows ) .'" id="';
13
  if( !empty( $frontend_prefix ) )
14
  $element .= $frontend_prefix;
15
+ $element .= esc_attr( Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ) ) .'" style="vertical-align:top;" class="mb-textarea mb-field"';
16
+ if( !empty( $details['readonly'] ) && $details['readonly'] == true )
17
+ $element .= ' readonly';
18
+ $element .= '>'. esc_html( $value ) .'</textarea>';
19
  ?>
wordpress-creation-kit-api/wck-fep/wck-fep.css CHANGED
@@ -373,11 +373,19 @@
373
  }
374
 
375
  .fep-container .fep-element-wrap, .fep-container .fep-single-element-wrap{
376
- overflow:hidden;
377
  clear:both;
378
  margin-bottom:13px;
379
  }
380
 
 
 
 
 
 
 
 
 
 
381
  .fep-container .description{
382
  font-size:90%;
383
  font-style:italic;
373
  }
374
 
375
  .fep-container .fep-element-wrap, .fep-container .fep-single-element-wrap{
 
376
  clear:both;
377
  margin-bottom:13px;
378
  }
379
 
380
+ .fep-container .fep-element-wrap:after,
381
+ .fep-container .fep-single-element-wrap:after {
382
+ content: ".";
383
+ visibility: hidden;
384
+ display: block;
385
+ height: 0;
386
+ clear: both;
387
+ }
388
+
389
  .fep-container .description{
390
  font-size:90%;
391
  font-style:italic;
wordpress-creation-kit-api/wck-fep/wck-fep.php CHANGED
@@ -78,7 +78,13 @@ class WCK_FrontEnd_Posting extends Wordpress_Creation_Kit{
78
  //datepicker
79
  wp_enqueue_script('jquery-ui-datepicker');
80
  wp_enqueue_style('jquery-style', plugins_url( '', dirname(__FILE__) ).'/assets/datepicker/datepicker.css');
81
-
 
 
 
 
 
 
82
  /* FEP script */
83
  wp_register_script( 'wck-fep', plugins_url('wck-fep.js', __FILE__ ), array('jquery'), '1.0', true );
84
  wp_register_style( 'wck-fep-css', plugins_url('wck-fep.css', __FILE__ ) );
78
  //datepicker
79
  wp_enqueue_script('jquery-ui-datepicker');
80
  wp_enqueue_style('jquery-style', plugins_url( '', dirname(__FILE__) ).'/assets/datepicker/datepicker.css');
81
+
82
+ //colorpicker
83
+ wp_enqueue_style( 'wp-color-picker' );
84
+ wp_enqueue_style( 'wck-colorpicker-style', plugins_url( '', dirname(__FILE__) ).'/assets/colorpicker/colorpicker.css', false, '1.0' );
85
+ wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
86
+ wp_enqueue_script( 'wp-color-picker', admin_url( 'js/color-picker.min.js' ), array( 'iris' ), false, 1 );
87
+
88
  /* FEP script */
89
  wp_register_script( 'wck-fep', plugins_url('wck-fep.js', __FILE__ ), array('jquery'), '1.0', true );
90
  wp_register_style( 'wck-fep-css', plugins_url('wck-fep.css', __FILE__ ) );
wordpress-creation-kit-api/wordpress-creation-kit.css CHANGED
@@ -124,7 +124,6 @@ td.wck-number{
124
  .mb-textarea{
125
  width:60%;
126
  max-width:600px;
127
- height:130px;
128
  }
129
  .mb-text-input{
130
  width:40%;
124
  .mb-textarea{
125
  width:60%;
126
  max-width:600px;
 
127
  }
128
  .mb-text-input{
129
  width:40%;
wordpress-creation-kit-api/wordpress-creation-kit.php CHANGED
@@ -280,41 +280,52 @@ class Wordpress_Creation_Kit{
280
  else
281
  $single_prefix = '';
282
 
283
- $element .= '<label for="'. $single_prefix . esc_attr( Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ) ) .'" class="field-label">'. apply_filters( "wck_label_{$meta}_". Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ), ucfirst($details['title']) ) .':';
284
- if( !empty( $details['required'] ) && $details['required'] )
285
- $element .= '<span class="required">*</span>';
286
- $element .= '</label>';
287
-
288
- $element .= '<div class="mb-right-column">';
289
-
290
- /*
291
- include actual field type
292
- possible field types: text, textarea, select, checkbox, radio, upload, wysiwyg editor, datepicker, country select, user select, cpt select
293
- */
294
-
295
- if( function_exists( 'wck_nr_get_repeater_boxes' ) ){
296
- $cfc_titles = wck_nr_get_repeater_boxes();
297
- if( in_array( $details['type'], $cfc_titles ) ){
298
- $details['type'] = 'nested repeater';
299
  }
300
  }
301
-
302
-
303
- if( file_exists( dirname( __FILE__ ).'/fields/'.$details['type'].'.php' ) ){
304
- require( dirname( __FILE__ ).'/fields/'.$details['type'].'.php' );
305
- }
306
-
307
- if( !empty( $details['description'] ) ){
308
- $element .= '<p class="description">'. $details['description'].'</p>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  }
310
-
311
- $element .= '</div><!-- .mb-right-column -->';
312
 
313
  $element = apply_filters( "wck_output_form_field", $element, $meta, $details);
314
  $element = apply_filters( "wck_output_form_field_{$meta}_" . Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ), $element );
315
 
316
  return $element;
317
-
318
  }
319
 
320
 
@@ -552,9 +563,9 @@ class Wordpress_Creation_Kit{
552
  /*check for nested repeater type and set it acordingly */
553
  if( strpos( $details['type'], 'CFC-') === 0 )
554
  $details['type'] = 'nested-repeater';
555
-
556
- $list .= '<li class="row-'. esc_attr( Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ) ) .'" data-type="'.$details['type'].'"><strong>'.$details['title'].': </strong>'.$display_value.' </li>';
557
-
558
  $list = apply_filters( "wck_after_listed_{$meta}_element_{$j}", $list, $element_id, $value );
559
 
560
  $j++;
@@ -714,6 +725,14 @@ class Wordpress_Creation_Kit{
714
  wp_enqueue_script('jquery-ui-datepicker');
715
  wp_enqueue_style( 'jquery-style', plugins_url( '/assets/datepicker/datepicker.css', __FILE__ ) );
716
  }
 
 
 
 
 
 
 
 
717
 
718
  /* media upload */
719
  wp_enqueue_media();
280
  else
281
  $single_prefix = '';
282
 
283
+ if( $details['type'] !== 'heading' ) {
284
+ $element .= '<label for="'. $single_prefix . esc_attr( Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ) ) .'" class="field-label">'. apply_filters( "wck_label_{$meta}_". Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ), ucfirst($details['title']) ) .':';
285
+ if( !empty( $details['required'] ) && $details['required'] )
286
+ $element .= '<span class="required">*</span>';
287
+ $element .= '</label>';
288
+ } elseif( $details['type'] === 'heading' ) {
289
+ if( file_exists( dirname( __FILE__ ) . '/fields/heading.php' ) ) {
290
+ require( dirname( __FILE__ ) . '/fields/heading.php' );
291
+ }
292
+
293
+ if( !empty( $details['description'] ) ){
294
+ $element .= '<p class="description">'. $details['description'].'</p>';
 
 
 
 
295
  }
296
  }
297
+
298
+ if( $details['type'] !== 'heading' ) {
299
+ $element .= '<div class="mb-right-column">';
300
+
301
+ /*
302
+ include actual field type
303
+ possible field types: heading, text, textarea, select, checkbox, radio, upload, wysiwyg editor, datepicker, colorpicker, country select, user select, cpt select
304
+ */
305
+
306
+ if( function_exists( 'wck_nr_get_repeater_boxes' ) ) {
307
+ $cfc_titles = wck_nr_get_repeater_boxes();
308
+ if( in_array( $details['type'], $cfc_titles ) ) {
309
+ $details['type'] = 'nested repeater';
310
+ }
311
+ }
312
+
313
+ if( file_exists( dirname( __FILE__ ) . '/fields/' . $details['type'] . '.php' ) ) {
314
+ require( dirname( __FILE__ ) . '/fields/' . $details['type'] . '.php' );
315
+ }
316
+
317
+ if( ! empty( $details['description'] ) ) {
318
+ $element .= '<p class="description">' . $details['description'] . '</p>';
319
+ }
320
+
321
+ $element .= '</div><!-- .mb-right-column -->';
322
  }
 
 
323
 
324
  $element = apply_filters( "wck_output_form_field", $element, $meta, $details);
325
  $element = apply_filters( "wck_output_form_field_{$meta}_" . Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ), $element );
326
 
327
  return $element;
328
+
329
  }
330
 
331
 
563
  /*check for nested repeater type and set it acordingly */
564
  if( strpos( $details['type'], 'CFC-') === 0 )
565
  $details['type'] = 'nested-repeater';
566
+
567
+ $list .= '<li class="row-'. esc_attr( Wordpress_Creation_Kit::wck_generate_slug( $details['title'], $details ) ) .'" data-type="'. $details['type'] .'"><strong>'. $details['title'] . ( $details['type'] != 'heading' ? ':' : '' ) .' </strong>'. $display_value .' </li>';
568
+
569
  $list = apply_filters( "wck_after_listed_{$meta}_element_{$j}", $list, $element_id, $value );
570
 
571
  $j++;
725
  wp_enqueue_script('jquery-ui-datepicker');
726
  wp_enqueue_style( 'jquery-style', plugins_url( '/assets/datepicker/datepicker.css', __FILE__ ) );
727
  }
728
+
729
+ //colorpicker
730
+ if ( file_exists( WCK_PLUGIN_DIR. '/wordpress-creation-kit-api/fields/colorpicker.php' ) ){
731
+ wp_enqueue_style( 'wp-color-picker' );
732
+ wp_enqueue_style( 'wck-colorpicker-style', plugins_url( '/assets/colorpicker/colorpicker.css', __FILE__ ), false, '1.0' );
733
+ wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
734
+ wp_enqueue_script( 'wp-color-picker', admin_url( 'js/color-picker.min.js' ), array( 'iris' ), false, 1 );
735
+ }
736
 
737
  /* media upload */
738
  wp_enqueue_media();