Kiwi Social Share – Social Media Share Buttons & Icons - Version 2.1.5

Version Description

  • CMB2 is no longer used for metaboxes. Custom system is implemented
Download this release

Release Info

Developer wpkube
Plugin Icon wp plugin Kiwi Social Share – Social Media Share Buttons & Icons
Version 2.1.5
Comparing to
See all releases

Code changes from version 2.1.4 to 2.1.5

Files changed (101) hide show
  1. assets/css/metabox.css +128 -0
  2. assets/css/metabox.min.css +1 -0
  3. {includes/lib/cmb2/images → assets/img}/ico-delete.png +0 -0
  4. assets/js/metabox.js +124 -0
  5. assets/js/metabox.min.js +1 -0
  6. includes/class-kiwi-social-share-autoloader.php +87 -89
  7. includes/class-kiwi-social-share.php +385 -354
  8. includes/frontend/social-bars/class-kiwi-social-share-view-shortcode-bar.php +78 -76
  9. includes/lib/class-kiwi-social-share-metaboxes.php +333 -132
  10. includes/lib/class-kiwi-social-share-shortcodes.php +480 -236
  11. includes/lib/cmb2/CHANGELOG.md +0 -863
  12. includes/lib/cmb2/CODE_OF_CONDUCT.md +0 -76
  13. includes/lib/cmb2/CONTRIBUTING.md +0 -60
  14. includes/lib/cmb2/LICENSE +0 -674
  15. includes/lib/cmb2/bootstrap.php +0 -84
  16. includes/lib/cmb2/css/cmb2-display-rtl.css +0 -45
  17. includes/lib/cmb2/css/cmb2-display-rtl.min.css +0 -1
  18. includes/lib/cmb2/css/cmb2-display.css +0 -45
  19. includes/lib/cmb2/css/cmb2-display.css.map +0 -7
  20. includes/lib/cmb2/css/cmb2-display.min.css +0 -1
  21. includes/lib/cmb2/css/cmb2-front-rtl.css +0 -1373
  22. includes/lib/cmb2/css/cmb2-front-rtl.min.css +0 -1
  23. includes/lib/cmb2/css/cmb2-front.css +0 -1373
  24. includes/lib/cmb2/css/cmb2-front.min.css +0 -1
  25. includes/lib/cmb2/css/cmb2-rtl.css +0 -1576
  26. includes/lib/cmb2/css/cmb2-rtl.min.css +0 -1
  27. includes/lib/cmb2/css/cmb2.css +0 -1576
  28. includes/lib/cmb2/css/cmb2.min.css +0 -1
  29. includes/lib/cmb2/css/index.php +0 -2
  30. includes/lib/cmb2/images/index.php +0 -2
  31. includes/lib/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  32. includes/lib/cmb2/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  33. includes/lib/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  34. includes/lib/cmb2/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  35. includes/lib/cmb2/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  36. includes/lib/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  37. includes/lib/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  38. includes/lib/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  39. includes/lib/cmb2/images/ui-icons_222222_256x240.png +0 -0
  40. includes/lib/cmb2/images/ui-icons_2e83ff_256x240.png +0 -0
  41. includes/lib/cmb2/images/ui-icons_454545_256x240.png +0 -0
  42. includes/lib/cmb2/images/ui-icons_888888_256x240.png +0 -0
  43. includes/lib/cmb2/images/ui-icons_cd0a0a_256x240.png +0 -0
  44. includes/lib/cmb2/includes/CMB2.php +0 -1817
  45. includes/lib/cmb2/includes/CMB2_Ajax.php +0 -323
  46. includes/lib/cmb2/includes/CMB2_Base.php +0 -534
  47. includes/lib/cmb2/includes/CMB2_Boxes.php +0 -139
  48. includes/lib/cmb2/includes/CMB2_Field.php +0 -1644
  49. includes/lib/cmb2/includes/CMB2_Field_Display.php +0 -505
  50. includes/lib/cmb2/includes/CMB2_Hookup_Base.php +0 -105
  51. includes/lib/cmb2/includes/CMB2_JS.php +0 -257
  52. includes/lib/cmb2/includes/CMB2_Options.php +0 -250
  53. includes/lib/cmb2/includes/CMB2_Options_Hookup.php +0 -372
  54. includes/lib/cmb2/includes/CMB2_Sanitize.php +0 -588
  55. includes/lib/cmb2/includes/CMB2_Show_Filters.php +0 -179
  56. includes/lib/cmb2/includes/CMB2_Types.php +0 -675
  57. includes/lib/cmb2/includes/CMB2_Utils.php +0 -671
  58. includes/lib/cmb2/includes/CMB2_hookup.php +0 -1044
  59. includes/lib/cmb2/includes/helper-functions.php +0 -427
  60. includes/lib/cmb2/includes/index.php +0 -2
  61. includes/lib/cmb2/includes/rest-api/CMB2_REST.php +0 -865
  62. includes/lib/cmb2/includes/rest-api/CMB2_REST_Controller.php +0 -448
  63. includes/lib/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php +0 -270
  64. includes/lib/cmb2/includes/rest-api/CMB2_REST_Controller_Fields.php +0 -534
  65. includes/lib/cmb2/includes/shim/WP_REST_Controller.php +0 -541
  66. includes/lib/cmb2/includes/types/CMB2_Type_Base.php +0 -177
  67. includes/lib/cmb2/includes/types/CMB2_Type_Checkbox.php +0 -74
  68. includes/lib/cmb2/includes/types/CMB2_Type_Colorpicker.php +0 -120
  69. includes/lib/cmb2/includes/types/CMB2_Type_Counter_Base.php +0 -138
  70. includes/lib/cmb2/includes/types/CMB2_Type_File.php +0 -190
  71. includes/lib/cmb2/includes/types/CMB2_Type_File_Base.php +0 -221
  72. includes/lib/cmb2/includes/types/CMB2_Type_File_List.php +0 -86
  73. includes/lib/cmb2/includes/types/CMB2_Type_Multi_Base.php +0 -110
  74. includes/lib/cmb2/includes/types/CMB2_Type_Multicheck.php +0 -39
  75. includes/lib/cmb2/includes/types/CMB2_Type_Oembed.php +0 -41
  76. includes/lib/cmb2/includes/types/CMB2_Type_Picker_Base.php +0 -56
  77. includes/lib/cmb2/includes/types/CMB2_Type_Radio.php +0 -52
  78. includes/lib/cmb2/includes/types/CMB2_Type_Select.php +0 -30
  79. includes/lib/cmb2/includes/types/CMB2_Type_Select_Timezone.php +0 -29
  80. includes/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Base.php +0 -189
  81. includes/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck.php +0 -76
  82. includes/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck_Hierarchical.php +0 -42
  83. includes/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php +0 -92
  84. includes/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Radio_Hierarchical.php +0 -41
  85. includes/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php +0 -102
  86. includes/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Select_Hierarchical.php +0 -73
  87. includes/lib/cmb2/includes/types/CMB2_Type_Text.php +0 -61
  88. includes/lib/cmb2/includes/types/CMB2_Type_Text_Date.php +0 -30
  89. includes/lib/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php +0 -78
  90. includes/lib/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp_Timezone.php +0 -66
  91. includes/lib/cmb2/includes/types/CMB2_Type_Text_Time.php +0 -25
  92. includes/lib/cmb2/includes/types/CMB2_Type_Textarea.php +0 -41
  93. includes/lib/cmb2/includes/types/CMB2_Type_Textarea_Code.php +0 -39
  94. includes/lib/cmb2/includes/types/CMB2_Type_Title.php +0 -47
  95. includes/lib/cmb2/includes/types/CMB2_Type_Wysiwyg.php +0 -103
  96. includes/lib/cmb2/index.php +0 -1
  97. includes/lib/cmb2/init.php +0 -198
  98. includes/lib/cmb2/js/cmb2-char-counter.js +0 -211
  99. includes/lib/cmb2/js/cmb2-wysiwyg.js +0 -345
  100. includes/lib/cmb2/js/cmb2.js +0 -1348
  101. includes/lib/cmb2/js/cmb2.min.js +0 -1
assets/css/metabox.css ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* ==========================================================================
2
+ =Metabox
3
+ ========================================================================== */
4
+ .kiwi-metabox.kss-row {
5
+ display: flex;
6
+ flex-wrap: wrap;
7
+ justify-content: space-between;
8
+ padding: 1.8em 0;
9
+ margin: 0 0 0.8em;
10
+ border-bottom: 1px solid #e9e9e9;
11
+ }
12
+
13
+ .kiwi-metabox.kss-row:last-child {
14
+ border-bottom: 0;
15
+ }
16
+
17
+ .kiwi-metabox .kss-label {
18
+ width: 18%;
19
+ flex-basis: 18%;
20
+ color: #222222;
21
+ font-weight: 600;
22
+ vertical-align: top;
23
+ }
24
+
25
+ .kiwi-metabox .kss-label label {
26
+ display: block;
27
+ padding: 5px 0;
28
+ font-size: 14px;
29
+ }
30
+
31
+ .kiwi-metabox .kss-options {
32
+ flex-basis: 80%;
33
+ width: 80%;
34
+ margin-bottom: 0;
35
+ padding: 0;
36
+ line-height: 1.3;
37
+ }
38
+
39
+ .kiwi-metabox .kss-options li {
40
+ font-size: 14px;
41
+ line-height: 16px;
42
+ }
43
+
44
+ .kiwi-metabox input[type="checkbox"],
45
+ .kiwi-metabox input[type="radio"] {
46
+ margin: 0 5px 0 0;
47
+ padding: 0;
48
+ }
49
+
50
+ .kiwi-metabox ul {
51
+ margin: 0;
52
+ }
53
+
54
+ .kss-checkbox-list > p {
55
+ margin-top: 0;
56
+ }
57
+
58
+ .kiwi-metabox textarea {
59
+ width: 500px;
60
+ padding: 8px;
61
+ max-width: 100%;
62
+ }
63
+
64
+ .kiwi-metabox .kss-upload-file {
65
+ width: 65%;
66
+ }
67
+
68
+ .kiwi-metabox .kss-upload-button {
69
+ margin-left: 20px;
70
+ }
71
+
72
+ .kss-media-status .kss-media-item {
73
+ position: relative;
74
+ clear: none;
75
+ display: inline-block;
76
+ vertical-align: middle;
77
+ margin-right: 10px;
78
+ width: auto;
79
+ }
80
+
81
+ .kss-media-status .kss-media-item img {
82
+ cursor: pointer;
83
+ height: auto;
84
+ background: #eee;
85
+ border: 5px solid #ffffff;
86
+ outline: 1px solid #e9e9e9;
87
+ box-shadow: inset 0 0 15px rgb(0 0 0 / 30%), inset 0 0 0 1px rgb(0 0 0 / 5%);
88
+ background-image: linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%, #d0d0d0), linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%, #d0d0d0);
89
+ background-position: 0 0, 10px 10px;
90
+ background-size: 20px 20px;
91
+ border-radius: 2px;
92
+ margin: 15px 0 0 0;
93
+ }
94
+
95
+ .kss-media-status .kss-media-item .kss-remove-wrapper {
96
+ margin: 0;
97
+ }
98
+
99
+ .kss-media-status .kss-media-item .kss-remove-file-button {
100
+ background: url(../img/ico-delete.png);
101
+ height: 16px;
102
+ left: -5px;
103
+ position: absolute;
104
+ text-indent: -9999px;
105
+ top: 10px;
106
+ width: 16px;
107
+ }
108
+
109
+ @media screen and (max-width: 480px) {
110
+ .kiwi-metabox.kss-row {
111
+ display: block;
112
+ }
113
+
114
+ .kiwi-metabox .kss-label,
115
+ .kiwi-metabox .kss-options {
116
+ width: 100%;
117
+ flex-basis: 100%;
118
+ }
119
+
120
+ .kiwi-metabox .kss-upload-file {
121
+ width: 100%;
122
+ }
123
+
124
+ .kiwi-metabox .kss-upload-button {
125
+ margin-left: 0;
126
+ margin-top: 10px;
127
+ }
128
+ }
assets/css/metabox.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .kiwi-metabox.kss-row{display:flex;flex-wrap:wrap;justify-content:space-between;padding:1.8em 0;margin:0 0 .8em;border-bottom:1px solid #e9e9e9}.kiwi-metabox.kss-row:last-child{border-bottom:0}.kiwi-metabox .kss-label{width:18%;flex-basis:18%;color:#222;font-weight:600;vertical-align:top}.kiwi-metabox .kss-label label{display:block;padding:5px 0;font-size:14px}.kiwi-metabox .kss-options{flex-basis:80%;width:80%;margin-bottom:0;padding:0;line-height:1.3}.kiwi-metabox .kss-options li{font-size:14px;line-height:16px}.kiwi-metabox input[type=checkbox],.kiwi-metabox input[type=radio]{margin:0 5px 0 0;padding:0}.kiwi-metabox ul{margin:0}.kss-checkbox-list>p{margin-top:0}.kiwi-metabox textarea{width:500px;padding:8px;max-width:100%}.kiwi-metabox .kss-upload-file{width:65%}.kiwi-metabox .kss-upload-button{margin-left:20px}.kss-media-status .kss-media-item{position:relative;clear:none;display:inline-block;vertical-align:middle;margin-right:10px;width:auto}.kss-media-status .kss-media-item img{cursor:pointer;height:auto;background:#eee;border:5px solid #fff;outline:1px solid #e9e9e9;box-shadow:inset 0 0 15px rgb(0 0 0 / 30%),inset 0 0 0 1px rgb(0 0 0 / 5%);background-image:linear-gradient(45deg,#d0d0d0 25%,transparent 25%,transparent 75%,#d0d0d0 75%,#d0d0d0),linear-gradient(45deg,#d0d0d0 25%,transparent 25%,transparent 75%,#d0d0d0 75%,#d0d0d0);background-position:0 0,10px 10px;background-size:20px 20px;border-radius:2px;margin:15px 0 0 0}.kss-media-status .kss-media-item .kss-remove-wrapper{margin:0}.kss-media-status .kss-media-item .kss-remove-file-button{background:url(../img/ico-delete.png);height:16px;left:-5px;position:absolute;text-indent:-9999px;top:10px;width:16px}@media screen and (max-width:480px){.kiwi-metabox.kss-row{display:block}.kiwi-metabox .kss-label,.kiwi-metabox .kss-options{width:100%;flex-basis:100%}.kiwi-metabox .kss-upload-file{width:100%}.kiwi-metabox .kss-upload-button{margin-left:0;margin-top:10px}}
{includes/lib/cmb2/images → assets/img}/ico-delete.png RENAMED
File without changes
assets/js/metabox.js ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (
2
+ function( $ ) {
3
+
4
+ // Select / Deselect All toggle in the metabox.
5
+ function kiwiSocialShareSelectToggle() {
6
+ let toggleButton = $( '.kss-checkbox-list' ).find( '.kss-multicheck-toggle' );
7
+
8
+ $( toggleButton ).on( 'click', function() {
9
+ let checkBoxes = $( this ).parent( '.kss-toggle-wrapper' );
10
+ let checked = checkBoxes.parent( 'ul' ).find( '.kss-multicheck' );
11
+
12
+ // If the button has already been clicked once.
13
+ if ( toggleButton.data( 'checked' ) ) {
14
+ // Clear the checkboxes and remove the flag.
15
+ checked.prop( 'checked', false );
16
+ toggleButton.data( 'checked', false );
17
+ } else {
18
+ // Otherwise mark the checkboxes and add a flag.
19
+ checked.prop( 'checked', true );
20
+ toggleButton.data( 'checked', true );
21
+ }
22
+ } );
23
+ }
24
+
25
+ kiwiSocialShareSelectToggle();
26
+
27
+ // Media image upload/select in the metabox.
28
+ function kiwiSocialShareMediaUpload() {
29
+ let file_frame;
30
+
31
+ $( document.body ).on(
32
+ 'click',
33
+ '.kss-upload-button, .kss-media-item img',
34
+ function( event ) {
35
+ event.preventDefault();
36
+
37
+ let element = $( this );
38
+ let file_target_preview = element.closest( '.kss-options' ).find( '.kss-file-field-image' );
39
+ let file_target_input = element.closest( '.kss-options' ).find( '.kss-upload-file' );
40
+ let empty_file_target = element.closest( '.kss-options' ).find( '.kss-media-status' );
41
+ let file_target_input_id = element.closest( '.kss-options' ).find( '.kss-upload-file-id' );
42
+
43
+ file_frame = wp.media.frames.media_file = wp.media(
44
+ {
45
+ title : kiwiMediaSelects.choose,
46
+ button : {
47
+ text : kiwiMediaSelects.update,
48
+ },
49
+ states : [
50
+ new wp.media.controller.Library(
51
+ {
52
+ title : kiwiMediaSelects.choose,
53
+ library : wp.media.query(
54
+ {
55
+ type : 'image'
56
+ }
57
+ )
58
+ }
59
+ )
60
+ ]
61
+ }
62
+ );
63
+
64
+ file_frame.on(
65
+ 'select',
66
+ function () {
67
+ let attachment = file_frame.state().get( 'selection' ).first().toJSON();
68
+
69
+ file_target_preview.attr( 'src', attachment.url );
70
+ file_target_input.val( attachment.url );
71
+ file_target_input_id.val( attachment.id );
72
+
73
+ if (
74
+ file_target_input.length !== 0
75
+ && file_target_preview.length === 0
76
+ ) {
77
+ empty_file_target.append(
78
+ '<div class="kss-media-item">' +
79
+ '<img style="max-width: 350px; width: 100%;" src="' + attachment.url + '" class="kss-file-field-image" alt="" />' +
80
+
81
+ '<p class="kss-remove-wrapper">' +
82
+ '<a href="#" class="kss-remove-file-button">' +
83
+ kiwiMediaSelects.delete +
84
+ '</a>' +
85
+ '</p>' +
86
+ '</div>'
87
+ );
88
+ }
89
+ }
90
+ );
91
+
92
+ file_frame.open();
93
+ }
94
+ );
95
+ }
96
+
97
+ kiwiSocialShareMediaUpload();
98
+
99
+ // Media image remove from the metabox.
100
+ function kiwiSocialShareMediaRemove() {
101
+ $( document.body ).on(
102
+ 'click',
103
+ '.kss-remove-file-button',
104
+ function( event ) {
105
+ event.preventDefault();
106
+
107
+ let element = $( this );
108
+ let file_target_preview = element.closest( '.kss-options' ).find( '.kss-media-item' );
109
+ let file_target_input = element.closest( '.kss-options' ).find( '.kss-upload-file' );
110
+ let file_target_input_id = element.closest( '.kss-options' ).find( '.kss-upload-file-id' );
111
+
112
+ if ( file_target_input ) {
113
+ file_target_input.val('');
114
+ file_target_preview.remove();
115
+ file_target_input_id.val('');
116
+ }
117
+ }
118
+ );
119
+ }
120
+
121
+ kiwiSocialShareMediaRemove();
122
+
123
+ }
124
+ )( jQuery );
assets/js/metabox.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){!function(){let s=e(".kss-checkbox-list").find(".kss-multicheck-toggle");e(s).on("click",function(){let t=e(this).parent(".kss-toggle-wrapper").parent("ul").find(".kss-multicheck");s.data("checked")?(t.prop("checked",!1),s.data("checked",!1)):(t.prop("checked",!0),s.data("checked",!0))})}(),function(){let s;e(document.body).on("click",".kss-upload-button, .kss-media-item img",function(t){t.preventDefault();let i=e(this),l=i.closest(".kss-options").find(".kss-file-field-image"),o=i.closest(".kss-options").find(".kss-upload-file"),a=i.closest(".kss-options").find(".kss-media-status"),c=i.closest(".kss-options").find(".kss-upload-file-id");(s=wp.media.frames.media_file=wp.media({title:kiwiMediaSelects.choose,button:{text:kiwiMediaSelects.update},states:[new wp.media.controller.Library({title:kiwiMediaSelects.choose,library:wp.media.query({type:"image"})})]})).on("select",function(){let e=s.state().get("selection").first().toJSON();l.attr("src",e.url),o.val(e.url),c.val(e.id),0!==o.length&&0===l.length&&a.append('<div class="kss-media-item"><img style="max-width: 350px; width: 100%;" src="'+e.url+'" class="kss-file-field-image" alt="" /><p class="kss-remove-wrapper"><a href="#" class="kss-remove-file-button">'+kiwiMediaSelects.delete+"</a></p></div>")}),s.open()})}(),e(document.body).on("click",".kss-remove-file-button",function(s){s.preventDefault();let t=e(this),i=t.closest(".kss-options").find(".kss-media-item"),l=t.closest(".kss-options").find(".kss-upload-file"),o=t.closest(".kss-options").find(".kss-upload-file-id");l&&(l.val(""),i.remove(),o.val(""))})}(jQuery);
includes/class-kiwi-social-share-autoloader.php CHANGED
@@ -1,89 +1,87 @@
1
- <?php
2
- if ( ! defined( 'WPINC' ) ) {
3
- die;
4
- }
5
-
6
- /**
7
- * Class Kiwi_Social_Share_Autoloader
8
- */
9
- class Kiwi_Social_Share_Autoloader {
10
- /**
11
- * Kiwi_Social_Share_Autoloader constructor.
12
- */
13
- public function __construct() {
14
- spl_autoload_register( array( $this, 'load' ) );
15
- }
16
-
17
- /**
18
- * @param $class
19
- */
20
- public function load( $class ) {
21
- /**
22
- * All classes are prefixed with Kiwi_
23
- */
24
- $parts = explode( '_', $class );
25
- $bind = implode( '-', $parts );
26
-
27
- if ( $parts[0] == 'Kiwi' ) {
28
- /**
29
- * Load interfaces
30
- */
31
- if ( in_array( 'Interface', $parts ) && isset( $parts[2] ) ) {
32
- $path = KIWI_SOCIAL_SHARE_BASE . 'includes/interface/class-' . strtolower( $bind ) . '.php';
33
-
34
- if ( file_exists( $path ) ) {
35
- require_once $path;
36
- }
37
- }
38
-
39
- /**
40
- * Load Views
41
- */
42
- if ( in_array( 'View', $parts ) && isset( $parts[2] ) ) {
43
- $path = KIWI_SOCIAL_SHARE_BASE . 'includes/frontend/social-bars/class-' . strtolower( $bind ) . '.php';
44
-
45
- if ( file_exists( $path ) ) {
46
- require_once $path;
47
- }
48
- }
49
-
50
- /**
51
- * Load Buttons
52
- */
53
- if ( in_array( 'Button', $parts ) && isset( $parts[2] ) ) {
54
- $path = KIWI_SOCIAL_SHARE_BASE . 'includes/frontend/social-buttons/class-' . strtolower( $bind ) . '.php';
55
-
56
- if ( file_exists( $path ) ) {
57
- require_once $path;
58
- }
59
- }
60
-
61
- /**
62
- * Load Buttons
63
- */
64
- if ( in_array( 'Helper', $parts ) && ! in_array( 'EDD', $parts ) && isset( $parts[2] ) ) {
65
- $path = KIWI_SOCIAL_SHARE_BASE . 'includes/lib/helpers/class-' . strtolower( $bind ) . '.php';
66
-
67
- if ( file_exists( $path ) ) {
68
- require_once $path;
69
- }
70
- }
71
-
72
-
73
- /*
74
- * Core library autoload.
75
- */
76
- if ( isset( $parts[2] ) ) {
77
- $path = KIWI_SOCIAL_SHARE_BASE . 'includes/lib/class-' . strtolower( $bind ) . '.php';
78
-
79
- if ( file_exists( $path ) ) {
80
- require_once $path;
81
- }
82
- }
83
- }
84
- }
85
- }
86
-
87
- $autoloader = new Kiwi_Social_Share_Autoloader();
88
-
89
- require_once KIWI_SOCIAL_SHARE_BASE . 'includes/lib/cmb2/init.php';
1
+ <?php
2
+ if ( ! defined( 'WPINC' ) ) {
3
+ die;
4
+ }
5
+
6
+ /**
7
+ * Class Kiwi_Social_Share_Autoloader
8
+ */
9
+ class Kiwi_Social_Share_Autoloader {
10
+ /**
11
+ * Kiwi_Social_Share_Autoloader constructor.
12
+ */
13
+ public function __construct() {
14
+ spl_autoload_register( array( $this, 'load' ) );
15
+ }
16
+
17
+ /**
18
+ * @param $class
19
+ */
20
+ public function load( $class ) {
21
+ /**
22
+ * All classes are prefixed with Kiwi_
23
+ */
24
+ $parts = explode( '_', $class );
25
+ $bind = implode( '-', $parts );
26
+
27
+ if ( $parts[0] == 'Kiwi' ) {
28
+ /**
29
+ * Load interfaces
30
+ */
31
+ if ( in_array( 'Interface', $parts ) && isset( $parts[2] ) ) {
32
+ $path = KIWI_SOCIAL_SHARE_BASE . 'includes/interface/class-' . strtolower( $bind ) . '.php';
33
+
34
+ if ( file_exists( $path ) ) {
35
+ require_once $path;
36
+ }
37
+ }
38
+
39
+ /**
40
+ * Load Views
41
+ */
42
+ if ( in_array( 'View', $parts ) && isset( $parts[2] ) ) {
43
+ $path = KIWI_SOCIAL_SHARE_BASE . 'includes/frontend/social-bars/class-' . strtolower( $bind ) . '.php';
44
+
45
+ if ( file_exists( $path ) ) {
46
+ require_once $path;
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Load Buttons
52
+ */
53
+ if ( in_array( 'Button', $parts ) && isset( $parts[2] ) ) {
54
+ $path = KIWI_SOCIAL_SHARE_BASE . 'includes/frontend/social-buttons/class-' . strtolower( $bind ) . '.php';
55
+
56
+ if ( file_exists( $path ) ) {
57
+ require_once $path;
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Load Buttons
63
+ */
64
+ if ( in_array( 'Helper', $parts ) && ! in_array( 'EDD', $parts ) && isset( $parts[2] ) ) {
65
+ $path = KIWI_SOCIAL_SHARE_BASE . 'includes/lib/helpers/class-' . strtolower( $bind ) . '.php';
66
+
67
+ if ( file_exists( $path ) ) {
68
+ require_once $path;
69
+ }
70
+ }
71
+
72
+
73
+ /*
74
+ * Core library autoload.
75
+ */
76
+ if ( isset( $parts[2] ) ) {
77
+ $path = KIWI_SOCIAL_SHARE_BASE . 'includes/lib/class-' . strtolower( $bind ) . '.php';
78
+
79
+ if ( file_exists( $path ) ) {
80
+ require_once $path;
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+
87
+ $autoloader = new Kiwi_Social_Share_Autoloader();
 
 
includes/class-kiwi-social-share.php CHANGED
@@ -1,354 +1,385 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
- class Kiwi_Social_Share {
8
-
9
- /**
10
- * The single instance of Kiwi_Social_Share.
11
- *
12
- * @var object
13
- * @access private
14
- * @since 1.0.0
15
- */
16
- private static $_instance = NULL;
17
-
18
- /**
19
- * Settings class object
20
- *
21
- * @var object
22
- * @access public
23
- * @since 1.0.0
24
- */
25
- public $settings = NULL;
26
-
27
- /**
28
- * The version number.
29
- *
30
- * @var string
31
- * @access public
32
- * @since 1.0.0
33
- */
34
- public $_version;
35
-
36
- /**
37
- * The token.
38
- *
39
- * @var string
40
- * @access public
41
- * @since 1.0.0
42
- */
43
- public $_token;
44
-
45
- /**
46
- * The main plugin file.
47
- *
48
- * @var string
49
- * @access public
50
- * @since 1.0.0
51
- */
52
- public $file;
53
-
54
- /**
55
- * The main plugin directory.
56
- *
57
- * @var string
58
- * @access public
59
- * @since 1.0.0
60
- */
61
- public $dir;
62
-
63
- /**
64
- * The plugin assets directory.
65
- *
66
- * @var string
67
- * @access public
68
- * @since 1.0.0
69
- */
70
- public $assets_dir;
71
-
72
- /**
73
- * The plugin assets URL.
74
- *
75
- * @var string
76
- * @access public
77
- * @since 1.0.0
78
- */
79
- public $assets_url;
80
-
81
- /**
82
- * Suffix for Javascripts.
83
- *
84
- * @var string
85
- * @access public
86
- * @since 1.0.0
87
- */
88
- public $script_suffix;
89
-
90
- /**
91
- * Kiwi_Social_Share constructor.
92
- *
93
- * @param string $file
94
- * @param string $version
95
- */
96
- public function __construct( $file = '', $version = '1.0.0' ) {
97
- $this->_version = $version;
98
- $this->_token = 'kiwi_social_sharing';
99
-
100
- // Load plugin environment variables
101
- $this->file = $file;
102
- $this->dir = dirname( $this->file );
103
- $this->assets_dir = trailingslashit( $this->dir ) . 'assets';
104
- $this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $this->file ) ) );
105
-
106
- $this->script_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
107
-
108
-
109
- register_activation_hook( $this->file, array( $this, 'install' ) );
110
-
111
- new Kiwi_Social_Share_Click_To_Tweet();
112
-
113
-
114
-
115
- add_action( 'plugins_loaded', array( $this, 'load_frontend_kiwi' ) );
116
-
117
- // Load frontend JS & CSS
118
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ), 10 );
119
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 10 );
120
-
121
- // Load admin JS & CSS
122
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ), 10, 1 );
123
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_styles' ), 10, 1 );
124
-
125
- // Handle localisation
126
- $this->load_plugin_textdomain();
127
- add_action( 'init', array( $this, 'load_localisation' ), 0 );
128
-
129
- $this->add_shortcodes();
130
- $this->add_metaboxes();
131
- $this->import_settings();
132
-
133
- } // End __construct ()
134
-
135
-
136
- /**
137
- * Initiate shortcode
138
- */
139
- public function add_shortcodes() {
140
- $advanced = Kiwi_Social_Share_Helper::get_setting_value( 'advanced_shortcode_manager', false, 'kiwi_advanced_settings' );
141
- new Kiwi_Social_Share_Shortcodes( $advanced );
142
- }
143
-
144
- /**
145
- * Add metaboxes if the option is enabled
146
- */
147
- public function add_metaboxes() {
148
- $custom_meta_boxes = Kiwi_Social_Share_Helper::get_setting_value( 'custom_meta_boxes', '' );
149
- if ( ! empty( $custom_meta_boxes ) ) {
150
- new Kiwi_Social_Share_Metaboxes();
151
- }
152
- }
153
-
154
- /**
155
- * Render the frontend
156
- *
157
- * @access public
158
- * @since 1.0.0
159
- * @return void
160
- */
161
- public function load_frontend_kiwi() {
162
- $instance = Kiwi_Social_Share_Frontend::instance( __FILE__, $this->_version );
163
- }
164
-
165
- /**
166
- * Start importer
167
- *
168
- * @access public
169
- * @since 1.0.0
170
- * @return void
171
- */
172
- public function import_settings() {
173
- $settings = get_option( 'kiwi_backup_option', false );
174
- if ( ! $settings ) {
175
- return;
176
- }
177
-
178
- $current = get_option( 'kiwi_general_settings', false );
179
- $settings = get_option( 'kiwi_backup_option' );
180
-
181
- if ( ! $current ) {
182
- update_option( 'kiwi_general_settings', $settings );
183
- } else {
184
- $new = array_merge( $current, $settings );
185
- update_option( 'kiwi_general_settings', $new );
186
- }
187
-
188
- delete_option( 'kiwi_backup_option' );
189
- }
190
-
191
- /**
192
- * Load frontend CSS.
193
- *
194
- * @access public
195
- * @since 1.0.0
196
- * @return void
197
- */
198
- public function enqueue_styles() {
199
- wp_enqueue_style( 'icomoon', esc_url( $this->assets_url ) . 'vendors/icomoon/style.css', array(), $this->_version );
200
- wp_register_style( $this->_token . '-frontend', esc_url( $this->assets_url ) . 'css/frontend' . $this->script_suffix . '.css', array( 'icomoon' ), $this->_version );
201
- } // End enqueue_styles ()
202
-
203
- /**
204
- * Load frontend Javascript.
205
- *
206
- * @access public
207
- * @since 1.0.0
208
- * @return void
209
- */
210
- public function enqueue_scripts() {
211
- wp_register_script( $this->_token . '-kiwi', esc_url( $this->assets_url ) . 'js/kiwi' . $this->script_suffix . '.js', array( 'jquery' ), $this->_version, true );
212
- wp_register_script( $this->_token . '-frontend', esc_url( $this->assets_url ) . 'js/frontend' . $this->script_suffix . '.js', array( $this->_token . '-kiwi' ), $this->_version );
213
-
214
- } // End enqueue_scripts ()
215
-
216
- /**
217
- * Load admin CSS.
218
- *
219
- * @access public
220
- * @since 1.0.0
221
- * @return void
222
- */
223
- public function admin_enqueue_styles( $hook = '' ) {
224
- // Add the color picker css file
225
- if ( $hook == 'toplevel_page_kiwi_social_sharing_settings' || $hook == 'kiwi_page_kiwi-upgrade' ) {
226
- wp_enqueue_style( 'wp-color-picker' );
227
- wp_enqueue_style( 'open-sans', '//fonts.googleapis.com/css?family=Open+Sans:300,400,700,800', array(), $this->_version );
228
- wp_enqueue_style( 'icomoon', esc_url( $this->assets_url ) . 'vendors/icomoon/style.css', array(), $this->_version );
229
- wp_register_style( $this->_token . '-admin', esc_url( $this->assets_url ) . 'css/admin.css', array(), $this->_version );
230
- wp_enqueue_style( $this->_token . '-admin' );
231
- }else {
232
- wp_register_style('menu-link', esc_url( $this->assets_url ) . 'css/menu-link.css', array(), $this->_version );
233
- wp_enqueue_style( 'menu-link' );
234
- }
235
-
236
- } // End admin_enqueue_styles ()
237
-
238
- /**
239
- * Load admin Javascript.
240
- *
241
- * @access public
242
- * @since 1.0.0
243
- * @return void
244
- */
245
- public function admin_enqueue_scripts( $hook = '' ) {
246
- if ( $hook == 'toplevel_page_kiwi_social_sharing_settings' || $hook == 'plugins.php' ) {
247
- wp_register_script( $this->_token . '-kiwi', esc_url( $this->assets_url ) . 'js/kiwi' . $this->script_suffix . '.js', array(
248
- 'jquery',
249
- 'jquery-ui-sortable',
250
- 'wp-color-picker'
251
- ), $this->_version, true );
252
- wp_register_script( $this->_token . '-admin', esc_url( $this->assets_url ) . 'js/admin.js', array( $this->_token . '-kiwi' ), $this->_version, true );
253
- $kiwi_locale = array(
254
- 'kiwi_step_one_title' => esc_html__( 'Get your premium version now!', 'kiwi-social-share' ),
255
- 'kiwi_step_two_title' => esc_html__( 'Almost Done', 'kiwi-social-share' ),
256
- 'kiwi_step_one_subtitle' => esc_html__( 'Take advantage of the large number of professional features anad take
257
- your business one step further!', 'kiwi-social-share' ),
258
- 'kiwi_step_two_subtitle' => esc_html__( 'We need a few information to complete this!', 'kiwi-social-share' )
259
- );
260
- wp_localize_script( $this->_token . '-admin', 'kiwi_locale', $kiwi_locale );
261
- wp_enqueue_script( $this->_token . '-admin' );
262
- }
263
- } // End admin_enqueue_scripts ()
264
-
265
- /**
266
- * Load plugin localisation
267
- *
268
- * @access public
269
- * @since 1.0.0
270
- * @return void
271
- */
272
- public function load_localisation() {
273
- load_plugin_textdomain( 'kiwi-social-share', false, dirname( plugin_basename( $this->file ) ) . '/lang/' );
274
- } // End load_localisation ()
275
-
276
- /**
277
- * Load plugin textdomain
278
- *
279
- * @access public
280
- * @since 1.0.0
281
- * @return void
282
- */
283
- public function load_plugin_textdomain() {
284
- $domain = 'kiwi-social-share';
285
-
286
- $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
287
-
288
- load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
289
- load_plugin_textdomain( $domain, false, dirname( plugin_basename( $this->file ) ) . '/lang/' );
290
- } // End load_plugin_textdomain ()
291
-
292
- /**
293
- * Main Kiwi_Social_Share Instance
294
- *
295
- * Ensures only one instance of Kiwi_Social_Share is loaded or can be loaded.
296
- *
297
- * @since 1.0.0
298
- * @static
299
- * @see Kiwi_Social_Share()
300
- * @return Main Kiwi_Social_Share instance
301
- */
302
- public static function instance( $file = '', $version = '1.0.0' ) {
303
- if ( is_null( self::$_instance ) ) {
304
- self::$_instance = new self( $file, $version );
305
- }
306
-
307
- return self::$_instance;
308
- } // End instance ()
309
-
310
- /**
311
- * Cloning is forbidden.
312
- *
313
- * @since 1.0.0
314
- */
315
- public function __clone() {
316
- _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'kiwi-social-share' ), $this->_version );
317
- } // End __clone ()
318
-
319
- /**
320
- * Unserializing instances of this class is forbidden.
321
- *
322
- * @since 1.0.0
323
- */
324
- public function __wakeup() {
325
- _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'kiwi-social-share' ), $this->_version );
326
- } // End __wakeup ()
327
-
328
- /**
329
- * Installation. Runs on activation.
330
- *
331
- * @access public
332
- * @since 1.0.0
333
- * @return void
334
- */
335
- public function install() {
336
- $this->_log_version_number();
337
- $options = get_option( 'kiwi_general_settings', array() );
338
- if ( empty( $options ) ) {
339
- Kiwi_Social_Share_Importer::get_instance();
340
- }
341
- } // End install ()
342
-
343
- /**
344
- * Log the plugin version number.
345
- *
346
- * @access public
347
- * @since 1.0.0
348
- * @return void
349
- */
350
- private function _log_version_number() {
351
- update_option( $this->_token . '_version', $this->_version );
352
- } // End _log_version_number ()
353
-
354
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ class Kiwi_Social_Share {
8
+
9
+ /**
10
+ * The single instance of Kiwi_Social_Share.
11
+ *
12
+ * @var object
13
+ * @access private
14
+ * @since 1.0.0
15
+ */
16
+ private static $_instance = NULL;
17
+
18
+ /**
19
+ * Settings class object
20
+ *
21
+ * @var object
22
+ * @access public
23
+ * @since 1.0.0
24
+ */
25
+ public $settings = NULL;
26
+
27
+ /**
28
+ * The version number.
29
+ *
30
+ * @var string
31
+ * @access public
32
+ * @since 1.0.0
33
+ */
34
+ public $_version;
35
+
36
+ /**
37
+ * The token.
38
+ *
39
+ * @var string
40
+ * @access public
41
+ * @since 1.0.0
42
+ */
43
+ public $_token;
44
+
45
+ /**
46
+ * The main plugin file.
47
+ *
48
+ * @var string
49
+ * @access public
50
+ * @since 1.0.0
51
+ */
52
+ public $file;
53
+
54
+ /**
55
+ * The main plugin directory.
56
+ *
57
+ * @var string
58
+ * @access public
59
+ * @since 1.0.0
60
+ */
61
+ public $dir;
62
+
63
+ /**
64
+ * The plugin assets directory.
65
+ *
66
+ * @var string
67
+ * @access public
68
+ * @since 1.0.0
69
+ */
70
+ public $assets_dir;
71
+
72
+ /**
73
+ * The plugin assets URL.
74
+ *
75
+ * @var string
76
+ * @access public
77
+ * @since 1.0.0
78
+ */
79
+ public $assets_url;
80
+
81
+ /**
82
+ * Suffix for Javascripts.
83
+ *
84
+ * @var string
85
+ * @access public
86
+ * @since 1.0.0
87
+ */
88
+ public $script_suffix;
89
+
90
+ /**
91
+ * Kiwi_Social_Share constructor.
92
+ *
93
+ * @param string $file
94
+ * @param string $version
95
+ */
96
+ public function __construct( $file = '', $version = '1.0.0' ) {
97
+ $this->_version = $version;
98
+ $this->_token = 'kiwi_social_sharing';
99
+
100
+ // Load plugin environment variables
101
+ $this->file = $file;
102
+ $this->dir = dirname( $this->file );
103
+ $this->assets_dir = trailingslashit( $this->dir ) . 'assets';
104
+ $this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $this->file ) ) );
105
+
106
+ $this->script_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
107
+
108
+
109
+ register_activation_hook( $this->file, array( $this, 'install' ) );
110
+
111
+ new Kiwi_Social_Share_Click_To_Tweet();
112
+
113
+
114
+
115
+ add_action( 'plugins_loaded', array( $this, 'load_frontend_kiwi' ) );
116
+
117
+ // Load frontend JS & CSS
118
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ), 10 );
119
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 10 );
120
+
121
+ // Load admin JS & CSS
122
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ), 10, 1 );
123
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_styles' ), 10, 1 );
124
+
125
+ // Load JS and CSS on the post/page edit pages only.
126
+ add_action( 'admin_print_styles-post.php', array( $this, 'admin_print_styles_post_only' ) );
127
+ add_action( 'admin_print_styles-post-new.php', array( $this, 'admin_print_styles_post_only' ) );
128
+
129
+ // Handle localisation
130
+ $this->load_plugin_textdomain();
131
+ add_action( 'init', array( $this, 'load_localisation' ), 0 );
132
+
133
+ $this->add_shortcodes();
134
+ $this->add_metaboxes();
135
+ $this->import_settings();
136
+
137
+ } // End __construct ()
138
+
139
+
140
+ /**
141
+ * Initiate shortcode
142
+ */
143
+ public function add_shortcodes() {
144
+ $advanced = Kiwi_Social_Share_Helper::get_setting_value( 'advanced_shortcode_manager', false, 'kiwi_advanced_settings' );
145
+ new Kiwi_Social_Share_Shortcodes( $advanced );
146
+ }
147
+
148
+ /**
149
+ * Add metaboxes if the option is enabled
150
+ */
151
+ public function add_metaboxes() {
152
+ $custom_meta_boxes = Kiwi_Social_Share_Helper::get_setting_value( 'custom_meta_boxes', '' );
153
+ if ( ! empty( $custom_meta_boxes ) ) {
154
+ new Kiwi_Social_Share_Metaboxes();
155
+ }
156
+ }
157
+
158
+ /**
159
+ * Render the frontend
160
+ *
161
+ * @access public
162
+ * @since 1.0.0
163
+ * @return void
164
+ */
165
+ public function load_frontend_kiwi() {
166
+ $instance = Kiwi_Social_Share_Frontend::instance( __FILE__, $this->_version );
167
+ }
168
+
169
+ /**
170
+ * Start importer
171
+ *
172
+ * @access public
173
+ * @since 1.0.0
174
+ * @return void
175
+ */
176
+ public function import_settings() {
177
+ $settings = get_option( 'kiwi_backup_option', false );
178
+ if ( ! $settings ) {
179
+ return;
180
+ }
181
+
182
+ $current = get_option( 'kiwi_general_settings', false );
183
+ $settings = get_option( 'kiwi_backup_option' );
184
+
185
+ if ( ! $current ) {
186
+ update_option( 'kiwi_general_settings', $settings );
187
+ } else {
188
+ $new = array_merge( $current, $settings );
189
+ update_option( 'kiwi_general_settings', $new );
190
+ }
191
+
192
+ delete_option( 'kiwi_backup_option' );
193
+ }
194
+
195
+ /**
196
+ * Load frontend CSS.
197
+ *
198
+ * @access public
199
+ * @since 1.0.0
200
+ * @return void
201
+ */
202
+ public function enqueue_styles() {
203
+ wp_enqueue_style( 'icomoon', esc_url( $this->assets_url ) . 'vendors/icomoon/style.css', array(), $this->_version );
204
+ wp_register_style( $this->_token . '-frontend', esc_url( $this->assets_url ) . 'css/frontend' . $this->script_suffix . '.css', array( 'icomoon' ), $this->_version );
205
+ } // End enqueue_styles ()
206
+
207
+ /**
208
+ * Load frontend Javascript.
209
+ *
210
+ * @access public
211
+ * @since 1.0.0
212
+ * @return void
213
+ */
214
+ public function enqueue_scripts() {
215
+ wp_register_script( $this->_token . '-kiwi', esc_url( $this->assets_url ) . 'js/kiwi' . $this->script_suffix . '.js', array( 'jquery' ), $this->_version, true );
216
+ wp_register_script( $this->_token . '-frontend', esc_url( $this->assets_url ) . 'js/frontend' . $this->script_suffix . '.js', array( $this->_token . '-kiwi' ), $this->_version );
217
+
218
+ } // End enqueue_scripts ()
219
+
220
+ /**
221
+ * Load admin CSS.
222
+ *
223
+ * @access public
224
+ * @since 1.0.0
225
+ * @return void
226
+ */
227
+ public function admin_enqueue_styles( $hook = '' ) {
228
+ // Add the color picker css file
229
+ if ( $hook == 'toplevel_page_kiwi_social_sharing_settings' || $hook == 'kiwi_page_kiwi-upgrade' ) {
230
+ wp_enqueue_style( 'wp-color-picker' );
231
+ wp_enqueue_style( 'open-sans', '//fonts.googleapis.com/css?family=Open+Sans:300,400,700,800', array(), $this->_version );
232
+ wp_enqueue_style( 'icomoon', esc_url( $this->assets_url ) . 'vendors/icomoon/style.css', array(), $this->_version );
233
+ wp_register_style( $this->_token . '-admin', esc_url( $this->assets_url ) . 'css/admin.css', array(), $this->_version );
234
+ wp_enqueue_style( $this->_token . '-admin' );
235
+ }else {
236
+ wp_register_style('menu-link', esc_url( $this->assets_url ) . 'css/menu-link.css', array(), $this->_version );
237
+ wp_enqueue_style( 'menu-link' );
238
+ }
239
+
240
+ } // End admin_enqueue_styles ()
241
+
242
+ /**
243
+ * Load admin Javascript.
244
+ *
245
+ * @access public
246
+ * @since 1.0.0
247
+ * @return void
248
+ */
249
+ public function admin_enqueue_scripts( $hook = '' ) {
250
+ if ( $hook == 'toplevel_page_kiwi_social_sharing_settings' || $hook == 'plugins.php' ) {
251
+ wp_register_script( $this->_token . '-kiwi', esc_url( $this->assets_url ) . 'js/kiwi' . $this->script_suffix . '.js', array(
252
+ 'jquery',
253
+ 'jquery-ui-sortable',
254
+ 'wp-color-picker'
255
+ ), $this->_version, true );
256
+ wp_register_script( $this->_token . '-admin', esc_url( $this->assets_url ) . 'js/admin.js', array( $this->_token . '-kiwi' ), $this->_version, true );
257
+ $kiwi_locale = array(
258
+ 'kiwi_step_one_title' => esc_html__( 'Get your premium version now!', 'kiwi-social-share' ),
259
+ 'kiwi_step_two_title' => esc_html__( 'Almost Done', 'kiwi-social-share' ),
260
+ 'kiwi_step_one_subtitle' => esc_html__( 'Take advantage of the large number of professional features anad take
261
+ your business one step further!', 'kiwi-social-share' ),
262
+ 'kiwi_step_two_subtitle' => esc_html__( 'We need a few information to complete this!', 'kiwi-social-share' )
263
+ );
264
+ wp_localize_script( $this->_token . '-admin', 'kiwi_locale', $kiwi_locale );
265
+ wp_enqueue_script( $this->_token . '-admin' );
266
+ }
267
+ } // End admin_enqueue_scripts ()
268
+
269
+ /**
270
+ * Load JS and CSS on the post/page edit pages only.
271
+ */
272
+ public function admin_print_styles_post_only() {
273
+
274
+ // Enqueue metabox CSS file.
275
+ wp_enqueue_style( $this->_token . '-post-only', esc_url( $this->assets_url ) . 'css/metabox' . $this->script_suffix . '.css', array(), $this->_version );
276
+
277
+ // Enqueue the WP Media scripts.
278
+ wp_enqueue_media();
279
+
280
+ // Enqueue metabox JS file.
281
+ wp_enqueue_script( $this->_token . '-post-only', esc_url( $this->assets_url ) . 'js/metabox' . $this->script_suffix . '.js', array( 'jquery' ), $this->_version, true );
282
+
283
+ // Localize the scripts.
284
+ wp_localize_script(
285
+ $this->_token . '-post-only',
286
+ 'kiwiMediaSelects',
287
+ array(
288
+ 'choose' => esc_html__( 'Choose Image', 'kiwi-social-share' ),
289
+ 'update' => esc_html__( 'Use Image', 'kiwi-social-share' ),
290
+ 'delete' => esc_html__( 'Delete Image', 'kiwi-social-share' ),
291
+ )
292
+ );
293
+
294
+ }
295
+
296
+ /**
297
+ * Load plugin localisation
298
+ *
299
+ * @access public
300
+ * @since 1.0.0
301
+ * @return void
302
+ */
303
+ public function load_localisation() {
304
+ load_plugin_textdomain( 'kiwi-social-share', false, dirname( plugin_basename( $this->file ) ) . '/lang/' );
305
+ } // End load_localisation ()
306
+
307
+ /**
308
+ * Load plugin textdomain
309
+ *
310
+ * @access public
311
+ * @since 1.0.0
312
+ * @return void
313
+ */
314
+ public function load_plugin_textdomain() {
315
+ $domain = 'kiwi-social-share';
316
+
317
+ $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
318
+
319
+ load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
320
+ load_plugin_textdomain( $domain, false, dirname( plugin_basename( $this->file ) ) . '/lang/' );
321
+ } // End load_plugin_textdomain ()
322
+
323
+ /**
324
+ * Main Kiwi_Social_Share Instance
325
+ *
326
+ * Ensures only one instance of Kiwi_Social_Share is loaded or can be loaded.
327
+ *
328
+ * @since 1.0.0
329
+ * @static
330
+ * @see Kiwi_Social_Share()
331
+ * @return Main Kiwi_Social_Share instance
332
+ */
333
+ public static function instance( $file = '', $version = '1.0.0' ) {
334
+ if ( is_null( self::$_instance ) ) {
335
+ self::$_instance = new self( $file, $version );
336
+ }
337
+
338
+ return self::$_instance;
339
+ } // End instance ()
340
+
341
+ /**
342
+ * Cloning is forbidden.
343
+ *
344
+ * @since 1.0.0
345
+ */
346
+ public function __clone() {
347
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'kiwi-social-share' ), $this->_version );
348
+ } // End __clone ()
349
+
350
+ /**
351
+ * Unserializing instances of this class is forbidden.
352
+ *
353
+ * @since 1.0.0
354
+ */
355
+ public function __wakeup() {
356
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'kiwi-social-share' ), $this->_version );
357
+ } // End __wakeup ()
358
+
359
+ /**
360
+ * Installation. Runs on activation.
361
+ *
362
+ * @access public
363
+ * @since 1.0.0
364
+ * @return void
365
+ */
366
+ public function install() {
367
+ $this->_log_version_number();
368
+ $options = get_option( 'kiwi_general_settings', array() );
369
+ if ( empty( $options ) ) {
370
+ Kiwi_Social_Share_Importer::get_instance();
371
+ }
372
+ } // End install ()
373
+
374
+ /**
375
+ * Log the plugin version number.
376
+ *
377
+ * @access public
378
+ * @since 1.0.0
379
+ * @return void
380
+ */
381
+ private function _log_version_number() {
382
+ update_option( $this->_token . '_version', $this->_version );
383
+ } // End _log_version_number ()
384
+
385
+ }
includes/frontend/social-bars/class-kiwi-social-share-view-shortcode-bar.php CHANGED
@@ -1,76 +1,78 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
- /**
7
- * Class Kiwi_Social_Share_View_Shortcode_Bar
8
- */
9
- final class Kiwi_Social_Share_View_Shortcode_Bar extends Kiwi_Social_Share_View implements Kiwi_Social_Share_Interface_Frontend {
10
- public function __construct( $networks = array(), $style = 'center', $icons = 'rect' ) {
11
- parent::__construct();
12
-
13
- if ( ! empty( $networks ) ) {
14
- $this->networks['shortcode_bar'] = $networks;
15
- }
16
-
17
- $this->container_class = array( $icons );
18
-
19
- switch ( $style ) {
20
- case 'fit':
21
- $this->container_class[] = 'kiwi-article-bar-fit';
22
- break;
23
- default:
24
- $this->container_class[] = 'kiwi-article-bar-center';
25
- break;
26
- }
27
-
28
- $kiwi = Kiwi_Social_Share::instance();
29
- wp_enqueue_style( $kiwi->_token . '-frontend' );
30
- wp_enqueue_script( $kiwi->_token . '-frontend' );
31
- }
32
-
33
- /**
34
- * @param string $content
35
- *
36
- * @return mixed|void
37
- */
38
- public function display_bar( $content = '' ) {
39
- $this->generate_frontend_bar();
40
- }
41
-
42
- /**
43
- * Render the display bar
44
- *
45
- */
46
- public function generate_frontend_bar() {
47
- $output = '';
48
- $class = implode( ' ', $this->container_class );
49
- $tracking = '';
50
- if ( $this->tracking ) {
51
- $tracking = ' data-tracking="true" data-tracking-container="shortcode-bar" ';
52
- }
53
- $output .= '<ul class="kiwi-article-bar ' . esc_attr( $class ) . '"' . $tracking . '>';
54
- foreach ( $this->networks['shortcode_bar'] as $network ) {
55
- $class = $this->generate_class_name( $network );
56
- if ( ! class_exists( $class ) ) {
57
- continue;
58
- }
59
- $t = new $class();
60
- $t = $t->generate_output();
61
- if ( ! empty( $t ) ) {
62
- $output .= '<li>';
63
- /**
64
- * Social buttons will implement this interface :
65
- * Kiwi_Social_Share_Interface_Social::generate_output
66
- */
67
- $output .= $t;
68
- $output .= '</li>';
69
- }
70
- }
71
- $output .= '</ul>';
72
-
73
- return wp_kses_post( $output );
74
- }
75
-
76
- }
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ /**
7
+ * Class Kiwi_Social_Share_View_Shortcode_Bar
8
+ */
9
+ final class Kiwi_Social_Share_View_Shortcode_Bar extends Kiwi_Social_Share_View implements Kiwi_Social_Share_Interface_Frontend {
10
+ public function __construct( $networks = array(), $style = 'center', $icons = 'rect' ) {
11
+ parent::__construct();
12
+
13
+ if ( ! empty( $networks ) ) {
14
+ $this->networks['shortcode_bar'] = $networks;
15
+ }
16
+
17
+ $this->container_class = array( $icons );
18
+
19
+ switch ( $style ) {
20
+ case 'fit':
21
+ $this->container_class[] = 'kiwi-article-bar-fit';
22
+ break;
23
+ default:
24
+ $this->container_class[] = 'kiwi-article-bar-center';
25
+ break;
26
+ }
27
+
28
+ $kiwi = Kiwi_Social_Share::instance();
29
+ wp_enqueue_style( $kiwi->_token . '-frontend' );
30
+ wp_enqueue_script( $kiwi->_token . '-frontend' );
31
+ }
32
+
33
+ /**
34
+ * @param string $content
35
+ *
36
+ * @return mixed|void
37
+ */
38
+ public function display_bar( $content = '' ) {
39
+ $this->generate_frontend_bar();
40
+ }
41
+
42
+ /**
43
+ * Render the display bar
44
+ *
45
+ */
46
+ public function generate_frontend_bar() {
47
+ $output = '';
48
+ $class = implode( ' ', $this->container_class );
49
+ $tracking = '';
50
+ if ( $this->tracking ) {
51
+ $tracking = ' data-tracking="true" data-tracking-container="shortcode-bar" ';
52
+ }
53
+ $output .= '<ul class="kiwi-article-bar ' . esc_attr( $class ) . '"' . $tracking . '>';
54
+ if ( ! empty( $this->networks['shortcode_bar'] ) ) {
55
+ foreach ( (array) $this->networks['shortcode_bar'] as $network ) {
56
+ $class = $this->generate_class_name( $network );
57
+ if ( ! class_exists( $class ) ) {
58
+ continue;
59
+ }
60
+ $t = new $class();
61
+ $t = $t->generate_output();
62
+ if ( ! empty( $t ) ) {
63
+ $output .= '<li>';
64
+ /**
65
+ * Social buttons will implement this interface :
66
+ * Kiwi_Social_Share_Interface_Social::generate_output
67
+ */
68
+ $output .= $t;
69
+ $output .= '</li>';
70
+ }
71
+ }
72
+ }
73
+ $output .= '</ul>';
74
+
75
+ return wp_kses_post( $output );
76
+ }
77
+
78
+ }
includes/lib/class-kiwi-social-share-metaboxes.php CHANGED
@@ -1,132 +1,333 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
- /**
7
- * Class Kiwi_Social_Share_Metaboxes
8
- */
9
- class Kiwi_Social_Share_Metaboxes {
10
- /**
11
- * @var object
12
- *
13
- * CMB2 object
14
- */
15
- public $metabox = NULL;
16
- /**
17
- * @var array
18
- */
19
- public $options = array();
20
- /**
21
- * @var bool
22
- */
23
- public $global = false;
24
- /**
25
- * @var array
26
- */
27
- public $post_types = array();
28
-
29
- /**
30
- * Kiwi_Social_Share_Metaboxes constructor.
31
- */
32
- public function __construct() {
33
- $this->prefix = 'kiwi_';
34
-
35
- $this->check_if_global();
36
- $this->check_post_types();
37
-
38
- $this->set_options();
39
-
40
- add_action( 'cmb2_admin_init', array( $this, 'register_metabox' ) );
41
- }
42
-
43
- /**
44
- * Set the options that we will add to the metabox
45
- */
46
- public function set_options() {
47
- $this->options = array(
48
- 'social-media-title' => array(
49
- 'name' => esc_html__( 'Social Media Title', 'kiwi-social-share' ),
50
- 'id' => $this->prefix . 'social-media-title',
51
- 'type' => 'text',
52
- ),
53
-
54
- 'social-media-description' => array(
55
- 'name' => esc_html__( 'Social Media Description', 'kiwi-social-share' ),
56
- 'id' => $this->prefix . 'social-media-description',
57
- 'type' => 'textarea',
58
- ),
59
-
60
- 'social-media-image' => array(
61
- 'name' => esc_html__( 'Social Media Image', 'kiwi-social-share' ),
62
- 'id' => $this->prefix . 'social-media-image',
63
- 'type' => 'file',
64
- ),
65
-
66
- 'social-media-custom-tweet' => array(
67
- 'name' => esc_html__( 'Custom Tweet', 'kiwi-social-share' ),
68
- 'id' => $this->prefix . 'social-media-custom-tweet',
69
- 'type' => 'textarea',
70
- ),
71
-
72
- 'social-media-pinterest-image' => array(
73
- 'name' => esc_html__( 'Social Media Pinterest Image', 'kiwi-social-share' ),
74
- 'id' => $this->prefix . 'social-media-pinterest-image',
75
- 'type' => 'file',
76
- ),
77
-
78
- 'social-media-pinterest-description' => array(
79
- 'name' => esc_html__( 'Pinterest Description', 'kiwi-social-share' ),
80
- 'id' => $this->prefix . 'social-media-pinterest-description',
81
- 'type' => 'textarea',
82
- ),
83
- );
84
- }
85
-
86
- /**
87
- * In case we have an 'all' match, we don`t need to search for specific post types
88
- */
89
- public function check_if_global() {
90
- $metaboxes = Kiwi_Social_Share_Helper::get_setting_value( 'custom_meta_boxes_posttypes', '' );
91
- if ( 'all' == $metaboxes ) {
92
- $this->global = true;
93
- }
94
- }
95
-
96
- /**
97
- * Get all the post types where we need to add the custom metaboxes
98
- */
99
- public function check_post_types() {
100
- $all_post_types = Kiwi_Social_Share_Helper::get_custom_post_types();
101
- foreach ( $all_post_types as $k => $v ) {
102
- $this->post_types[] = $k;
103
- }
104
-
105
- if ( ! $this->global ) {
106
- $this->post_types = Kiwi_Social_Share_Helper::get_setting_value( 'custom_meta_boxes_posttypes_list', array() );
107
- }
108
- }
109
-
110
- /**
111
- * Register metaboxes
112
- */
113
- public function register_metabox() {
114
- $this->metabox = new_cmb2_box( array(
115
- 'id' => $this->prefix . 'metabox',
116
- 'title' => esc_html__( 'Kiwi Social Share Meta Information', 'kiwi-social-share' ),
117
- 'object_types' => $this->post_types,
118
- 'closed' => false,
119
- ) );
120
-
121
- $this->add_fields();
122
- }
123
-
124
- /**
125
- * Add fields to the metabox
126
- */
127
- public function add_fields() {
128
- foreach ( $this->options as $id => $option ) {
129
- $this->metabox->add_field( $option );
130
- }
131
- }
132
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ /**
7
+ * Class Kiwi_Social_Share_Metaboxes
8
+ */
9
+ class Kiwi_Social_Share_Metaboxes {
10
+
11
+ /**
12
+ * Kiwi_Social_Share_Metaboxes options.
13
+ *
14
+ * @var array
15
+ */
16
+ public $meta_options = array();
17
+
18
+ /**
19
+ * @var bool
20
+ */
21
+ public $global = false;
22
+
23
+ /**
24
+ * @var array
25
+ */
26
+ public $post_types = array();
27
+
28
+ /**
29
+ * Kiwi_Social_Share_Metaboxes constructor.
30
+ */
31
+ public function __construct() {
32
+ $this->prefix = 'kiwi_';
33
+
34
+ $this->check_if_global();
35
+ $this->check_post_types();
36
+
37
+ /**
38
+ * Add a metabox and register settings for the shortcodes.
39
+ */
40
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
41
+
42
+ /**
43
+ * Save the metabox post datas.
44
+ */
45
+ add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );
46
+
47
+ // Call this function to set the value to $meta_options.
48
+ $this->set_meta_options();
49
+ }
50
+
51
+ /**
52
+ * Define the arrays for the meta boxes.
53
+ */
54
+ public function set_meta_options() {
55
+
56
+ $this->meta_options = array(
57
+ /**
58
+ * Social media title.
59
+ */
60
+ 'social-media-title' => array(
61
+ 'name' => esc_html__( 'Social Media Title', 'kiwi-social-share' ),
62
+ 'id' => $this->prefix . 'social-media-title',
63
+ 'type' => 'text',
64
+ ),
65
+
66
+ /**
67
+ * Social media description.
68
+ */
69
+ 'social-media-description' => array(
70
+ 'name' => esc_html__( 'Social Media Description', 'kiwi-social-share' ),
71
+ 'id' => $this->prefix . 'social-media-description',
72
+ 'type' => 'textarea',
73
+ ),
74
+
75
+ /**
76
+ * Social media image.
77
+ */
78
+ 'social-media-image' => array(
79
+ 'name' => esc_html__( 'Social Media Image', 'kiwi-social-share' ),
80
+ 'id' => $this->prefix . 'social-media-image',
81
+ 'type' => 'file',
82
+ ),
83
+
84
+ /**
85
+ * Social media custom tweet.
86
+ */
87
+ 'social-media-custom-tweet' => array(
88
+ 'name' => esc_html__( 'Custom Tweet', 'kiwi-social-share' ),
89
+ 'id' => $this->prefix . 'social-media-custom-tweet',
90
+ 'type' => 'textarea',
91
+ ),
92
+
93
+ /**
94
+ * Social media pinterest image.
95
+ */
96
+ 'social-media-pinterest-image' => array(
97
+ 'name' => esc_html__( 'Social Media Pinterest Image', 'kiwi-social-share' ),
98
+ 'id' => $this->prefix . 'social-media-pinterest-image',
99
+ 'type' => 'file',
100
+ ),
101
+
102
+ /**
103
+ * Social media pinterest description.
104
+ */
105
+ 'social-media-pinterest-description' => array(
106
+ 'name' => esc_html__( 'Pinterest Description', 'kiwi-social-share' ),
107
+ 'id' => $this->prefix . 'social-media-pinterest-description',
108
+ 'type' => 'textarea',
109
+ ),
110
+ );
111
+
112
+ }
113
+
114
+ /**
115
+ * Adds the required metaboxes.
116
+ */
117
+ public function add_meta_boxes() {
118
+
119
+ // Add meta box for shortcode options.
120
+ add_meta_box(
121
+ $this->prefix . 'metabox',
122
+ esc_html__( 'Kiwi Social Share Meta Information', 'kiwi-social-share' ),
123
+ array( $this, 'kiwi_social_share_meta_information' ),
124
+ $this->post_types,
125
+ 'advanced'
126
+ );
127
+
128
+ }
129
+
130
+ /**
131
+ * Add meta box for Kiwi Social Share meta information options.
132
+ *
133
+ * @param WP_Post $post The post object.
134
+ */
135
+ public function kiwi_social_share_meta_information( $post ) {
136
+
137
+ // Add an nonce field so we can check for it later.
138
+ wp_nonce_field( 'kiwi_social_share_metabox', 'kiwi_social_share_metabox_nonce' );
139
+
140
+ $output = '';
141
+ $meta_options = $this->meta_options;
142
+ foreach ( $meta_options as $meta_option ) {
143
+ $meta_value = get_post_meta( $post->ID, $meta_option['id'], true );
144
+ ?>
145
+ <div class="kiwi-metabox kss-row">
146
+ <?php
147
+ switch ( $meta_option['type'] ) {
148
+
149
+ case 'text':
150
+ // Display in the form options.
151
+ ?>
152
+ <div class="kss-label">
153
+ <label for="<?php echo esc_attr( $meta_option['id'] ); ?>">
154
+ <?php echo esc_html( $meta_option['name'] ); ?>
155
+ </label>
156
+ </div>
157
+
158
+ <div class="kss-options">
159
+ <input type="text" class="regular-text" id="<?php echo esc_attr( $meta_option['id'] ); ?>" name="<?php echo esc_attr( $meta_option['id'] ); ?>" value="<?php echo esc_attr( $meta_value ); ?>" />
160
+ </div>
161
+ <?php
162
+ break;
163
+
164
+ case 'textarea':
165
+ // Display in the form options.
166
+ ?>
167
+ <div class="kss-label">
168
+ <label for="<?php echo esc_attr( $meta_option['id'] ); ?>">
169
+ <?php echo esc_html( $meta_option['name'] ); ?>
170
+ </label>
171
+ </div>
172
+
173
+ <div class="kss-options">
174
+ <textarea id="<?php echo esc_attr( $meta_option['id'] ); ?>" name="<?php echo esc_attr( $meta_option['id'] ); ?>" cols="60" rows="10"><?php echo esc_textarea( $meta_value ); ?></textarea>
175
+ </div>
176
+ <?php
177
+ break;
178
+
179
+ case 'file':
180
+ // Display in the form options.
181
+ $meta_value_id = get_post_meta( $post->ID, $meta_option['id'] . '_id', true );
182
+ ?>
183
+ <div class="kss-label">
184
+ <label for="<?php echo esc_attr( $meta_option['id'] ); ?>">
185
+ <?php echo esc_html( $meta_option['name'] ); ?>
186
+ </label>
187
+ </div>
188
+
189
+ <div class="kss-options">
190
+ <input type="text" class="kss-upload-file regular-text" id="<?php echo esc_attr( $meta_option['id'] ); ?>" name="<?php echo esc_attr( $meta_option['id'] ); ?>" value="<?php echo esc_attr( $meta_value ); ?>" />
191
+
192
+ <input type="button" class="kss-upload-button button-secondary" value="<?php esc_attr_e( 'Add or Upload File', 'kiwi-social-share' ); ?>" />
193
+
194
+ <input type="hidden" class="kss-upload-file-id" id="<?php echo esc_attr( $meta_option['id'] . '_id' ); ?>" name="<?php echo esc_attr( $meta_option['id'] . '_id' ); ?>" value="<?php echo esc_attr( $meta_value_id ); ?>" />
195
+
196
+ <div id="<?php echo esc_attr( $meta_option['id'] ); ?>-kss-media-status" class="kss-media-status">
197
+ <?php if ( $meta_value ) { ?>
198
+ <div class="kss-media-item">
199
+ <img style="max-width: 350px; width: 100%;" src="<?php echo esc_url( $meta_value ); ?>" class="kss-file-field-image" alt="" />
200
+
201
+ <p class="kss-remove-wrapper">
202
+ <a href="#" class="kss-remove-file-button" rel="<?php echo esc_attr( $meta_option['id'] ); ?>"><?php esc_html_e( 'Remove Image', 'kiwi-social-share' ); ?></a>
203
+ </p>
204
+ </div>
205
+ <?php } ?>
206
+ </div>
207
+ </div>
208
+ <?php
209
+ break;
210
+
211
+ }
212
+ ?>
213
+ </div>
214
+ <?php
215
+ }
216
+
217
+ }
218
+
219
+ /**
220
+ * Fires once a post has been saved.
221
+ *
222
+ * @param int $post_id Post ID.
223
+ * @param WP_Post $post Post object.
224
+ */
225
+ public function save_post( $post_id, $post ) {
226
+
227
+ $post_id = absint( $post_id );
228
+
229
+ // Return if $post_id and $post are not available.
230
+ if ( empty( $post_id ) || empty( $post ) ) {
231
+ return;
232
+ }
233
+
234
+ // Return the metabox saves for revisions and autosaves.
235
+ if ( defined( 'DOING_AUTOSAVE' ) || is_int( wp_is_post_revision( $post ) ) || is_int( wp_is_post_autosave( $post ) ) ) {
236
+ return;
237
+ }
238
+
239
+ // Return if nonce is not set and is not valid.
240
+ if ( empty( $_POST['kiwi_social_share_metabox_nonce'] ) || ! wp_verify_nonce( wp_unslash( $_POST['kiwi_social_share_metabox_nonce'] ), 'kiwi_social_share_metabox' ) ) {
241
+ return;
242
+ }
243
+
244
+ // Return if it's being saved in other posts.
245
+ if ( empty( $_POST['post_ID'] ) || absint( $_POST['post_ID'] ) !== $post_id ) {
246
+ return;
247
+ }
248
+
249
+ // Check if the user has permission to edit or not.
250
+ if ( isset( $_POST['post_type'] ) ) {
251
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
252
+ return $post_id;
253
+ }
254
+ }
255
+
256
+ $meta_options = $this->meta_options;
257
+ foreach ( $meta_options as $meta_option ) {
258
+ $default = isset( $meta_option['default'] ) ? $meta_option['default'] : false;
259
+
260
+ switch ( $meta_option['type'] ) {
261
+
262
+ case 'text':
263
+ // Get the required form datas.
264
+ $text_value = isset( $_POST[ $meta_option['id'] ] ) ? sanitize_text_field( $_POST[ $meta_option['id'] ] ) : $default;
265
+
266
+ // Save the datas in the database.
267
+ if ( $text_value ) {
268
+ update_post_meta( $post_id, $meta_option['id'], sanitize_text_field( $text_value ) );
269
+ } else {
270
+ delete_post_meta( $post_id, $meta_option['id'] );
271
+ }
272
+ break;
273
+
274
+ case 'textarea':
275
+ // Get the required form datas.
276
+ $text_value = isset( $_POST[ $meta_option['id'] ] ) ? wp_kses_post( $_POST[ $meta_option['id'] ] ) : $default;
277
+
278
+ // Save the datas in the database.
279
+ if ( $text_value ) {
280
+ update_post_meta( $post_id, $meta_option['id'], wp_kses_post( $text_value ) );
281
+ } else {
282
+ delete_post_meta( $post_id, $meta_option['id'] );
283
+ }
284
+ break;
285
+
286
+ case 'file':
287
+ // Get the required form datas.
288
+ $media_value = isset( $_POST[ $meta_option['id'] ] ) ? esc_url_raw( $_POST[ $meta_option['id'] ] ) : $default;
289
+ $media_value_id = isset( $_POST[ $meta_option['id'] . '_id' ] ) ? absint( $_POST[ $meta_option['id'] . '_id' ] ) : '';
290
+
291
+ // Save the datas in the database.
292
+ if ( $media_value ) {
293
+ update_post_meta( $post_id, $meta_option['id'], esc_url_raw( $media_value ) );
294
+ } else {
295
+ delete_post_meta( $post_id, $meta_option['id'] );
296
+ }
297
+ // For image id.
298
+ if ( $media_value_id ) {
299
+ update_post_meta( $post_id, $meta_option['id'] . '_id', absint( $media_value_id ) );
300
+ } else {
301
+ delete_post_meta( $post_id, $meta_option['id'] . '_id' );
302
+ }
303
+ break;
304
+
305
+ }
306
+ }
307
+
308
+ }
309
+
310
+ /**
311
+ * In case we have an 'all' match, we don`t need to search for specific post types.
312
+ */
313
+ public function check_if_global() {
314
+ $metaboxes = Kiwi_Social_Share_Helper::get_setting_value( 'custom_meta_boxes_posttypes', '' );
315
+ if ( 'all' == $metaboxes ) {
316
+ $this->global = true;
317
+ }
318
+ }
319
+
320
+ /**
321
+ * Get all the post types where we need to add the custom metaboxes.
322
+ */
323
+ public function check_post_types() {
324
+ $all_post_types = Kiwi_Social_Share_Helper::get_custom_post_types();
325
+ foreach ( $all_post_types as $k => $v ) {
326
+ $this->post_types[] = $k;
327
+ }
328
+
329
+ if ( ! $this->global ) {
330
+ $this->post_types = Kiwi_Social_Share_Helper::get_setting_value( 'custom_meta_boxes_posttypes_list', array() );
331
+ }
332
+ }
333
+ }
includes/lib/class-kiwi-social-share-shortcodes.php CHANGED
@@ -1,236 +1,480 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
- /**
8
- * Class Kiwi_Social_Share_Shortcodes
9
- */
10
- class Kiwi_Social_Share_Shortcodes {
11
-
12
- /**
13
- * Kiwi_Social_Share_Shortcodes constructor.
14
- *
15
- * @param bool $advanced
16
- *
17
- */
18
- public function __construct( $advanced = false ) {
19
- if ( $advanced ) {
20
- /**
21
- * Add a custom post type for our shortcodes
22
- */
23
- add_action( 'init', array( $this, 'add_custom_post_type' ) );
24
- /**
25
- * Add a metabox and register settings for the shortcodes
26
- */
27
- add_action( 'cmb2_admin_init', array( $this, 'register_metabox' ) );
28
- /**
29
- * Edit the columns from archive and add an identifier (easier to copy paste it where the user needs it)
30
- */
31
- add_filter( 'manage_edit-kiwi-shortcodes_columns', array( $this, 'kiwi_shortcode_columns' ) );
32
- add_action( 'manage_kiwi-shortcodes_posts_custom_column', array( $this, 'kiwi_shortcode_column' ), 10, 2 );
33
- }
34
-
35
- add_shortcode( 'kiwi-social-bar', array( $this, 'kiwi_bar_shortcode' ) );
36
- }
37
-
38
- /**
39
- * Register the custom post type
40
- */
41
- public function add_custom_post_type() {
42
- register_post_type( 'kiwi-shortcodes',
43
- array(
44
- 'labels' => array(
45
- 'name' => esc_html__( 'Kiwi Shortcodes', 'kiwi-social-share' ),
46
- 'singular_name' => esc_html__( 'Kiwi Shortcode', 'kiwi-social-share' ),
47
- 'not_found' => esc_html__( 'No Kiwi Shortcodes found', 'kiwi-social-share' ),
48
- 'not_found_in_trash' => esc_html__( 'No Kiwi Shortcodes found in trash', 'kiwi-social-share' )
49
- ),
50
- 'menu_icon' => 'dashicons-share-alt',
51
- 'supports' => array( 'title' ),
52
- 'public' => false,
53
- 'exclude_from_search' => true,
54
- 'show_ui' => true,
55
- 'show_in_menu' => false,
56
- 'has_archive' => false
57
- )
58
- );
59
- }
60
-
61
- /**
62
- * Customize the identifier column
63
- *
64
- * @param $column
65
- * @param $post_id
66
- *
67
- */
68
- public function kiwi_shortcode_column( $column, $post_id ) {
69
- printf( '[kiwi-social-bar id="%s"]', $post_id );
70
- }
71
-
72
- /**
73
- * Customize the kiwi shortcode columns
74
- *
75
- * @param $columns
76
- *
77
- * @return array
78
- */
79
- public function kiwi_shortcode_columns( $columns ) {
80
- $columns = array(
81
- 'cb' => '<input type="checkbox" />',
82
- 'title' => __( 'Shortcode', 'kiwi-social-share' ),
83
- 'identifier' => __( 'Identifier', 'kiwi-social-share' ),
84
- 'date' => __( 'Date', 'kiwi-social-share' )
85
- );
86
-
87
- return $columns;
88
- }
89
-
90
- /**
91
- * Register metaboxes using CMB2
92
- */
93
- public function register_metabox() {
94
- /**
95
- * Add the metabox
96
- */
97
- $metabox = new_cmb2_box( array(
98
- 'id' => 'kiwi_shortcode_metabox',
99
- 'title' => esc_html__( 'Kiwi Shortcode Meta', 'kiwi-social-share' ),
100
- 'object_types' => array( 'kiwi-shortcodes' ),
101
- 'closed' => false,
102
- ) );
103
-
104
- $id = '';
105
- if ( ! empty( $_GET ) && ! empty( $_GET['post'] ) ) {
106
- $id = absint( $_GET['post'] );
107
- /**
108
- * Add shortcode fields
109
- *
110
- * This field is used as an identifier (user copies/pastes this content where he needs it)
111
- */
112
- $metabox->add_field(
113
- array(
114
- 'name' => esc_html__( 'Shortcode list item style', 'kiwi-social-share' ),
115
- 'id' => 'kiwi_shortcode_identifier',
116
- 'type' => 'text',
117
- 'default' => '[kiwi-social-bar id="' . $id . '"]',
118
- 'attributes' => array(
119
- 'readonly' => 'readonly'
120
- )
121
- )
122
- );
123
- }
124
-
125
-
126
- /**
127
- * Shortcode networks fields ( multicheck )
128
- */
129
- $metabox->add_field(
130
- array(
131
- 'name' => esc_html__( 'Shortcode networks', 'kiwi-social-share' ),
132
- 'id' => 'kiwi_shortcode_networks',
133
- 'type' => 'multicheck',
134
- 'options' => array(
135
- 'facebook' => esc_html__( 'Facebook', 'kiwi-social-share' ),
136
- 'twitter' => esc_html__( 'Twitter', 'kiwi-social-share' ),
137
- 'linkedin' => esc_html__( 'LinkedIn', 'kiwi-social-share' ),
138
- 'pinterest' => esc_html__( 'Pinterest', 'kiwi-social-share' ),
139
- /* start-pro-version */
140
- 'reddit' => esc_html__( 'Reddit', 'kiwi-social-share' ),
141
- 'email' => esc_html__( 'Email', 'kiwi-social-share' ),
142
- 'skype' => esc_html__( 'Skype', 'kiwi-social-share' ),
143
- 'telegram' => esc_html__( 'Telegram', 'kiwi-social-share' ),
144
- 'whatsapp' => esc_html__( 'WhatsApp', 'kiwi-social-share' ),
145
- /* end-pro-version */
146
- ),
147
- )
148
- );
149
-
150
- /**
151
- * Shortcode bar style
152
- */
153
- $metabox->add_field(
154
- array(
155
- 'name' => esc_html__( 'Shortcode bar style', 'kiwi-social-share' ),
156
- 'id' => 'kiwi_shortcode_bar_style',
157
- 'type' => 'radio',
158
- 'default' => 'fit',
159
- 'options' => array(
160
- 'fit' => esc_html__( 'Fit', 'kiwi-social-share' ),
161
- 'center' => esc_html__( 'Center', 'kiwi-social-share' ),
162
- ),
163
- )
164
- );
165
-
166
- /**
167
- * Shortcode list item styles
168
- */
169
- $metabox->add_field(
170
- array(
171
- 'name' => esc_html__( 'Shortcode list item style', 'kiwi-social-share' ),
172
- 'id' => 'kiwi_shortcode_list_item_style',
173
- 'type' => 'radio',
174
- 'default' => 'rect',
175
- 'options' => array(
176
- 'rect' => esc_html__( 'Rectangular', 'kiwi-social-share' ),
177
- 'leaf' => esc_html__( 'Leaf', 'kiwi-social-share' ),
178
- 'shift' => esc_html__( 'Shift', 'kiwi-social-share' ),
179
- 'pill' => esc_html__( 'Pill', 'kiwi-social-share' ),
180
- ),
181
- )
182
- );
183
- }
184
-
185
- /**
186
- * @param null $atts
187
- * @param null $content
188
- *
189
- * @return mixed|null|string
190
- */
191
- public function kiwi_bar_shortcode( $atts = NULL, $content = NULL ) {
192
- $instance = array(
193
- 'networks' => Kiwi_Social_Share_Helper::get_setting_value( 'networks_article_bar', array() ),
194
- 'style' => Kiwi_Social_Share_Helper::get_setting_value( 'article_bar_style', 'center' ),
195
- 'items' => Kiwi_Social_Share_Helper::get_setting_value( 'button_shape', 'rect' )
196
- );
197
-
198
- if ( ! empty( $atts ) ) {
199
- $instance = array(
200
- 'networks' => get_post_meta( $atts['id'], 'kiwi_shortcode_networks', true ),
201
- 'style' => get_post_meta( $atts['id'], 'kiwi_shortcode_bar_style', true ),
202
- 'items' => get_post_meta( $atts['id'], 'kiwi_shortcode_list_item_style', true )
203
- );
204
- }
205
-
206
- $defaults = array(
207
- 'networks' => array(),
208
- 'style' => 'center',
209
- 'items' => 'rect'
210
- );
211
-
212
-
213
- $instance = wp_parse_args( $instance, $defaults );
214
- $bar = new Kiwi_Social_Share_View_Shortcode_Bar( $instance['networks'], $instance['style'], $instance['items'] );
215
-
216
- return $bar->generate_frontend_bar();
217
- }
218
-
219
- /**
220
- * @param null $atts
221
- * @param null $content
222
- *
223
- * @return mixed|null|string
224
- */
225
- public function kiwi_bar_simple( $atts = NULL, $content = NULL ) {
226
- $defaults = array(
227
- 'networks' => Kiwi_Social_Share_Helper::get_setting_value( 'networks_article_bar', array() ),
228
- 'style' => Kiwi_Social_Share_Helper::get_setting_value( 'article_bar_style', 'center' ),
229
- 'items' => Kiwi_Social_Share_Helper::get_setting_value( 'button_shape', 'rect' )
230
- );
231
-
232
- $bar = new Kiwi_Social_Share_View_Shortcode_Bar( $defaults['networks'], $defaults['style'], $defaults['items'] );
233
-
234
- return $bar->generate_frontend_bar();
235
- }
236
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ /**
8
+ * Class Kiwi_Social_Share_Shortcodes
9
+ */
10
+ class Kiwi_Social_Share_Shortcodes {
11
+
12
+ /**
13
+ * Kiwi_Social_Share_Shortcodes options.
14
+ *
15
+ * @var array
16
+ */
17
+ public $meta_options = array();
18
+
19
+ /**
20
+ * Kiwi_Social_Share_Shortcodes constructor.
21
+ *
22
+ * @param bool $advanced
23
+ */
24
+ public function __construct( $advanced = false ) {
25
+ if ( $advanced ) {
26
+ /**
27
+ * Add a custom post type for our shortcodes
28
+ */
29
+ add_action( 'init', array( $this, 'add_custom_post_type' ) );
30
+
31
+ /**
32
+ * Add a metabox and register settings for the shortcodes.
33
+ */
34
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
35
+
36
+ /**
37
+ * Save the metabox post datas.
38
+ */
39
+ add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );
40
+
41
+ /**
42
+ * Edit the columns from archive and add an identifier (easier to copy paste it where the user needs it)
43
+ */
44
+ add_filter( 'manage_edit-kiwi-shortcodes_columns', array( $this, 'kiwi_shortcode_columns' ) );
45
+ add_action( 'manage_kiwi-shortcodes_posts_custom_column', array( $this, 'kiwi_shortcode_column' ), 10, 2 );
46
+ }
47
+
48
+ // Call this function to set the value to $meta_options.
49
+ $this->set_meta_options();
50
+
51
+ add_shortcode( 'kiwi-social-bar', array( $this, 'kiwi_bar_shortcode' ) );
52
+ }
53
+
54
+ /**
55
+ * Define the arrays for the meta boxes.
56
+ */
57
+ public function set_meta_options() {
58
+
59
+ $id = '';
60
+ $post_id = array();
61
+ if ( ! empty( $_GET ) && ! empty( $_GET['post'] ) ) {
62
+ $id = absint( $_GET['post'] );
63
+
64
+ /**
65
+ * Add shortcode fields.
66
+ *
67
+ * This field is used as an identifier (user copies/pastes this content where he needs it).
68
+ */
69
+ $post_id[] = array(
70
+ 'name' => esc_html__( 'Shortcode list item style', 'kiwi-social-share' ),
71
+ 'id' => 'kiwi_shortcode_identifier',
72
+ 'type' => 'text',
73
+ 'default' => '[kiwi-social-bar id="' . absint( $id ) . '"]',
74
+ 'attributes' => array(
75
+ 'readonly' => 'readonly',
76
+ ),
77
+ );
78
+ }
79
+
80
+ $this->meta_options = array(
81
+ /**
82
+ * Shortcode networks fields ( multicheck ).
83
+ */
84
+ array(
85
+ 'name' => esc_html__( 'Shortcode networks', 'kiwi-social-share' ),
86
+ 'id' => 'kiwi_shortcode_networks',
87
+ 'type' => 'multicheck',
88
+ 'options' => array(
89
+ 'facebook' => esc_html__( 'Facebook', 'kiwi-social-share' ),
90
+ 'twitter' => esc_html__( 'Twitter', 'kiwi-social-share' ),
91
+ 'linkedin' => esc_html__( 'LinkedIn', 'kiwi-social-share' ),
92
+ 'pinterest' => esc_html__( 'Pinterest', 'kiwi-social-share' ),
93
+ /* start-pro-version */
94
+ 'reddit' => esc_html__( 'Reddit', 'kiwi-social-share' ),
95
+ 'email' => esc_html__( 'Email', 'kiwi-social-share' ),
96
+ 'skype' => esc_html__( 'Skype', 'kiwi-social-share' ),
97
+ 'telegram' => esc_html__( 'Telegram', 'kiwi-social-share' ),
98
+ 'whatsapp' => esc_html__( 'WhatsApp', 'kiwi-social-share' ),
99
+ /* end-pro-version */
100
+ ),
101
+ ),
102
+
103
+ /**
104
+ * Shortcode bar style.
105
+ */
106
+ array(
107
+ 'name' => esc_html__( 'Shortcode bar style', 'kiwi-social-share' ),
108
+ 'id' => 'kiwi_shortcode_bar_style',
109
+ 'type' => 'radio',
110
+ 'default' => 'fit',
111
+ 'options' => array(
112
+ 'fit' => esc_html__( 'Fit', 'kiwi-social-share' ),
113
+ 'center' => esc_html__( 'Center', 'kiwi-social-share' ),
114
+ ),
115
+ ),
116
+
117
+ /**
118
+ * Shortcode list item styles.
119
+ */
120
+ array(
121
+ 'name' => esc_html__( 'Shortcode list item style', 'kiwi-social-share' ),
122
+ 'id' => 'kiwi_shortcode_list_item_style',
123
+ 'type' => 'radio',
124
+ 'default' => 'rect',
125
+ 'options' => array(
126
+ 'rect' => esc_html__( 'Rectangular', 'kiwi-social-share' ),
127
+ 'leaf' => esc_html__( 'Leaf', 'kiwi-social-share' ),
128
+ 'shift' => esc_html__( 'Shift', 'kiwi-social-share' ),
129
+ 'pill' => esc_html__( 'Pill', 'kiwi-social-share' ),
130
+ ),
131
+ ),
132
+ );
133
+
134
+ $this->meta_options = array_merge( $post_id, $this->meta_options );
135
+
136
+ }
137
+
138
+ /**
139
+ * Adds the required metaboxes.
140
+ */
141
+ public function add_meta_boxes() {
142
+
143
+ // Add meta box for shortcode options.
144
+ add_meta_box(
145
+ 'kiwi_shortcode_metabox',
146
+ esc_html__( 'Kiwi Shortcode Meta', 'kiwi-social-share' ),
147
+ array( $this, 'kiwi_shortcode_metabox' ),
148
+ array( 'kiwi-shortcodes' ),
149
+ 'advanced'
150
+ );
151
+
152
+ }
153
+
154
+ /**
155
+ * Add meta box for shortcode options.
156
+ *
157
+ * @param WP_Post $post The post object.
158
+ */
159
+ public function kiwi_shortcode_metabox( $post ) {
160
+
161
+ // Add an nonce field so we can check for it later.
162
+ wp_nonce_field( 'kiwi_shortcode_metabox', 'kiwi_shortcode_metabox_nonce' );
163
+
164
+ $output = '';
165
+ $meta_options = $this->meta_options;
166
+
167
+ foreach ( $meta_options as $meta_option ) {
168
+ $default = isset( $meta_option['default'] ) ? $meta_option['default'] : false;
169
+ $meta_value = get_post_meta( $post->ID, $meta_option['id'], true );
170
+ ?>
171
+ <div class="kiwi-metabox kss-row">
172
+ <?php
173
+ switch ( $meta_option['type'] ) {
174
+
175
+ case 'text':
176
+ // Display in the form options.
177
+ ?>
178
+ <div class="kss-label">
179
+ <label for="<?php echo esc_attr( $meta_option['id'] ); ?>">
180
+ <?php echo esc_html( $meta_option['name'] ); ?>
181
+ </label>
182
+ </div>
183
+
184
+ <div class="kss-options">
185
+ <?php
186
+ if ( isset( $meta_option['attributes']['readonly'] ) && $meta_option['attributes']['readonly'] ) {
187
+ $text_value = $default;
188
+ $readonly = 'readonly';
189
+ } else {
190
+ $text_value = $meta_value;
191
+ $readonly = '';
192
+ }
193
+ ?>
194
+
195
+ <input type="text" class="regular-text" id="<?php echo esc_attr( $meta_option['id'] ); ?>" name="<?php echo esc_attr( $meta_option['id'] ); ?>" value="<?php echo esc_attr( $text_value ); ?>" <?php echo esc_attr( $readonly ); ?> />
196
+ </div>
197
+ <?php
198
+ break;
199
+
200
+ case 'radio':
201
+ // Display in the form options.
202
+ ?>
203
+ <div class="kss-label">
204
+ <label for="<?php echo esc_attr( $meta_option['id'] ); ?>">
205
+ <?php echo esc_html( $meta_option['name'] ); ?>
206
+ </label>
207
+ </div>
208
+
209
+ <div class="kss-options">
210
+ <ul class="kss-radio-list">
211
+ <?php
212
+ foreach ( (array) $meta_option['options'] as $key => $option ) {
213
+ if ( $key === $default ) {
214
+ $checked = checked( $default, $key, false );
215
+ } else {
216
+ $checked = checked( $meta_value, $key, false );
217
+ }
218
+ ?>
219
+
220
+ <li>
221
+ <input type="radio" id="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $meta_option['id'] ); ?>" value="<?php echo esc_attr( $key ); ?>" <?php echo $checked; ?> />
222
+
223
+ <label for="<?php echo esc_attr( $key ); ?>">
224
+ <?php echo esc_html( $option ); ?>
225
+ </label>
226
+ </li>
227
+ <?php } ?>
228
+ </ul>
229
+ </div>
230
+ <?php
231
+ break;
232
+
233
+ case 'multicheck':
234
+ // Display in the form options.
235
+ ?>
236
+ <div class="kss-label">
237
+ <label for="<?php echo esc_attr( $meta_option['id'] ); ?>">
238
+ <?php echo esc_html( $meta_option['name'] ); ?>
239
+ </label>
240
+ </div>
241
+
242
+ <div class="kss-options">
243
+ <ul class="kss-checkbox-list">
244
+ <p class="kss-toggle-wrapper">
245
+ <span class="button-secondary kss-multicheck-toggle">
246
+ <?php esc_html_e( 'Select / Deselect All', 'kiwi-social-share' ); ?>
247
+ </span>
248
+ </p>
249
+
250
+ <?php
251
+ foreach ( (array) $meta_option['options'] as $key => $option ) {
252
+ $checked = '';
253
+ foreach ( (array) $meta_value as $social_network ) {
254
+ if ( $key === $social_network ) {
255
+ $checked = checked( $social_network, $key, false );
256
+ }
257
+ }
258
+ ?>
259
+
260
+ <li>
261
+ <input type="checkbox" class="kss-multicheck" id="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $meta_option['id'] . '[]' ); ?>" value="<?php echo esc_attr( $key ); ?>"<?php echo $checked; ?> />
262
+
263
+ <label for="<?php echo esc_attr( $key ); ?>">
264
+ <?php echo esc_html( $option ); ?>
265
+ </label>
266
+ </li>
267
+ <?php } ?>
268
+
269
+ </ul>
270
+ </div>
271
+ <?php
272
+ break;
273
+
274
+ }
275
+ ?>
276
+ </div>
277
+ <?php
278
+ }
279
+
280
+ }
281
+
282
+ /**
283
+ * Fires once a post has been saved.
284
+ *
285
+ * @param int $post_id Post ID.
286
+ * @param WP_Post $post Post object.
287
+ */
288
+ public function save_post( $post_id, $post ) {
289
+
290
+ $post_id = absint( $post_id );
291
+
292
+ // Return if $post_id and $post are not available.
293
+ if ( empty( $post_id ) || empty( $post ) ) {
294
+ return;
295
+ }
296
+
297
+ // Return the metabox saves for revisions and autosaves.
298
+ if ( defined( 'DOING_AUTOSAVE' ) || is_int( wp_is_post_revision( $post ) ) || is_int( wp_is_post_autosave( $post ) ) ) {
299
+ return;
300
+ }
301
+
302
+ // Return if nonce is not set and is not valid.
303
+ if ( empty( $_POST['kiwi_shortcode_metabox_nonce'] ) || ! wp_verify_nonce( wp_unslash( $_POST['kiwi_shortcode_metabox_nonce'] ), 'kiwi_shortcode_metabox' ) ) {
304
+ return;
305
+ }
306
+
307
+ // Return if it's being saved in other posts.
308
+ if ( empty( $_POST['post_ID'] ) || absint( $_POST['post_ID'] ) !== $post_id ) {
309
+ return;
310
+ }
311
+
312
+ // Check if the user has permission to edit or not.
313
+ if ( isset( $_POST['post_type'] ) ) {
314
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
315
+ return $post_id;
316
+ }
317
+ }
318
+
319
+ $meta_options = $this->meta_options;
320
+ foreach ( $meta_options as $meta_option ) {
321
+ $default = isset( $meta_option['default'] ) ? $meta_option['default'] : false;
322
+
323
+ switch ( $meta_option['type'] ) {
324
+
325
+ case 'text':
326
+ // Get the required form datas.
327
+ $text_value = isset( $_POST[ $meta_option['id'] ] ) ? sanitize_text_field( $_POST[ $meta_option['id'] ] ) : $default;
328
+
329
+ // Save the datas in the database.
330
+ if ( $text_value ) {
331
+ update_post_meta( $post_id, $meta_option['id'], sanitize_text_field( $text_value ) );
332
+ } else {
333
+ delete_post_meta( $post_id, $meta_option['id'] );
334
+ }
335
+ break;
336
+
337
+ case 'radio':
338
+ // Get the required form datas.
339
+ $radio_value = isset( $_POST[ $meta_option['id'] ] ) ? sanitize_key( $_POST[ $meta_option['id'] ] ) : $default;
340
+ $array_keys = array_keys( $meta_option['options'] );
341
+
342
+ // Save the datas in the database.
343
+ if ( in_array( $radio_value, $array_keys, true ) ) {
344
+ update_post_meta( $post_id, $meta_option['id'], sanitize_key( $radio_value ) );
345
+ } else {
346
+ update_post_meta( $post_id, $meta_option['id'], $default );
347
+ }
348
+ break;
349
+
350
+ case 'multicheck':
351
+ // Get the required form datas.
352
+ $multicheck_value = isset( $_POST[ $meta_option['id'] ] ) ? wp_unslash( $_POST[ $meta_option['id'] ] ) : array();
353
+ $array_keys = array_keys( $meta_option['options'] );
354
+
355
+ $selected_networks = array();
356
+ foreach ( (array) $multicheck_value as $checked_values ) {
357
+ $selected_networks[] = $checked_values;
358
+
359
+ // Save the datas in the database.
360
+ if ( in_array( $checked_values, $array_keys, true ) ) {
361
+ update_post_meta( $post_id, $meta_option['id'], wp_unslash( $selected_networks ) );
362
+ }
363
+ }
364
+
365
+ // Delete the datas in the database if array is empty.
366
+ if ( empty( $multicheck_value ) ) {
367
+ update_post_meta( $post_id, $meta_option['id'], array() );
368
+ }
369
+ break;
370
+
371
+ }
372
+ }
373
+
374
+ }
375
+
376
+ /**
377
+ * Register the custom post type
378
+ */
379
+ public function add_custom_post_type() {
380
+ register_post_type(
381
+ 'kiwi-shortcodes',
382
+ array(
383
+ 'labels' => array(
384
+ 'name' => esc_html__( 'Kiwi Shortcodes', 'kiwi-social-share' ),
385
+ 'singular_name' => esc_html__( 'Kiwi Shortcode', 'kiwi-social-share' ),
386
+ 'not_found' => esc_html__( 'No Kiwi Shortcodes found', 'kiwi-social-share' ),
387
+ 'not_found_in_trash' => esc_html__( 'No Kiwi Shortcodes found in trash', 'kiwi-social-share' ),
388
+ ),
389
+ 'menu_icon' => 'dashicons-share-alt',
390
+ 'supports' => array( 'title' ),
391
+ 'public' => false,
392
+ 'exclude_from_search' => true,
393
+ 'show_ui' => true,
394
+ 'show_in_menu' => false,
395
+ 'has_archive' => false,
396
+ )
397
+ );
398
+ }
399
+
400
+ /**
401
+ * Customize the identifier column.
402
+ *
403
+ * @param $column
404
+ * @param $post_id
405
+ *
406
+ */
407
+ public function kiwi_shortcode_column( $column, $post_id ) {
408
+ printf( '[kiwi-social-bar id="%s"]', $post_id );
409
+ }
410
+
411
+ /**
412
+ * Customize the kiwi shortcode columns.
413
+ *
414
+ * @param $columns
415
+ *
416
+ * @return array
417
+ */
418
+ public function kiwi_shortcode_columns( $columns ) {
419
+ $columns = array(
420
+ 'cb' => '<input type="checkbox" />',
421
+ 'title' => esc_html__( 'Shortcode', 'kiwi-social-share' ),
422
+ 'identifier' => esc_html__( 'Identifier', 'kiwi-social-share' ),
423
+ 'date' => esc_html__( 'Date', 'kiwi-social-share' ),
424
+ );
425
+
426
+ return $columns;
427
+ }
428
+
429
+ /**
430
+ * @param null $atts
431
+ * @param null $content
432
+ *
433
+ * @return mixed|null|string
434
+ */
435
+ public function kiwi_bar_shortcode( $atts = null, $content = null ) {
436
+ $instance = array(
437
+ 'networks' => Kiwi_Social_Share_Helper::get_setting_value( 'networks_article_bar', array() ),
438
+ 'style' => Kiwi_Social_Share_Helper::get_setting_value( 'article_bar_style', 'center' ),
439
+ 'items' => Kiwi_Social_Share_Helper::get_setting_value( 'button_shape', 'rect' ),
440
+ );
441
+
442
+ if ( ! empty( $atts ) ) {
443
+ $instance = array(
444
+ 'networks' => get_post_meta( $atts['id'], 'kiwi_shortcode_networks', true ),
445
+ 'style' => get_post_meta( $atts['id'], 'kiwi_shortcode_bar_style', true ),
446
+ 'items' => get_post_meta( $atts['id'], 'kiwi_shortcode_list_item_style', true ),
447
+ );
448
+ }
449
+
450
+ $defaults = array(
451
+ 'networks' => array(),
452
+ 'style' => 'center',
453
+ 'items' => 'rect',
454
+ );
455
+
456
+
457
+ $instance = wp_parse_args( $instance, $defaults );
458
+ $bar = new Kiwi_Social_Share_View_Shortcode_Bar( $instance['networks'], $instance['style'], $instance['items'] );
459
+
460
+ return $bar->generate_frontend_bar();
461
+ }
462
+
463
+ /**
464
+ * @param null $atts
465
+ * @param null $content
466
+ *
467
+ * @return mixed|null|string
468
+ */
469
+ public function kiwi_bar_simple( $atts = null, $content = null ) {
470
+ $defaults = array(
471
+ 'networks' => Kiwi_Social_Share_Helper::get_setting_value( 'networks_article_bar', array() ),
472
+ 'style' => Kiwi_Social_Share_Helper::get_setting_value( 'article_bar_style', 'center' ),
473
+ 'items' => Kiwi_Social_Share_Helper::get_setting_value( 'button_shape', 'rect' )
474
+ );
475
+
476
+ $bar = new Kiwi_Social_Share_View_Shortcode_Bar( $defaults['networks'], $defaults['style'], $defaults['items'] );
477
+
478
+ return $bar->generate_frontend_bar();
479
+ }
480
+ }
includes/lib/cmb2/CHANGELOG.md DELETED
@@ -1,863 +0,0 @@
1
- # Changelog
2
- All notable changes to this project will be documented in this file.
3
-
4
- ## Unreleased
5
-
6
- ## [2.9.0 - 2020-03-21](https://github.com/CMB2/CMB2/releases/tag/v2.9.0)
7
-
8
- ### Enhancements
9
- * Added `cmb2_tab_group_tabs` filter for adding arbitrary menu page urls to the cmb2 tabs, and move tab markup output to separate method, `CMB2_Options_Hookup::options_page_tab_nav_output()`. Fixes [#1407](https://github.com/CMB2/CMB2/issues/1407).
10
- * Limit use of italic, including removing from field descriptions. Fixes [#1404](https://github.com/CMB2/CMB2/issues/1404).
11
- * Add to list of valid image types from `get_allowed_mime_types()`, which makes SVGs more reliable when using the [Safe SVG](https://wordpress.org/plugins/safe-svg/) plugin. Fixes [#1223](https://github.com/CMB2/CMB2/issues/1223).
12
-
13
- ### Bug Fixes
14
- * Fixes PHP warnings on repeatable ColorPicker with an array as default. Props [@rubengc](https://github.com/rubengc) ([#1340](https://github.com/CMB2/CMB2/pull/1340)).
15
- * Address PHP 7.4, compatibility issues with `func_get_args()`. Fixes [#1389](https://github.com/CMB2/CMB2/issues/1389).
16
- * Better generated array key for cached fields, fixes issue where wrong field is found. Fixes [#14053](https://github.com/CMB2/CMB2/issues/14053).
17
- * Fix issue with options-pages being changed to register on a hook priority of `5` instead of the default `10`, causing some back-compatibility issues. Fixes [#1410](https://github.com/CMB2/CMB2/issues/1410).
18
-
19
- ## [2.8.0 - 2020-01-21](https://github.com/CMB2/CMB2/releases/tag/v2.8.0)
20
-
21
- ### Enhancements
22
- * Added [CODE_OF_CONDUCT.md](https://github.com/CMB2/CMB2/blob/develop/CODE_OF_CONDUCT.md) file to meet GitHub Community standards. Props [@RubenMartins](https://github.com/RubenMartins) ([#1331](https://github.com/CMB2/CMB2/pull/1331)).
23
- * Add ability to define the page-registration admin menu hook priority for options pages. Fixes [#1380](https://github.com/CMB2/CMB2/issues/1380).
24
-
25
- ### Bug Fixes
26
- * Ensure `enqueue wp-color-picker` is enqueued for color fields. Props [@rubengc](https://github.com/rubengc) ([#1339](https://github.com/CMB2/CMB2/pull/1339)).
27
- * Fix empty name/id attributes on `'file_list'` buttons. Props [@pgroot91](https://github.com/pgroot91) ([#1347](https://github.com/CMB2/CMB2/pull/1347)).
28
- * Fix `wysiwyg` field type not working in a group, by ensuring scripts properly enqueued. Props [@yoren](https://github.com/yoren) ([#1361](https://github.com/CMB2/CMB2/pull/1361)).
29
- * Fix `$object_id` doc block types in helper-functions.php. Fixes [#1365](https://github.com/CMB2/CMB2/issues/1365).
30
- * Fix Metabox toggles visually broken with WP 5.5.x. Fixes [#1382](https://github.com/CMB2/CMB2/issues/1382).
31
- * Fix `PHP Deprecated: Required parameter $field_id follows optional parameter $type`, due to changes in PHP 8.0. Fixes [#1396](https://github.com/CMB2/CMB2/issues/1396).
32
- * Fix PHP notice caused by `deprecated_param` method in PHP 7.4. Props [@jonathanstegall](https://github.com/jonathanstegall) ([#1400](https://github.com/CMB2/CMB2/pull/1400)).
33
-
34
- ## [2.7.0 - 2020-01-21](https://github.com/CMB2/CMB2/releases/tag/v2.7.0)
35
-
36
- ### Enhancements
37
- * Added support for sortable columns by default, with ability to disable with `'column' => array( 'disable_sortable' => true )`. Props [@RubenMartins](https://github.com/RubenMartins) ([#1281](https://github.com/CMB2/CMB2/pull/1281)).
38
- * New field type, `'taxonomy_select_hierarchical'`. Fixes [#751](https://github.com/CMB2/CMB2/issues/751)
39
- * New `text`, `textarea` and `wysiwyg` character counter options. For now, this feature is not available to `wysiwyg` field types within repeatable groups. Props [@gyrus](https://github.com/gyrus) ([#1276](https://github.com/CMB2/CMB2/pull/1276)).
40
- - The new parameters:
41
- - `'char_counter'` - Defaults to false, no counter. Set to true, or `words` to count words instead of characters.
42
- - `'char_max'` - integer. When defined, counter shows remaining characters/words.
43
- - `'char_max_enforce'` - boolean, default: false. Currently only applied (as maxlength attribute) to `text` and `textarea` fields which use `'characters'` for counter.
44
- - You can also [override the default text strings](https://github.com/CMB2/CMB2/wiki/Field-Parameters#text) associated with these parameters:
45
- - `'words_left_text'` - Default: "Words left"
46
- - `'words_text'` - Default: "Words"
47
- - `'characters_left_text'` - Default: "Characters left"
48
- - `'characters_text'` - Default: "Characters"
49
- - `'characters_truncated_text'` - Default: "Your text may be truncated."
50
- * Update styling to be more compatible with WordPress 5.3. Props [@galengidman](https://github.com/galengidman) ([#1314](https://github.com/CMB2/CMB2/pull/1314))
51
- * Add a new box parameter, `register_rest_field_cb`, which when used allows overriding the way CMB2 handles the `register_rest_field` callbacks, and defining your own REST prefix for your fields. See [this PR comment](https://github.com/CMB2/CMB2/pull/1240#issuecomment-552548488) for more context.
52
- * Cleanup by renaming `CMB2_hookup` to `CMB2_Hookup`. Classes are case-insensitive, so this is a backwards-compatible change. Props [@szepeviktor](https://github.com/szepeviktor) ([#1330](https://github.com/CMB2/CMB2/pull/1330), [#1328](https://github.com/CMB2/CMB2/issues/1328)).
53
- * Validate composer.json for Travis CI. Props [@szepeviktor](https://github.com/szepeviktor) ([#1326](https://github.com/CMB2/CMB2/pull/1326)).
54
- * Added [LICENSE](https://github.com/CMB2/CMB2/blob/develop/LICENSE) file to meet GitHub Community standards. Props [@RubenMartins](https://github.com/RubenMartins) ([#1316](https://github.com/CMB2/CMB2/pull/1316)).
55
- * Add new `"cmb2_display_class_{$fieldtype}"` filter and `'display_class'` field parameter to allow specifying the class to use to display the field (in admin columns, etc).
56
- * Update `CMB2_Types::_id()` to allow not appending the iterator attribute if a repeatable field.
57
- * Added `CMB2_Utils::concat_attrs()` test for nested arrays as data attributes.
58
- * Various updates per [VIP feedback](https://github.com/CMB2/CMB2/issues/1260). Props [@kevinlangleyjr](https://github.com/kevinlangleyjr), [@mikeselander](https://github.com/mikeselander) ([#1255](https://github.com/CMB2/CMB2/pull/1255), [#1257](https://github.com/CMB2/CMB2/pull/1257), [#1259](https://github.com/CMB2/CMB2/pull/1259), [#1261](https://github.com/CMB2/CMB2/pull/1261) [#1262](https://github.com/CMB2/CMB2/pull/1262), and various direct commits. See [#1260](https://github.com/CMB2/CMB2/issues/1260)).
59
-
60
-
61
- ### Bug Fixes
62
- * Fix some issues with Travis. Props [@anhskohbo](https://github.com/anhskohbo) ([#1220](https://github.com/CMB2/CMB2/pull/1220)).
63
- * Javascript: Correctly pass the newly created row to the `cmb2_add_row` triggered event.
64
- * Various code-formatting and code documentation improvements. Props [@tw2113](https://github.com/tw2113).
65
- * Don't exclude composer.json from the distribution. Props [@johnbillion](https://github.com/johnbillion) ([#1225](https://github.com/CMB2/CMB2/pull/1225)).
66
- * Ignore some more directories in the distribution package. Props [@johnbillion](https://github.com/johnbillion) ([#1226](https://github.com/CMB2/CMB2/pull/1226)).
67
- * Use `CMB2_Field::get_rest_value()` to get values for fields in the post REST API endpoints ([#1284](https://github.com/CMB2/CMB2/issues/1284)).
68
- * Fix issue where oEmbed fields' live-preview would not work if the field was added within a group, along with some other similarly related issues. Fixes [#1157](https://github.com/CMB2/CMB2/issues/1157).
69
- * Fix issue when using REST API for `file` and `text_datetime_timestamp_timezone` field types, the supporting field data was not provided (e.g. the file id for `file` field, and the `utc` value for the `text_datetime_timestamp_timezone` field). Fixes [https://wordpress.org/support/topic/cmb2-rest-api-image-file-field-as-an-object/](https://wordpress.org/support/topic/cmb2-rest-api-image-file-field-as-an-object/).
70
- * Escaping Improvements to File Base and File Fields. Props [@tomjn](https://github.com/tomjn) ([#1296](https://github.com/CMB2/CMB2/pull/1296), [#1297](https://github.com/CMB2/CMB2/pull/1297)).
71
- * Fix issue where repeatable CodeMirror textareas could not be clicked/draggged to highlight text. Props [@JPry](https://github.com/JPry) ([#1300](https://github.com/CMB2/CMB2/pull/1300)).
72
- * `taxonomy_select_hierarchical` now saves to the correct location, the term relationships table. Props [@latheva](https://github.com/latheva) ([#1307](https://github.com/CMB2/CMB2/pull/1307)).
73
- * Fix issue ([#1158](https://github.com/CMB2/CMB2/issues/1158)) where default REST API endpoints (e.g. `/wp/v2/{post_type}`) would show all boxes for all custom post types even though not registered to the post-type. Props [@Mte90](https://github.com/Mte90) ([#1238](https://github.com/CMB2/CMB2/pull/1238)).
74
- * Update and cull npm dependencis. Fixes [#1308](https://github.com/CMB2/CMB2/issues/1308).
75
- * Fix some jshint issues.
76
- * Updated the WordPress embeds URL references.
77
- * Updates to account for WordPress 5.2 oEmbed changes.
78
- * Fix to ensure date picker fields can have a default value. Fixes [#1245](https://github.com/CMB2/CMB2/issues/1245).
79
- * Added `function_exists( 'add_action' )` check to bootstrap file to ensure compatibility with composer usage. Props [@salcode](https://github.com/salcode) ([#1271](https://github.com/CMB2/CMB2/pull/1271), [#1270](https://github.com/CMB2/CMB2/issues/1270))
80
- * Corrected link to facetwp-cmb2 in README.md. Props [@marcelreschke](https://github.com/marcelreschke) ([#1248](https://github.com/CMB2/CMB2/pull/1248)).
81
- * Use `get_user_locale()` in admin area instead of `get_locale()`. Fixes [#1267](https://github.com/CMB2/CMB2/issues/1267).
82
- * `CMB2::is_box_type()` now also checks for taxonomies if box is registered to "term" object type. This should fix some issues where CMB2 term meta was not showing up in REST API requests to the term endpoints.
83
-
84
-
85
- ## [2.6.0 - 2019-01-18](https://github.com/CMB2/CMB2/releases/tag/v2.6.0)
86
-
87
- ### Enhancements
88
-
89
- * Updated PHPUnit version in composer.json. Props [@slaFFik](https://github.com/slaFFik) ([#1204](https://github.com/CMB2/CMB2/pull/1204)).
90
- * Package.json: fix the need of global (old) grunt. Props [@slaFFik](https://github.com/slaFFik) ([#1206](https://github.com/CMB2/CMB2/pull/1206)).
91
- * Add optional confirmation dialog to group field's Remove button. Example [documented in the example functions file](https://github.com/CMB2/CMB2/blob/12036e2dcdeb5b019e844b814eca154bb0eee791/example-functions.php#L525). Props [@slaFFik](https://github.com/slaFFik) ([#1208](https://github.com/CMB2/CMB2/pull/1208)).
92
- * Add 'id' attribute on group field `.postbox` divs to ensure compatibility with scripts which expect ids there. Props [@amans2k](https://github.com/amans2k) ([#1108](https://github.com/CMB2/CMB2/pull/1108)).
93
- * Make `CMB2_Option` properties accessible. ([#1052](https://github.com/CMB2/CMB2/issues/1052))
94
- * New Before/After row hooks: `'cmb2_before_field_row'`, `"cmb2_before_{$field_type}_field_row"`, `"cmb2_after_{$field_type}_field_row"`, `'cmb2_after_field_row'`. Props [@rubengc](https://github.com/rubengc) ([#953](https://github.com/CMB2/CMB2/pull/953)).
95
- * Introduce three new filters to filter field arguments: `'cmb2_field_defaults'`, `'cmb2_field_arguments_raw'`, `'cmb2_field_arguments'`. Props [@jrfnl](https://github.com/jrfnl) ([#588](https://github.com/CMB2/CMB2/pull/588)).
96
-
97
-
98
- ### Bug Fixes
99
- * Remove superfluous method definitions. Props [@tnorthcutt](https://github.com/tnorthcutt) ([#1200](https://github.com/CMB2/CMB2/pull/1200)).
100
- * Fix `rest_value_cb` registering of filter. Props [@lipemat](https://github.com/lipemat) ([#1212](https://github.com/CMB2/CMB2/pull/1212)).
101
- * Do not trigger tinyMCE editor save for the activeEditor. Prevents cursor jump in Gutenberg. Fixes [#1202](https://github.com/CMB2/CMB2/issues/1202)
102
- * Fix issue where making a field repeatable would generate a Javascript error because of missing sortable library. Props [@slaFFik](https://github.com/slaFFik) ([#1216](https://github.com/CMB2/CMB2/pull/1216)).
103
- * Ensure value passed to `CMB2_Utils::filter_empty` from `CMB2::save_group_field` is always an array. ([#1026](https://github.com/CMB2/CMB2/issues/1026))
104
- * Fix potential issue with test path location. Props [@quasel](https://github.com/quasel) ([#463](https://github.com/CMB2/CMB2/pull/463)).
105
-
106
- ## [2.5.1 - 2018-12-10](https://github.com/CMB2/CMB2/releases/tag/v2.5.1)
107
-
108
- ### Bug Fixes
109
- * Fix issue when the `core/editor` object does not exist (is undefined), causing incompatibility issues with Yoast and likely others. Fixes [#1197](https://github.com/CMB2/CMB2/issues/1197)
110
-
111
- ## [2.5.0 - 2018-12-08](https://github.com/CMB2/CMB2/releases/tag/v2.5.0)
112
-
113
- ### Enhancements
114
-
115
- * Repeatable fields are now drag-sortable. Props [@lipemat](https://github.com/lipemat) ([#1142](https://github.com/CMB2/CMB2/pull/1142)).
116
- * Update the `sv_SE` translation. Props [@edvind](https://github.com/edvind) ([#370](https://github.com/CMB2/CMB2/pull/370)).
117
- * QA/PHPCS cleanup. Props [@tw2113](https://github.com/tw2113) ([#1179](https://github.com/CMB2/CMB2/pull/1179)).
118
- * Add optional `'mb_callback_args'` CMB2 box property which allows defining the `$callback_args` passed into `add_meta_box()`. This allows using defining the new [Gutenberg/block-editor compatibility parameters](https://wordpress.org/gutenberg/handbook/extensibility/meta-box/). Fixes [#1191](https://github.com/CMB2/CMB2/issues/1191)
119
- * Support any type of markup when customizing repeating group row. Props [@lipemat](https://github.com/lipemat) ([#1187](https://github.com/CMB2/CMB2/pull/1187)).
120
- * Add `cmb_init_pickers` and `cmb_init_code_editors` Javascript events for allowing just-in-time configuration for pickers/editors.
121
- * Fix field descriptions color contrast ratio for better accessibility. h/t [@rianrietveld](https://github.com/rianrietveld). Fixes [#1193](https://github.com/CMB2/CMB2/issues/1193).
122
- * Add `CMB2_Field::get_rest_value()` method for sending value through several filters (`'cmb2_get_rest_value'`, `"cmb2_get_rest_value_{$field_type}"`, `"cmb2_get_rest_value_for_{$field_id}"` ) before sending to REST request.
123
-
124
- ### Bug Fixes
125
-
126
- * Fix the options page errors when using CMB2 in WordPress prior to 4.7. Props [@manzoorwanijk](https://github.com/manzoorwanijk) ([#1166](https://github.com/CMB2/CMB2/pull/1166)).
127
- * Fix occasonal fatal errors that can occur by using callback functions directly vs `call_user_func`. Props [@manzoorwanijk](https://github.com/manzoorwanijk) ([#1177](https://github.com/CMB2/CMB2/pull/1177)).
128
- * Fix issue where `wysiwyg` fields' visual tab wouldn't save content on Gutenberg/block-editor posts. Props [@staurand](https://github.com/staurand) ([#1190](https://github.com/CMB2/CMB2/pull/1190) fixes [#1156](https://github.com/CMB2/CMB2/issues/1156)).
129
- * Fix issue when `remove_default` wouldn't actually remove the default taxonomy metabox when box registration used an alternate box context. Props [@lipemat](https://github.com/lipemat) ([#1147](https://github.com/CMB2/CMB2/pull/1147)).
130
-
131
- ## [2.4.2 - 2018-05-25](https://github.com/CMB2/CMB2/releases/tag/v2.4.2)
132
-
133
- ### Bug Fixes
134
-
135
- * Do not enqueue/register WordPress code editor JS if there are no `textarea_code` fields registered on the page. Fixes [#1110](https://github.com/CMB2/CMB2/issues/1110).
136
- * Do not set repeated `wysiwyg` field values to string "false" when boolean false. Fixes [#1138](https://github.com/CMB2/CMB2/issues/1138) (again!).
137
-
138
- ## [2.4.1 - 2018-05-25](https://github.com/CMB2/CMB2/releases/tag/v2.4.1)
139
-
140
- ### Bug Fixes
141
-
142
- * Do not set repeated field values to string "false" when boolean false. Fixes [#1138](https://github.com/CMB2/CMB2/issues/1138).
143
-
144
- ## [2.4.0 - 2018-05-24](https://github.com/CMB2/CMB2/releases/tag/v2.4.0)
145
-
146
- ### Enhancements
147
-
148
- * Enable linking options pages via tabbed-navigation. Will output tabbed navigation for options-pages which share the same `'tab_group'` CMB2 box property. [This snippet](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/options-and-settings-pages/options-pages-with-tabs-and-submenus.php) demonstrates how to create a top-level menu options page with multiple submenu pages, each with the tabbed navigation. To specify a different tab title than the options-page title, set the `'tab_title'` CMB2 box property. See [#301](https://github.com/CMB2/CMB2/issues/301), [#627](https://github.com/CMB2/CMB2/issues/627).
149
- * Complete the `zh-CN` translation. Props [@uicestone](https://github.com/uicestone) ([#1089](https://github.com/CMB2/CMB2/pull/1089)).
150
- * Update the `nl_NL` translation. Props [@tammohaannl](https://github.com/tammohaannl) ([#1101](https://github.com/CMB2/CMB2/pull/1101)).
151
- * Better display for white over transparent images (e.g. logos) by using a checkered background for images. ([#1103](https://github.com/CMB2/CMB2/issues/1103))
152
- * Ability to disable the options [autoload parameter](https://codex.wordpress.org/Function_Reference/add_option#Parameters) via filter (`"cmb2_should_autoload_{$options_key}"`) or via a box parameter for `'options-page'` box registrations (`'autoload' => false,`). ([#1093](https://github.com/CMB2/CMB2/issues/1093))
153
- * `'textarea_code'` field type now uses CodeMirror that is [used by WordPress](https://make.wordpress.org/core/2017/10/22/code-editing-improvements-in-wordpress-4-9/) ([#1096](https://github.com/CMB2/CMB2/issues/1096)). A field can opt-out to return to the previous behavior by specifying an `'options'` parameter:
154
- `'options' => array( 'disable_codemirror' => true )`
155
- As with the other javascript-enabled fields, the code-editor defaults can be overridden via a `data-codeeditor` attribute. E.g:
156
-
157
- ```php
158
- 'attributes' => array(
159
- 'data-codeeditor' => json_encode( array(
160
- 'codemirror' => array(
161
- 'mode' => 'css',
162
- ),
163
- ) ),
164
- ),
165
- ```
166
- * Improve/add comment info banners at top of CMB2 CSS files.
167
- * Added `resetBoxes`/`resetBox` Javascript methods for resetting CMB2 box forms.
168
- * Improved styles for fields in the new-term form.
169
- * New `CMB2_Boxes` methods for filtering instances of `CMB2`, `CMB2_Boxes::get_by( $property, $optional_compare )` and `CMB2_Boxes::filter_by( $property, $to_ignore = null )`.
170
-
171
- ### Bug Fixes
172
-
173
- * Fix the `'taxonomy_*'` fields when used for term fields/meta. Save the value to term-meta.
174
- * Clear the CMB2 fields when a term is added. Fixes [#794](https://github.com/CMB2/CMB2/issues/794).
175
- * Repeated fields now use registered field defaults for values. Fixes [#1137](https://github.com/CMB2/CMB2/issues/1137).
176
- * Fixed the formatting for deprecated messages in the log.
177
- * Prevent opening of media modal when clicking the file "Download" link. Fixes [#1130](https://github.com/CMB2/CMB2/issues/1130).
178
-
179
- ## [2.3.0 - 2017-12-20](https://github.com/CMB2/CMB2/releases/tag/v2.3.0)
180
-
181
- ### Enhancements
182
-
183
- * Updated Italian translation. Props [@Mte90](https://github.com/Mte90) ([#1067](https://github.com/CMB2/CMB2/issues/1067)).
184
- * Starting with this release, we are fully switching to the more communicative and standard [Semantic Versioning](https://semver.org/). ([#1061](https://github.com/CMB2/CMB2/issues/1061)).
185
-
186
- ### Bug Fixes
187
-
188
- * Update for compatibility with PHP 7.2 (e.g. fixes `Fatal error: Declaration of CMB2_Type_Colorpicker::render() must be compatible with CMB2_Type_Text::render($args = Array)...`). ([#1070](https://github.com/CMB2/CMB2/issues/1070), [#1074](https://github.com/CMB2/CMB2/issues/1074), [#1075](https://github.com/CMB2/CMB2/issues/1075)).
189
-
190
- ## [2.2.6.2 - 2017-11-24](https://github.com/CMB2/CMB2/releases/tag/v2.2.6.2)
191
-
192
- ### Bug Fixes
193
-
194
- * Fix another issue (introduced in 2.2.6) with repeatable fields not being able to save additional fields. Props [@anhskohbo](https://github.com/anhskohbo) ([#1059](https://github.com/CMB2/CMB2/pull/1059), [#1058](https://github.com/CMB2/CMB2/issues/1058)).
195
- * Only dequeue `jw-cmb2-rgba-picker-js` script (and enqueue our `wp-color-picker-alpha`) if it is actually found.
196
-
197
- ## [2.2.6.1 - 2017-11-24](https://github.com/CMB2/CMB2/releases/tag/v2.2.6.1)
198
-
199
- ### Enhancements
200
-
201
- * Merge in the [CMB2 RGBa Colorpicker](https://github.com/JayWood/CMB2_RGBa_Picker) field type functionality to the CMB2 colopicker field type. Adds the ability to add an alpha (transparency) slider to the colorpicker by adding the `'alpha'` option [to the field options array](https://github.com/CMB2/CMB2/blob/6fce2e7ba8f41345a23bc2064e30433bdb11c16c/example-functions.php#L263-L265). Thank you to [JayWood](https://github.com/JayWood) for his work on his custom field type.
202
-
203
- ### Bug Fixes
204
-
205
- * Fix issue (introduced in 2.2.6) with complex fields set as repeatable not being able to save additional fields. Fixes [#1054](https://github.com/CMB2/CMB2/issues/1054).
206
-
207
- ## [2.2.6 - 2017-11-14](https://github.com/CMB2/CMB2/releases/tag/v2.2.6)
208
-
209
- ### Enhancements
210
-
211
- * Move the fetching of group label and description to _after_ calling `'before_group'` parameter.
212
- * Allow using the `'render_row_cb'` param for group fields. Fixes [#1041](https://github.com/CMB2/CMB2/issues/1041).
213
- * Allow resetting cached CMB2 field objects (new 3rd parameter to `CMB2::get_field()`).
214
- * Allow resetting cached callback results (`CMB2_Base::unset_param_callback_cache()`).
215
- * Persian translation provided by [@reza-irdev](https://github.com/reza-irdev) ([#1046](https://github.com/CMB2/CMB2/issues/1046)).
216
- * Added a `'message_cb'` box property, which allows defining a custom callback for adding options-save messages on `options-page` boxes. An example has been added to [example-functions.php](https://github.com/CMB2/CMB2/commit/43d513c135e52c327bafa06309821c29323ae2dd#diff-378c74d0ffffc1759b8779a135476777).
217
- * Updated many the oembed-related unit tests to more reliably test the relevant parts, and not so much the actual success of the WordPress functions.
218
- * Updated travis config to Install PHP5.2/5.3 on trusty for unit tests. Stolen from [gutenberg/pull/2049](https://github.com/WordPress/gutenberg/pull/2049). Intended to compensate for Travis removing support for PHP 5.2/5.3.
219
-
220
- ### Bug Fixes
221
-
222
- * Ensure `'file'` field type ID is removed from the database if the `'file'` field type's value is empty ([Support thread](https://wordpress.org/support/topic/bug-field-of-type-file-does-not-delete-postmeta-properly/)).
223
- * Fix JS errors when `user_can_richedit()` is false ("Disable the visual editor when writing" user option is checked, or various unsupported browsers). See [#1031](https://github.com/CMB2/CMB2/pull/1031).
224
- * Fix issue where some European date formats (e.g. `F j, Y`) would not properly translate into jQuery UI date formats. [Support thread](https://wordpress.org/support/topic/using-wordpresss-date-time-format-settings)
225
- * Fix repeating fields within repeating groups having the values/indexes incorrectly associated. Props [@daggerhart](https://github.com/daggerhart) ([#1047](https://github.com/CMB2/CMB2/pull/1047)). Fixes [#1035](https://github.com/CMB2/CMB2/issues/1035), [#348](https://github.com/CMB2/CMB2/issues/348).
226
- * Fixed multiple update messages on settings pages when CMB2 option pages were registered ([#1049](https://github.com/CMB2/CMB2/issues/1049)).
227
- * Fix issue where using multiple oembed fields could cause incorrectly cached arguments to be used.
228
- * Fix bug where `'select_all_button' => false` was not working for `'taxonomy_multicheck'` field type ([#1005](https://github.com/CMB2/CMB2/issues/1005)).
229
-
230
- ## [2.2.5.3 - 2017-08-22](https://github.com/CMB2/CMB2/releases/tag/v2.2.5.3)
231
-
232
- ### Enhancements
233
-
234
- * Update to instead initate CMB2 hookup via `"cmb2_init_hookup_{$cmb_id}"` hook. Allows plugins to unhook/rehook/etc.
235
-
236
- ### Bug Fixes
237
-
238
- * Spelling/Grammar fixes. Props [@garrett-eclipse](https://github.com/garrett-eclipse) ([#1012](https://github.com/CMB2/CMB2/pull/1012)).
239
- * Fix "PHP Strict Standards: Static function should not be abstract" notice.
240
- * Add `CMB2_Utils::normalize_if_numeric()` to address problems when using floats as select/radio values. Fixes [#869](https://github.com/CMB2/CMB2/issues/869). See [#1013](https://github.com/CMB2/CMB2/pull/1013).
241
- * Fix issues with apostrophes in money values. (e.g. in Swiss German the thousand separator is an apostrophe). Props [@ocean90](https://github.com/ocean90) ([#1014](https://github.com/CMB2/CMB2/issues/1014), [#1015](https://github.com/CMB2/CMB2/pull/1015)).
242
- * Provide public access to the `CMB2_Options_Hookup::$option_key` property.
243
- * Change the updated-settings notice query variable so that WordPress does not auto-add settings notices on top of ours.
244
- * For settings pages, only output settings errors if WordPress does not do it by default (for sub-pages of `options-general.php`), and if the errors are not disabled via the `'disable_settings_errors'` box property.
245
-
246
- ## [2.2.5.2 - 2017-08-08](https://github.com/CMB2/CMB2/releases/tag/v2.2.5.2)
247
-
248
- ### Bug Fixes
249
-
250
- * Fix issue in 2.2.5 with non-sortable repeatable groups not having new groups values be emptied on creation/clone. [Support thread](https://wordpress.org/support/topic/the-default-parameter-dont-work-in-group-fields/page/2/)
251
- * Fix issue in 2.2.5 with options pages not saving when `'parent_slug'` box property was used. Fixes [#1008](https://github.com/CMB2/CMB2/issues/1008).
252
-
253
- ## [2.2.5.1 - 2017-08-07](https://github.com/CMB2/CMB2/releases/tag/v2.2.5.1)
254
-
255
- ### Bug Fixes
256
-
257
- * Fix issue in 2.2.5 which caused empty repeatable groups having the buttons set to have a disabled "Remove Group" button. [Support thread](https://wordpress.org/support/topic/the-default-parameter-dont-work-in-group-fields/)
258
-
259
- ## [2.2.5 - 2017-08-07](https://github.com/CMB2/CMB2/releases/tag/v2.2.5)
260
-
261
- ### Enhancements
262
-
263
- * Options pages are now first-class CMB2 citizens, and registering a box to show on an options page will automatically register the menu page and output the form on the page. [See example](https://github.com/CMB2/CMB2/blob/v2.2.5/example-functions.php#L640-L683). (The [snippets](https://github.com/CMB2/CMB2-Snippet-Library/tree/master/options-and-settings-pages) in the snippet library will be updated to reflect this change)
264
- * Improved Options Page styling. Props [@anhskohbo](https://github.com/anhskohbo) ([#1006](https://github.com/CMB2/CMB2/pull/1006)).
265
- * Improved cohesive styles for repeatable fields. Props [@anhskohbo](https://github.com/anhskohbo) ([#819](https://github.com/CMB2/CMB2/pull/819)).
266
- * New field types, `'taxonomy_radio_hierarchical'`, and `'taxonomy_multicheck_hierarchical'`, for displaying taxonomy options in a hierarchial layout. Props to [eriktelepovsky](https://github.com/eriktelepovsky) for the [working code](https://github.com/CMB2/CMB2/issues/640#issuecomment-246938690). ([#640](https://github.com/CMB2/CMB2/issues/640))
267
- * Removing last repeat item row (and repeat group row) is now somewhat allowed in that the "remove" button simply resets the last item to empty. Fixes [#312](https://github.com/CMB2/CMB2/issues/312).
268
- * Enable the additional media library modal filters. Fixes [#873](https://github.com/CMB2/CMB2/issues/873).
269
- * Sanitize the attributes added via the `cmb2_group_wrap_attributes` filter.
270
- * New field parameter, `'query_args'`, which can be used by the `'taxonomy_*'` fields. Provides ability to override the arguments passed to `get_terms()`.
271
- * The `cmb2_can_save` filter now passes the CMB2 object as the 2nd parameter. Props [@Arno33](https://github.com/Arno33) ([#994](https://github.com/CMB2/CMB2/pull/994)).
272
- * Update the file field type to work properly within a custom field context by allowing the passing of override arguments to `CMB2_Types::file()` method.
273
- * Many WordPress Code Standards improvements/updates. Props [@bradp](https://github.com/bradp)
274
- * Include absolute paths when including the core php files. Props [@anhskohbo](https://github.com/anhskohbo) ([#998](https://github.com/CMB2/CMB2/pull/998)).
275
- * Change language throught to reflect CMB2's move to its own organization.
276
- * Break `CMB2_Field:options()` method apart to allow re-setting options from field params. Related: [reaktivstudios/cmb2-flexible-content/pull/8](https://github.com/reaktivstudios/cmb2-flexible-content/pull/8).
277
- * New `CMB2:box_types()` method for getting the array of registered `'object_types'` for a box. Ensures the return is an array.
278
- * Improved inline hooks documentation.
279
- * Updated several CMB2 methods to return the CMB2 object (for method chaining). Methods include:
280
- * `CMB2::show_form()`
281
- * `CMB2::render_form_open()`
282
- * `CMB2::render_form_close()`
283
- * `CMB2::render_group_row()`
284
- * `CMB2::render_hidden_fields()`
285
- * `CMB2::save_fields()`
286
- * `CMB2::process_fields()`
287
- * `CMB2::process_field()`
288
- * `CMB2::pre_process()`
289
- * `CMB2::after_save()`
290
- * `CMB2::add_fields()`
291
-
292
- ### Bug Fixes
293
-
294
- * Update for `file`/`file_list` fields to properly show a preview for SVG images. Fixes [#874](https://github.com/CMB2/CMB2/pull/874).
295
- * Fix and standardize inconsistent button classes. Update all buttons to use the `.button-secondary` class instead of the `.button` class. This alleviates some front-end issues for themes which target the `.button` class. _This is a backwards-compatibility break._ If your theme or plugin targets the `.button` class within CMB2, you will need to update to use `.button-secondary`.
296
- * Correct the before/after form hooks order. For more details see ([#954](https://github.com/CMB2/CMB2/pull/954)).
297
- * Fix regression with custom fields not properly repeating. Props [@desrosj](https://github.com/desrosj) ([#969](https://github.com/CMB2/CMB2/pull/969)). Fixes [#901](https://github.com/CMB2/CMB2/issues/901).
298
- * Fix "Illegal string offset" notices when `CMB2_Option` methods are called when the option value is empty, as well as additional unit tests for the `CMB2_Option` class. Props [@anhskohbo](https://github.com/anhskohbo) ([#993](https://github.com/CMB2/CMB2/pull/993)).
299
- * Fix bug where select fields or checkbox fields occasionally would retain previous group's value when adding new groups. Fixes [#853](https://github.com/CMB2/CMB2/issues/853).
300
- * Fix JS to prevent meta keys with `|` or `/` from breaking file fields. Props [@lipemat](https://github.com/lipemat) ([#1003](https://github.com/CMB2/CMB2/pull/1003)).
301
- * Fix jQuery Migrate's `jQuery.fn.attr('value', val) no longer sets properties` warning.
302
- * Fix issue with CMB2 being too aggressive with stripping slashes from values. Fixes [#981](https://github.com/CMB2/CMB2/issues/981).
303
-
304
- ## [2.2.4 - 2017-02-27](https://github.com/CMB2/CMB2/releases/tag/v2.2.4)
305
-
306
- ### Enhancements
307
-
308
- * Modify `'taxonomy_*'` fields to return stored terms for non-post objects.
309
- * Modify `CMB2::get_sanitized_values()` to return the sanitized `'taxonomy_*'` field values. Also added `"cmb2_return_taxonomy_values_{$cmb_id}"` filter to modify if `'taxonomy_*'` field values are returned. Fixes [#538](https://github.com/CMB2/CMB2/issues/538).
310
- * Allow outputting CMB2 boxes/fields in additional locations in the post-editor.
311
-
312
- **The new locations are:** [`form_top`](https://developer.wordpress.org/reference/hooks/edit_form_top/), [`before_permalink`](https://developer.wordpress.org/reference/hooks/edit_form_before_permalink/), [`after_title`](https://developer.wordpress.org/reference/hooks/edit_form_after_title/), and [`after_editor`](https://developer.wordpress.org/reference/hooks/edit_form_after_editor/)
313
-
314
- These would be defined by setting the `context` property for your box:
315
-
316
- ```php
317
- $cmb_demo = new_cmb2_box( array(
318
- ...
319
- 'context' => 'before_permalink',
320
- ) );
321
- ```
322
-
323
- If it is preferred that the fields are output without the metabox, then omit the `'title'` property from the metabox registration array, and instead add ` 'remove_box_wrap' => true,`.
324
-
325
- Props [@norcross](https://github.com/norcross) ([#836](https://github.com/CMB2/CMB2/pull/836)).
326
- * New field parameter, `'render_class'`, allowing you to override the default `'CMB2_Type_Base'` class that is used when rendering the field. This provides interesting object-oriented ways to override default CMB2 behavior by subclassing the default class and overriding methods. The render class can also be overridden with the `"cmb2_render_class_{$fieldtype}"` filter, which is passed the default render class name as well as the `CMB2_Types` object, but this should be used sparingly, and within the context of your project's boxes/fields or you could break other plugins'/themes' CMB2 fields.
327
- * Improvements to the `file`/`file_list` fields javascript APIs, including using undersore templates.
328
- * Small improvements to the styling for the `file_list` field type.
329
- * New action hook, `cmb2_footer_enqueue`, which occurs after CMB2 enqueues its assets.
330
- * Example functions clean up. Props [@PavelK27](https://github.com/PavelK27) ([#866](https://github.com/CMB2/CMB2/pull/866)).
331
- * New `CMB2_Utils` methods, `get_available_image_sizes()` and `get_named_size()`. Props [@Cai333](https://github.com/Cai333).
332
-
333
- ### Bug Fixes
334
-
335
- * Fix datepicker month/year dropdown text color. On windows, the option text was showing as white (invisible). Fixes [#770](https://github.com/CMB2/CMB2/issues/770).
336
- * Repeatable WYSIWYG no longer breaks if `'quicktags'` param is set to false. Props [@timburden](https://github.com/timburden) ([#797](https://github.com/CMB2/CMB2/pull/797), [#796](https://github.com/CMB2/CMB2/issues/796)).
337
- * Do not process title fields during group field save process.
338
- * Fix issue where term-meta values were not being displayed for some users. Props [@sbussetti](https://github.com/sbussetti) ([#763](https://github.com/CMB2/CMB2/pull/763), [#700](https://github.com/CMB2/CMB2/issues/700)).
339
- * Fix issue where term meta would not be applied when using the new term form if multiple object types were specified. Props [@ADC07](https://github.com/ADC07) ([#842](https://github.com/CMB2/CMB2/pull/842), [#841](https://github.com/CMB2/CMB2/issues/841)).
340
- * Fix WordPress spinner styling when boxes/fields used on the frontend.
341
- * Fix issue where clicking to remove a `file_list` item could occasionally remove the field row. ([#828](https://github.com/CMB2/CMB2/pull/828)).
342
- * Fix issue where empty file field in group would still cause non-empty values to store to database. ([#721](https://github.com/CMB2/CMB2/issues/721)).
343
- * Make `file`/`file_list` field preview images work with named sizes. Props [@Cai333](https://github.com/Cai333) ([#848](https://github.com/CMB2/CMB2/pull/848), [#844](https://github.com/CMB2/CMB2/issues/844)).
344
- * Fix incorrect text-domain. ([#798](https://github.com/CMB2/CMB2/issues/798))
345
- * Do not silence notices/errors in `CMB2_Utils::get_file_ext()`.
346
- * If `title` field type has no name value, then only output a span element (instead of a header element).
347
-
348
- ## [2.2.3.1 - 2016-11-08](https://github.com/CMB2/CMB2/releases/tag/v2.2.3.1)
349
-
350
- ### Enhancements
351
-
352
- * Better styling for disabled group "X" buttons, and add title attr. Fixes [#773](https://github.com/CMB2/CMB2/issues/773).
353
-
354
- ### Bug Fixes
355
-
356
- * Use quotes for `label[for=""]` selector. Fixed `Syntax error, unrecognized expression`. Props [@anhskohbo](https://github.com/anhskohbo) ([#789](https://github.com/CMB2/CMB2/pull/789)).
357
- * Fix `ReferenceError: tinyMCE is not defined` javascript errors (happening when trying to remove a repeatable field/group). Fixes [#790](https://github.com/CMB2/CMB2/issues/790), and [#730](https://github.com/CMB2/CMB2/issues/730).
358
- * Fix REST API `'show_in_rest'` examples in `example-functions.php`. Any REST API boxes/fields must use the `'cmb2_init'` hook (as opposed to the `'cmb2_admin_init'` hook).
359
-
360
- ## [2.2.3 - 2016-10-25](https://github.com/CMB2/CMB2/releases/tag/v2.2.3)
361
-
362
- ### Enhancements
363
-
364
- * CMB2 REST API! CMB2 now has WP REST API endpoints for displaying your boxes and fields data, as well as registers rest fields in the existing post, user, term, and comment endpoints (in the cmb2 namespace). Enabling the REST API for your boxes/fields is opt-in, meaning it will not be automatically enabled. For more info, [check out the wiki](https://github.com/CMB2/CMB2/wiki/REST-API).
365
- * Small string improvement, move a period inside the translatable string. Props [@pedro-mendonca](https://github.com/pedro-mendonca) ([#672](https://github.com/CMB2/CMB2/pull/672)).
366
- * Introduce the `'save_field'` boolean field parameter for disabling the saving of a field. Useful if you want to display the value of another field, or use a disabled/read-only field. Props [@jamesgol](https://github.com/jamesgol) ([#674](https://github.com/CMB2/CMB2/pull/674), [#346](https://github.com/CMB2/CMB2/issues/346), [#500](https://github.com/CMB2/CMB2/issues/500)).
367
- * Update docblocks for `CMB2_Field::save_field_from_data()` and `CMB2_Field::save_field()`. Props [@jamesgol](https://github.com/jamesgol) ([#675](https://github.com/CMB2/CMB2/pull/675)).
368
- * More javascript events tied to the media modal actions (related to the `'file'` and '`file_list'` fields). `'cmb_media_modal_init'`, `'cmb_media_modal_open'`, and `'cmb_media_modal_select'`.
369
- * All CMB2 JS events now also get the CMB2 JS object passed in the list of arguments.
370
- * CMB2 JS object is now instantiated without stomping existing object, to enable extending.
371
- * New field parameter for taxonomy fields, `'remove_default'` which allows disabling the default taxonomy metabox. Props [@c3mdigital](https://github.com/c3mdigital) ([#593](https://github.com/CMB2/CMB2/pull/593)).
372
- * Change `'row_classes'` to just `'classes'`, to mirror the metabox `'classes'` property. Also now accepts a `'classes_cb'` parameter for specifying a callback which returns a string or array. The callback will receive `$field_args` as the first argument, and the CMB2_Field `$field` object as the second argument. (`'row_classes'` will continue to work, but is deprecated)
373
- * Make wysiwyg editors work in the repeatable groups context. A standard repeatable (non-group) wysiwyg field is not supported (but will possibly be included in a future update). Props [@johnsonpaul1014](https://github.com/johnsonpaul1014) ([#26](https://github.com/CMB2/CMB2/pull/26), [#99](https://github.com/CMB2/CMB2/pull/99), [#260](https://github.com/CMB2/CMB2/pull/260), [#264](https://github.com/CMB2/CMB2/pull/264), [#356](https://github.com/CMB2/CMB2/pull/356), [#431](https://github.com/CMB2/CMB2/pull/431), [#462](https://github.com/CMB2/CMB2/pull/462), [#657](https://github.com/CMB2/CMB2/pull/657), [#693](https://github.com/CMB2/CMB2/pull/693)).
374
- * Add an id to the heading tag in the title field. This allows linking to a particular title using the id.
375
- * Internationalization improvements. Props [ramiy](https://github.com/ramiy) ([#696](https://github.com/CMB2/CMB2/pull/696)).
376
- * Ensure that saving does not happen during a switch-to-blog session, as data would be saved to the wrong object. [See more](https://wordpress.org/support/topic/bug-in-lastest-version?replies=2).
377
- * Add `'cmb2_group_wrap_attributes'` filter to modifying the group wrap div's attributes. Filter gets passed an array of attributes and expects the return to be an array. Props [jrfnl](https://github.com/jrfnl) ([#582](https://github.com/CMB2/CMB2/pull/582)).
378
- * Update the unit-tests README and inline docs. Props [bobbingwide](https://github.com/bobbingwide) ([#714](https://github.com/CMB2/CMB2/pull/714), [#715](https://github.com/CMB2/CMB2/pull/715)).
379
- * Minor update to make naming-conventions consistent. Props [ramiy](https://github.com/ramiy) ([#718](https://github.com/CMB2/CMB2/pull/718)).
380
- * Update files to be compatible with PHP7 CodeSniffer standards. Props [ryanshoover](https://github.com/ryanshoover) ([#719](https://github.com/CMB2/CMB2/pull/719), [#720](https://github.com/CMB2/CMB2/pull/720)).
381
- * Make exception message translatable. Props [ramiy](https://github.com/ramiy) ([#724](https://github.com/CMB2/CMB2/pull/724)).
382
- * Portuguese translation provided by [@alvarogois](https://github.com/alvarogois) and [@pedro-mendonca](https://github.com/pedro-mendonca) - [#709](https://github.com/CMB2/CMB2/pull/709), [#727](https://github.com/CMB2/CMB2/pull/727).
383
- * Stop using `$wp_version` global. Props [ramiy](https://github.com/ramiy) ([#731](https://github.com/CMB2/CMB2/pull/731)).
384
- * Closures (anonymous functions) are now supported for any box/field `'*_cb'` parameters. E.g.
385
- ```php
386
- ...
387
- 'show_on_cb' => function( $cmb ) { return has_tag( 'cats', $cmb->object_id ); },
388
- ...
389
- ```
390
-
391
- ### Bug Fixes
392
-
393
- * If custom field types use a method and the Type object has not been instantiated, Try to guess the Type object and instantiate.
394
- * Normalize WordPress root path (`ABSPATH`) and theme rooth path (`get_theme_root()`). Props [@rianbotha](https://github.com/rianbotha) ([#677](https://github.com/CMB2/CMB2/pull/677), [#676](https://github.com/CMB2/CMB2/pull/676)).
395
- * Fix issue with `'cmb2_remove_row'` Javascript callback for non-group row removal. Fixes [#729](https://github.com/CMB2/CMB2/pull/729)).
396
- * Fix issue with missing assignment of variable (undefined variable). Props [@anhskohbo](https://github.com/anhskohbo) ([#779](https://github.com/CMB2/CMB2/pull/779)).
397
-
398
- ## 2.2.2.1 - 2016-06-27
399
-
400
- ### Bug Fixes
401
-
402
- * Fix issue that kept CMB2 stylesheet from being enqueued when using the [options-page snippets](https://github.com/CMB2/CMB2-Snippet-Library/tree/master/options-and-settings-pages).
403
- * Fix issue which caused the CMB2 column display styles to be enqueued in the wrong pages. Now only enqueues on admin pages with columns.
404
-
405
- ## 2.2.2 - 2016-06-27
406
-
407
- ### Enhancements
408
-
409
- * You can now set admin post-listing columns with an extra field parameter, `'column' => true,`. If you want to dictate what position the column is, use `'column' => array( 'position' => 2 ),`. If you want to dictate the column title (instead of using the field `'name'` value), use `'column' => array( 'name' => 'My Column' ),`. If you need to specify the column display callback, set the `'display_cb'` parameter to [a callback function](https://github.com/CMB2/CMB2/wiki/Field-Parameters#render_row_cb). Columns work for post (all post-types), comment, user, and term object types.
410
- * Updated Datepicker styles using JJJ's "jQuery UI Datepicker CSS for WordPress", so props Props [@stuttter](https://github.com/stuttter), [@johnjamesjacoby](https://github.com/johnjamesjacoby). Also cleaned up the timepicker styles (specifically the buttons) to more closely align with the datepicker and WordPress styles.
411
- * CMB2 is now a lot more intelligent about where it is located in your installation. This update should solve almost all of the reasons to use the `'cmb2_meta_box_url'` filter (thought it will continue to work as expected). ([#27](https://github.com/CMB2/CMB2/issues/27), [#118](https://github.com/CMB2/CMB2/issues/118), [#432](https://github.com/CMB2/CMB2/issues/432), [related wiki item](https://github.com/CMB2/CMB2/wiki/Troubleshooting#cmb2-urls-issues))
412
- * Implement CMB2_Ajax as a singleton. Props [jrfnl](https://github.com/jrfnl) ([#602](https://github.com/CMB2/CMB2/pull/602)).
413
- * Add `classes` and `classes_cb` CMB2 box params which allows you to add additional classes to the cmb-wrap. The `classes` parameter can take a string or array, and the `classes_cb` takes a callback which returns a string or array. The callback will receive `$cmb` as an argument. These classes are also passed through a new filter, `'cmb2_wrap_classes'`, which receives the array of classes as the first argument, and the CMB2 object as the second. Reported/requested in [#364](https://github.com/CMB2/CMB2/issues/364#issuecomment-213223692).
414
- * Make the `'title'` field type accept extra arguments. Props [@vladolaru](https://github.com/vladolaru), [@pixelgrade](https://github.com/pixelgrade) ([#656](https://github.com/CMB2/CMB2/pull/656)).
415
- * Updated `cmb2_get_oembed()` function to NOT return the "remove" link, as it's intended for outputting the oembed only. **This is a backwards-compatibility concern.** If you were depending on the "remove" link, use `cmb2_ajax()->get_oembed( $args )` instead.
416
- * New function, `cmb2_do_oembed()`', which is hooked to `'cmb2_do_oembed'`, so you can use `do_action( 'cmb2_do_oembed', $args )` in your themes without `function_exists()` checks.
417
- * New method, `CMB2:set_prop( $property, $value )`, for setting a CMB2 metabox object property.
418
- * The `CMB2_Field` object instances will now have a `cmb_id` property and a `get_cmb` method to enable access to the field's `CMB2` parent object's instance, in places like field callbacks and filters (e.g. `$cmb = $field->get_cmb();`).
419
- * Add a `data-fieldtype` attribute to the field rows for simpler identification in Javascript.
420
- * Moved each type in `CMB2_Types` to it's own class so that each field type can handle it's own field display, and added the infrastructure to maintainn back-compatibility.
421
- * New `CMB2_Utils` methods, `notempty()` and `filter_empty()`, both of which consider `null`, `''` and `false` as empty, but allow `0` (for saving `0` as a field value).
422
- * New `CMB2_Utils` public methods, `get_url_from_dir()`, `get_file_ext()`, `get_file_name_from_path()`, and `wp_at_least()`.
423
- * Add a `cmb_pre_init` Javascript event to allow overriding CMB2 defaults via JS.
424
-
425
- ### Bug Fixes
426
- * Fix issue with 'default' callback not being applied in all instances. Introduced new `CMB2_Field::get_default()` method, and `'default_cb'` field parameter. Using the `'default'` field parameter with a callback will be deprecated in the next few releases. ([#572](https://github.com/CMB2/CMB2/issues/572)).
427
- * Be sure to call `CMB2_Field::row_classes()` for group field rows. Also, update CSS to use the "cmb-type-group" classname instead of "cmb-repeat-group-wrap".
428
- * Introduce new `'text'` and `'text_cb'` field parameters for overriding CMB2 text strings instead of using the `'options'` array. ([#630](https://github.com/CMB2/CMB2/pull/630))
429
- * Fix bug where the value of '0' could not be saved in group fields.
430
- * Fix bug where a serialized empty array value in the database for a repeatable field would output as "Array".
431
- * Allow for optional/empty money field. Props [@jrfnl](https://github.com/jrfnl) ([#577](https://github.com/CMB2/CMB2/pull/577)).
432
- * The `CMB2::$updated` parameter (which contains field ids for all fields updated during a save) now also correctly adds group field ids to the array.
433
-
434
- ## 2.2.1 - 2016-02-29
435
-
436
- ### Bug Fixes
437
-
438
- * Fixes back-compatibility issue which could allow multiple CMB2 instances to load (causing fatal errors). ([#520](https://github.com/CMB2/CMB2/pull/520))
439
-
440
- ## 2.2.0 - 2016-02-27
441
-
442
- ### Enhancements
443
-
444
- * Term Meta! As of WordPress 4.4, [WordPress will have the ability to use term metadata](https://make.wordpress.org/core/2015/10/23/4-4-taxonomy-roundup/). CMB2 will work with term meta out of the box. To do so, see the example cmb registration in the `yourprefix_register_taxonomy_metabox` function in [example-functions.php](https://github.com/CMB2/CMB2/blob/master/example-functions.php).
445
- * New hooks which hook in after save field action: `'cmb2_save_field'` and `"cmb2_save_field_{$field_id}"`. Props [wpsmith](https://github.com/wpsmith) ([#475](https://github.com/CMB2/CMB2/pull/475)).
446
- * The "cmb2_sanitize_{$field_type}" hook now runs for every field type (not just custom types) so you can override the sanitization for all field types via a filter.
447
- * `CMB2::show_form()` is now composed of 3 smaller methods, `CMB2::render_form_open()`, `CMB2::render_field()`, `CMB2::render_form_close()` ([#506](https://github.com/CMB2/CMB2/pull/506)).
448
- * RTL Style generated. Props [@devinsays](https://github.com/devinsays) ([#510](https://github.com/CMB2/CMB2/pull/510)).
449
- * Properly scope date/time-pickers styling by adding a class to only cmb2 picker instances. ([#527](https://github.com/CMB2/CMB2/pull/527))
450
- * Allow per-field overrides for the date/time/color picker options (wiki documentation: [Modify Field Date, Time, or Color Picker options](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#modify-field-date-time-or-color-picker-options))
451
- * Fix some inline documentation issues. Props [@jrfnl](https://github.com/jrfnl) ([#579](https://github.com/CMB2/CMB2/pull/579)).
452
- * Include `.gitattributes` file for excluding development resources when using Composer. Props [@benoitchantre](https://github.com/benoitchantre) ([#575](https://github.com/CMB2/CMB2/pull/575), [#53](https://github.com/CMB2/CMB2/pull/53)).
453
-
454
- ### Bug Fixes
455
-
456
- * Fixed issue with `'taxonomy_select'` field type where a term which evaluated falsey would not be displayed properly. Props [adamcapriola](https://github.com/adamcapriola) ([#477](https://github.com/CMB2/CMB2/pull/477)).
457
- * Fix issue with colorpickers not changing when sorting groups.
458
- * `'show_option_none'` field parameter now works on taxonomy fields when explicitly setting to false.
459
- * Fix so the date/time-picker javascript respects the `'date_format'` and `'time_format'` field parameters. Props [@yivi](https://github.com/yivi) ([#39](https://github.com/CMB2/CMB2/pull/39), [#282](https://github.com/CMB2/CMB2/pull/282), [#300](https://github.com/CMB2/CMB2/pull/300), [#318](https://github.com/CMB2/CMB2/pull/318), [#330](https://github.com/CMB2/CMB2/pull/330), [#446](https://github.com/CMB2/CMB2/pull/446), [#498](https://github.com/CMB2/CMB2/pull/498)).
460
- * Fix a sometimes-broken unit test. Props [JPry](https://github.com/JPry) ([#539](https://github.com/CMB2/CMB2/pull/539)).
461
- * Fix issue with oembed fields not working correctly on options pages. ([#542](https://github.com/CMB2/CMB2/pull/542)).
462
- * Fix issue with repeatable field <button> elements stealing focus from "submit" button.
463
-
464
- ## 2.1.2 - 2015-10-01
465
-
466
- ### Bug Fixes
467
-
468
- * Fixes back-compatibility issue when adding fields array to the metabox registration. ([#472](https://github.com/CMB2/CMB2/pull/472))
469
-
470
- ## 2.1.1 - 2015-09-30
471
-
472
- ### Enhancements
473
-
474
- * Make all CMB2::save_fields arguments optional to fall-back to `$_POST` data. Props [JPry](https://github.com/JPry).
475
- * New filter, `cmb2_non_repeatable_fields` for adding additional fields to the blacklist of repeatable field-types. Props [JPry](https://github.com/JPry) ([#430](https://github.com/CMB2/CMB2/pull/430)).
476
- * New recommended hook for adding metaboxes, `cmb2_admin_init`. Most metabox registration only needs to happen if in wp-admin, so there is no reason to register them when loading the front-end (and increase the memory usage). `cmb2_init` still exists to register metaboxes that will be used on the front-end or used on both the front and back-end. Instances of `cmb2_init` in example-functions.php have been switched to `cmb2_admin_init`.
477
- * Add `'render_row_cb'` field parameter for overriding the field render method.
478
- * Add `'label_cb'` field parameter for overriding the field label render method.
479
- * Allow `CMB2_Types::checkbox()` method to be more flexible for extending by taking an args array and an `$is_checked` second argument.
480
- * More thorough unit tests. Props [pglewis](https://github.com/pglewis), ([#447](https://github.com/CMB2/CMB2/pull/447),[#448](https://github.com/CMB2/CMB2/pull/448)).
481
- * Update `CMB2_Utils::image_id_from_url` to be more reliable. Props [wpscholar](https://github.com/wpscholar), ([#453](https://github.com/CMB2/CMB2/pull/453)).
482
- * `cmb2_get_option` now takes a default fallback value as a third parameter.
483
-
484
- ### Bug Fixes
485
-
486
- * Address issue where `'file'` and `'file_list'` field results were getting mixed. Props [augustuswm](https://github.com/augustuswm) ([#382](https://github.com/CMB2/CMB2/pull/382), [#250](https://github.com/CMB2/CMB2/pull/250), [#296](https://github.com/CMB2/CMB2/pull/296)).
487
- * Fix long-standing issues with radio and multicheck fields in repeatable groups losing their values when new rows are added. ([#341](https://github.com/CMB2/CMB2/pull/341), [#304](https://github.com/CMB2/CMB2/pull/304), [#263](https://github.com/CMB2/CMB2/pull/263), [#246](https://github.com/CMB2/CMB2/pull/246), [#150](https://github.com/CMB2/CMB2/pull/150))
488
- * Fixes issue where currently logged-in user's profile data would display in the "Add New User" screen fields. ([#427](https://github.com/CMB2/CMB2/pull/427))
489
- * Fixes issue where radio values/selections would not always properly transfer when shifting rows (up/down). Props [jamiechong](https://github.com/jamiechong) ([#429](https://github.com/CMB2/CMB2/pull/429), [#152](https://github.com/CMB2/CMB2/pull/152)).
490
- * Fixes issue where repeatable groups display "Array" as the field values if group is left completely empty. ([#332](https://github.com/CMB2/CMB2/pull/332),[#390](https://github.com/CMB2/CMB2/pull/390)).
491
- * Fixes issue with `'file_list'` fields not saving properly when in repeatable groups display. Props [jamiechong](https://github.com/jamiechong) ([#433](https://github.com/CMB2/CMB2/pull/433),[#187](https://github.com/CMB2/CMB2/pull/187)).
492
- * Update `'taxonomy_radio_inline'` and `'taxonomy_multicheck_inline'` fields sanitization method to use the same method as the non-inline versions. Props [superfreund](https://github.com/superfreund) ([#454](https://github.com/CMB2/CMB2/pull/454)).
493
-
494
- ## 2.1.0 - 2015-08-05
495
-
496
- ### Bug Fixes
497
-
498
- * Fix user fields not saving. Props [achavez](https://github.com/achavez), ([#417](https://github.com/CMB2/CMB2/pull/417)).
499
-
500
- ## 2.0.9 - 2015-07-28
501
-
502
- ### Enhancements
503
-
504
- * Updated/Added many translations. Props [fxbenard](https://github.com/fxbenard), ([#203](https://github.com/CMB2/CMB2/pull/344)) and [Mte90](https://github.com/Mte90) for the Italian translation.
505
- * Updated `'file_list'` field type to have a more intuitive selection in the media library, and updated the 'Use file' text in the button. Props [SteveHoneyNZ](https://github.com/SteveHoneyNZ) ([#357](https://github.com/CMB2/CMB2/pull/357), [#358](https://github.com/CMB2/CMB2/pull/358)).
506
- * `'closed'` group field option parameter introduced in order to set the groups as collapsed by default. Requested in [#391](https://github.com/CMB2/CMB2/issues/391).
507
- * Added `"cmb2_{$object_type}_process_fields_{$cmb_id}"` hook for hooking in and modifying the metabox or fields before the fields are processed/sanitized for saving.
508
- * Added Comment Metabox support. Props [GregLancaster71](https://github.com/GregLancaster71) ([#238](https://github.com/CMB2/CMB2/pull/238), [#244](https://github.com/CMB2/CMB2/pull/244)).
509
- * New `"cmb2_{$field_id}_is_valid_img_ext"`` filter for determining if a field value has a valid image file-type extension.
510
-
511
- ### Bug Fixes
512
-
513
- * `'multicheck_inline'`, `'taxonomy_radio_inline'`, and `'taxonomy_multicheck_inline'` field types were not outputting anything since it's value was not being returned. Props [ediamin](https://github.com/ediamin), ([#367](https://github.com/CMB2/CMB2/pull/367), ([#405](https://github.com/CMB2/CMB2/pull/405)).
514
- * `'hidden'` type fields were not honoring the `'show_on_cb'` callback. Props [JPry](https://github.com/JPry), ([commits](https://github.com/CMB2/CMB2/compare/5a4146eec546089fbe1a1c859d680dfda3a86ee2...1ef5ef1e3b2260ab381090c4abe9dc7234cfa0a6)).
515
- * Fixed: There was no minified cmb2-front.min.css file.
516
- * Fallback for fatal error with invalid timezone. Props [ryanduff](https://github.com/ryanduff) ([#385](https://github.com/CMB2/CMB2/pull/385)).
517
- * Fix issues with deleting a row from repeatable group. Props [yuks](https://github.com/yuks) ([#387](https://github.com/CMB2/CMB2/pull/387)).
518
- * Ensure value passed to `strtotime` in `make_valid_time_stamp` is cast to a string. Props [vajrasar](https://github.com/vajrasar) ([#389](https://github.com/CMB2/CMB2/pull/389)).
519
- * Fixed issue with Windows IIS and bundling CMB2 in the theme. Props [DevinWalker](https://github.com/DevinWalker), ([#400](https://github.com/CMB2/CMB2/pull/400), [#401](https://github.com/CMB2/CMB2/pull/401))
520
-
521
- ## 2.0.8 - 2015-06-01
522
-
523
- ### Bug Fixes
524
-
525
- * Fix color-picker field not enqueueing the colorpicker script. ([#333](https://github.com/CMB2/CMB2/issues/333))
526
-
527
- ## 2.0.7 - 2015-05-28
528
-
529
- ### Enhancements
530
-
531
- * Ability to use non-repeatable group fields by setting the `'repeatable'` field param to `false` when registering a group field type. Props [marcusbattle](https://github.com/marcusbattle), ([#159](https://github.com/CMB2/CMB2/pull/159)).
532
- * Add and enqeueue a front-end specific CSS file which adds additional styles which are typically covered by wp-admin css. ([#311](https://github.com/CMB2/CMB2/issues/311))
533
- * Better handling of the CMB2 javascript (and CSS) required dependencies array. Dependencies are now only added conditionally based on the field types that are actually visible. ([#136](https://github.com/CMB2/CMB2/issues/136))
534
- * **THIS IS A BREAKING CHANGE:** The `group` field type's `'show_on_cb'` parameter now receives the `CMB2_Field` object instance as an argument instead of the `CMB2` instance. If you're using the `'show_on_cb'` parameter for a `group` field, please adjust accordingly. _note: you can still retrieve the `CMB2` instance via the `cmb2_get_metabox` helper function._
535
- * New dynamic hook, `"cmb2_save_{$object_type}_fields_{$this->cmb_id}"`, to complement the existing `"cmb2_save_{$object_type}_fields"` hook.
536
- * New CMB2 parameter, `enqueue_js`, to disable the enqueueing of the CMB2 Javascript.
537
- * German translation provided by Friedhelm Jost.
538
-
539
- ### Bug Fixes
540
-
541
- * Fix incorrect repeatable group title number. ([#310](https://github.com/CMB2/CMB2/pull/310))
542
- * Fix obscure bug which prevented group field arguments from being passed to the sub-fields (like `show_names` and `context`).
543
- * Fixed occasional issue when adding a group row, the previous row's content would be cloned. ([#257](https://github.com/CMB2/CMB2/pull/257))
544
-
545
- ## 2.0.6 - 2015-04-30
546
-
547
- ### Enhancements
548
-
549
- * New metabox/form parameter, `show_on_cb`, allows you to conditionally display a cmb metabox/form via a callback. The `$cmb` object gets passed as a parameter to the callback. This complements the `'show_on_cb'` parameter that already exists for individual fields. Using this callback is similar to using the `'cmb2_show_on'` filter, but only applies to that specific metabox and it is recommended to use this callback instead as it minimizes th risk that your filter will affect other metaboxes.
550
- * Taxonomy types no longer save a value. The value getting saved was causing confusion and is not meant to be used. To use the saved taxonomy data, you need to use the WordPress term api, `get_the_terms `, `get_the_term_list`, etc.
551
- * Add `'multiple'` field parameter to store values in individual rows instead of serialized array. Will only work if field is not repeatable or a repeatable group. Props [JohnyGoerend](https://github.com/JohnyGoerend). ([#262](https://github.com/CMB2/CMB2/pull/262), [#206](https://github.com/CMB2/CMB2/issues/206), [#45](https://github.com/CMB2/CMB2/issues/45)).
552
- * Portuguese (Brazil) translation provided by [@lucascdsilva](https://github.com/lucascdsilva) - [#293](https://github.com/CMB2/CMB2/pull/293).
553
- * Spanish (Spain) translation updated by [@yivi](https://github.com/yivi) - [#272](https://github.com/CMB2/CMB2/pull/272).
554
- * Added group field callback parameters, `'before_group'`, `'before_group_row'`, `'after_group_row'`, `'after_group'` to complement the `'before_row'`, `'before'`, `'after'`, `'after_row'` field parameters.
555
- * Better styling for `title` fields and `title` descriptions on options pages.
556
- * Add a `sanitization_cb` field parameter check for the `group` field type.
557
- * Better function/file doc-blocks to provide better documentation for automated documentation tools. See: [cmb2.io/api](http://cmb2.io/api/).
558
- * `cmb2_print_metabox_form`, `cmb2_metabox_form`, and `cmb2_get_metabox_form` helper functions now accept two new parameters:
559
- * an `'object_type'` parameter to explictly set that in the `$cmb` object.
560
- * an `'enqueue_js'` parameter to explicitly disable the CMB JS enqueue. This is handy if you're not planning on using any of the fields which require JS (like color/date pickers, wysiwyg, file, etc).
561
-
562
- ### Bug Fixes
563
-
564
- * Fix issue with oembed fields in repeatable groups where changing video changed it for all fields in a group.
565
- * Fix empty arrays (like in the group field) saving as a value.
566
- * Move `'cmb2_override_meta_value'` and `"cmb2_override_{$field_id}_meta_value"` filters to the `CMB2_Field::get_data()` method so that the filters are applied every time the data is requested. **THIS IS A BREAKING CHANGE:** The parameters for those filters have changed a bit. Previously, the filters accepted 5 arguments, `$value`, `$object_id`, `$field_args`, `$object_type`, `$field`. They have changed to accept 4 arguments instead, `$value`, `$object_id`, `$args`, `$field`, where `$args` is an array that contains the following:
567
- * @type string $type The current object type
568
- * @type int $id The current object ID
569
- * @type string $field_id The ID of the field being requested
570
- * @type bool $repeat Whether current field is repeatable
571
- * @type bool $single Whether current field is a single database row
572
-
573
-
574
- ## 2.0.5 - 2015-03-17
575
-
576
- ### Bug Fixes
577
-
578
- * Fix grouped fields display (first field was being repeated), broken in 2.0.3.
579
-
580
- ## 2.0.4 - 2015-03-16
581
-
582
- ### Enhancements
583
-
584
- * `select`, `radio`, `radio_inline` field types now all accept the `'show_option_none'` field parameter. This parameter allows you to set the text to display for showing a 'no selection' option. Default will be `false`, which means a 'none' option will not be added. Set to `true` to use the default text, 'None', or specify another value, i.e. 'No selection'.
585
-
586
- ### Bug Fixes
587
-
588
- * Fix back-compatibility when adding group field sub-fields via old array method (vs using the `CMB2:add_group_field()` method). Thanks to [norcross](https://github.com/norcross) for reporting.
589
- * Fix occasional jQuery issues with group-field indexes.
590
-
591
- ## 2.0.3 - 2015-03-15
592
-
593
- ### Enhancements
594
-
595
- * New constant, `CMB2_DIR`, which stores the file-path to the CMB2 directory.
596
- * `text_date`, `text_time`, `text_date_timestamp`, `text_datetime_timestamp`, and ` text_datetime_timestamp_timezone` field types now take an arguments array so they can be extended by custom field types.
597
- * Removed auto-scroll when adding groups. To re-add the feature, use the [snippet/plugin here](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/javascript/cmb2-auto-scroll-to-new-group.php). ([#205](https://github.com/CMB2/CMB2/issues/205))
598
- * Updated Timepicker utilizing the [@trentrichardson](https://github.com/trentrichardson) jQuery Timepicker add-on (https://github.com/trentrichardson/jQuery-Timepicker-Addon), and updated Datepicker styles. Props [JonMasterson](https://github.com/JonMasterson). ([#204](https://github.com/CMB2/CMB2/issues/204), [#206](https://github.com/CMB2/CMB2/issues/206), [#45](https://github.com/CMB2/CMB2/issues/45)).
599
- * Added a callback option for the field default value. The callback gets passed an array of all the field parameters as the first argument, and the field object as the second argument. (which means you can get the post id using `$field->object_id`). ([#233](https://github.com/CMB2/CMB2/issues/233)).
600
- * New `CMB2::get_field()` method and `cmb2_get_field` helper function for retrieving a `CMB2_Field` object from the array of registered fields for a metabox.
601
- * New `CMB2::get_sanitized_values()` method and `cmb2_get_metabox_sanitized_values` helper function for retrieving sanitized values from an array of values (usually `$_POST` data).
602
- * New `'save_fields'` metabox parameter that can be used to disable (by setting `'save_fields' => false`) the automatic saving of the fields when the form is submitted. These can be useful when you want to handle the saving of the fields yourself, or want to use submitted data for other purposes like generating new posts, or sending emails, etc.
603
-
604
- ### Bug Fixes
605
-
606
- * Fix commented out text_datetime_timestamp_timezone field registration example in `example-functions.php`. Props [cliffordp](https://github.com/cliffordp), ([#203](https://github.com/CMB2/CMB2/pull/203)).
607
- * Fix sidebar styling for money fields and fields with textareas. ([#234](https://github.com/CMB2/CMB2/issues/234))
608
- * Fix `CMB2_Sanitize` class to properly use the stripslashed value (which was added in [#162](https://github.com/CMB2/CMB2/pull/162) but never used). Props [dustyf](https://github.com/dustyf), ([#241](https://github.com/CMB2/CMB2/pull/241)).
609
-
610
- ## 2.0.2 - 2015-02-15
611
-
612
- ### Enhancements
613
-
614
- * Use the more appropriate `add_meta_boxes` hook for hooking in metaboxes to post-edit screen. Thanks [@inspiraaz](https://github.com/inspiraaz) for reporting. ([#161](https://github.com/CMB2/CMB2/issues/161))
615
- * Add a `row_classes` field param which allows you to add additional classes to the cmb-row wrap. This parameter can take a string, or array, or can take a callback that returns a string or array. The callback will receive `$field_args` as the first argument, and the CMB2_Field `$field` object as the second argument. Reported/requested in [#68](https://github.com/CMB2/CMB2/issues/68).
616
- * New constant, `CMB2_LOADED`, which you can use to check if CMB2 is loaded for your plugins/themes with CMB2 dependency.
617
- * New hooks, [`cmb2_init_before_hookup` and `cmb2_after_init`](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/filters-and-actions).
618
- * New API for adding metaboxes and fields, demonstrated in [`example-functions.php`](https://github.com/CMB2/CMB2/blob/master/example-functions.php). In keeping with backwards-compatibility, the `cmb2_meta_boxes` filter method will still work, but is not recommended. New API includes `new_cmb2_box` helper function to generate a new metabox, and returns a `$cmb` object to add new fields (via the `CMB2::add_field()` and `CMB2::add_group_field()` methods).
619
- * New CMB2 method, [`CMB2::remove_field()`](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/filters-and-actions/cmb2_init_%24cmb_id-remove-field.php).
620
- * New CMB2_Boxes method, [`CMB2_Boxes::remove()`](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/filters-and-actions/cmb2_init_before_hookup-remove-cmb2-metabox.php).
621
- * When clicking on a file/image in the `file`, or `file_list` type, the media modal will open with that image selected. Props [johnsonpaul1014](https://github.com/johnsonpaul1014), ([#120](https://github.com/CMB2/CMB2/pull/120)).
622
-
623
-
624
- ## 2.0.1 - 2015-02-02
625
-
626
- 2.0.1 is the official version after beta, and includes all the changes from 2.0.0 (beta).
627
-
628
- ## 2.0.0(beta) - 2014-08-16
629
-
630
- 2.0.0 is the official version number for the transition to CMB2, and 2.0.1 is the official version after beta. It is a complete rewrite. Improvements and fixes are listed below. __Note: This release requires WordPress 3.8+__
631
-
632
- ### Enhancements
633
-
634
- * Converted `<table>` markup to more generic `<div>` markup to be more extensible and allow easier styling.
635
- * Much better handling and display of repeatable groups.
636
- * Entirely translation-ready [with full translations](http://wp-translations.org/project/cmb2/) in Spanish, French (Props [@fredserva](https://github.com/fredserva) - [#127](https://github.com/CMB2/CMB2/pull/127)), Finnish (Props [@onnimonni](https://github.com/onnimonni) - [#108](https://github.com/CMB2/CMB2/pull/108)), Swedish (Props [@EyesX](https://github.com/EyesX) - [#141](https://github.com/CMB2/CMB2/pull/141)), and English.
637
- * Add cmb fields to new user page. Props [GioSensation](https://github.com/GioSensation), ([#645](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/645)).
638
- * Improved and additional [helper-functions](https://github.com/CMB2/CMB2/blob/master/includes/helper-functions.php).
639
- * Added new features and translation for datepicker. Props [kalicki](https://github.com/kalicki), ([#657](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/657)).
640
- * General code standards cleanup. Props [gregrickaby](https://github.com/gregrickaby), ([#17](https://github.com/CMB2/CMB2/pull/17) & others).
641
- * Use SASS for development. Props [gregrickaby](https://github.com/gregrickaby), ([#18](https://github.com/CMB2/CMB2/pull/18)).
642
- * New `hidden` field type.
643
- * [Ability to override text strings in fields via field options parameter](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#override-text-strings-in-field).
644
- * Added composer.json. Props [nlemoine](https://github.com/nlemoine), ([#19](https://github.com/CMB2/CMB2/pull/19)).
645
- * New field 'hooks' can take [static text/html](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#inject-static-content-in-a-field) or a [callback](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#inject-dynamic-content-in-a-field-via-a-callback).
646
- * New `preview_size` parameter for `file` field type. Takes an array or named image size.
647
- * Empty index.php file to all folders (for more security). Props [brunoramalho](https://github.com/brunoramalho), ([#41](https://github.com/CMB2/CMB2/pull/41)).
648
- * Clean up styling. Props [brunoramalho](https://github.com/brunoramalho), ([#43](https://github.com/CMB2/CMB2/pull/43)) and [senicar](https://github.com/senicar).
649
- * Collapsible field groups. Props [cluke009](https://github.com/cluke009), ([#59](https://github.com/CMB2/CMB2/pull/59)).
650
- * Allow for override of update/remove for CMB2_Field. Props [sc0ttkclark](https://github.com/sc0ttkclark), ([#65](https://github.com/CMB2/CMB2/pull/65)).
651
- * Use class button-disabled instead of disabled="disabled" for <a> buttons. Props [sc0ttkclark](https://github.com/sc0ttkclark), ([#66](https://github.com/CMB2/CMB2/pull/66)).
652
- * [New before/after dynamic form hooks](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#using-the-dynamic-beforeafter-form-hooks).
653
- * Larger unit test coverage. Props to [@pmgarman](https://github.com/pmgarman) for assistance. ([#90](https://github.com/CMB2/CMB2/pull/90) and [#91](https://github.com/CMB2/CMB2/pull/91))
654
- * Added helper function to update an option. Props [mAAdhaTTah](https://github.com/mAAdhaTTah), ([#110](https://github.com/CMB2/CMB2/pull/110)).
655
- * More JS hooks during repeat group shifting. Props [AlchemyUnited](https://github.com/AlchemyUnited), ([#125](https://github.com/CMB2/CMB2/pull/125)).
656
- * [New metabox config option for defaulting to closed](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#setting-a-metabox-to-closed-by-default).
657
- * New hooks, [`cmb2_init`](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#using-cmb2-helper-functions-and-cmb2_init) and `cmb2_init_{$cmb_id}`.
658
-
659
- ### Bug Fixes
660
-
661
- * New mechanism to ensure CMB2 only loads the most recent version of CMB2 in your system. This fixes the issue where another bundled version could conflict or take precendent over your up-to-date version.
662
- * Fix issue with field labels being hidden. Props [mustardBees](https://github.com/mustardBees), ([#48](https://github.com/CMB2/CMB2/pull/48)).
663
- * Address issues with autoloading before autoloader is setup. Props [JPry](https://github.com/JPry), ([#56](https://github.com/CMB2/CMB2/pull/56)).
664
- * Fixed 'show_on_cb' for field groups. Props [marcusbattle](https://github.com/marcusbattle), ([#98](https://github.com/CMB2/CMB2/pull/98)).
665
- * Make get_object_terms work with and without object caching. Props [joshlevinson](https://github.com/joshlevinson), ([#105](https://github.com/CMB2/CMB2/pull/105)).
666
- * Don't use `__DIR__` in example-functions.php to ensure PHP 5.2 compatibility. Props [bryceadams](https://github.com/bryceadams), ([#129](https://github.com/CMB2/CMB2/pull/129)).
667
- * Added support for radio input swapping in repeatable fields. Props [DevinWalker](https://github.com/DevinWalker), ([#138](https://github.com/CMB2/CMB2/pull/138), [#149](https://github.com/CMB2/CMB2/pull/149)).
668
- * Fix metabox form not being returned to caller. Props [akshayagarwal](https://github.com/akshayagarwal), ([#145](https://github.com/CMB2/CMB2/pull/145)).
669
- * Run stripslashes before saving data, since WordPress forces magic quotes. Props [clifgriffin](https://github.com/clifgriffin), ([#162](https://github.com/CMB2/CMB2/pull/162)).
670
-
671
- ## 1.3.0 - (never released, merged into CMB2)
672
-
673
- ### Enhancements
674
-
675
- * Localize Date, Time, and Color picker defaults so that they can be overridden via the `cmb_localized_data` filter. ([#528](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/528))
676
- * Change third parameter for 'cmb_metabox_form' to be an args array. Optional arguments include `echo`, `form_format`, and `save_button`.
677
- * Add support for `show_option_none` argument for `taxonomy_select` and `taxonomy_radio` field types. Also adds the following filters: `cmb_all_or_nothing_types`, `cmb_taxonomy_select_default_value`, `cmb_taxonomy_select_{$this->_id()}_default_value`, `cmb_taxonomy_radio_{$this->_id()}_default_value`, `cmb_taxonomy_radio_default_value`. Props [@pmgarman](https://github.com/pmgarman), ([#569](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/569)).
678
- * Make the list items in the `file_list` field type drag & drop sortable. Props [twoelevenjay](https://github.com/twoelevenjay), ([#603](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/603)).
679
-
680
- ### Bug Fixes
681
-
682
- * Fixed typo in closing `</th>` tag. Props [@CivicImages](https://github.com/CivicImages). ([#616](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/616))
683
-
684
- ## 1.2.0 - 2014-05-03
685
-
686
- ### Enhancements
687
-
688
- * Add support for custom date/time formats. Props [@Scrent](https://github.com/Scrent). ([#506](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/506))
689
- * Simplify `wysiwyg` escaping and allow it to be overridden via the `escape_cb` parameter. ([#491](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/491))
690
- * Add a 'Select/Deselect all' button for the `multicheck` field type.
691
- * Add title option for [repeatable groups](https://github.com/CMB2/CMB2/wiki/Field-Types#group). Title field takes an optional replacement hash, "{#}" that will be replaced by the row number.
692
- * New field parameter, `show_on_cb`, allows you to conditionally display a field via a callback. ([#47](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/47))
693
- * Unit testing (the beginning). Props [@brichards](https://github.com/brichards) and [@camdensegal](https://github.com/camdensegal).
694
-
695
- ### Bug Fixes
696
-
697
- * Fixed issue where remove file button wouldn't clear the url field. ([#514](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/514))
698
- * `wysiwyg` fields now allow underscores. Fixes some wysiwyg display issues in WordPress 3.8. Props [@lswilson](https://github.com/lswilson). ([#491](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/491))
699
- * Nonce field should only be added once per page. ([#521](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/521))
700
- * Fix `in_array` issue when a post does not have any saved terms for a taxonomy multicheck. ([#527](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/527))
701
- * Fixed error: 'Uninitialized string offset: 0 in cmb_Meta_Box_field.php...`. Props [@DevinWalker](https://github.com/DevinWalker). ([#539](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/539), [#549](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/549)))
702
- * Fix missing `file` field description. ([#543](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/543), [#547](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/547))
703
-
704
-
705
-
706
- ## 1.1.3 - 2014-04-07
707
-
708
- ### Bug Fixes
709
-
710
- * Update `cmb_get_field_value` function as it was passing the parameters to `cmb_get_field` in the wrong order.
711
- * Fix repeating fields not working correctly if meta key or prefix contained an integer. ([#503](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/503))
712
-
713
- ## 1.1.2 - 2014-04-05
714
-
715
- ### Bug Fixes
716
-
717
- * Fix issue with `cmb_Meta_Box_types.php` calling a missing method, `image_id_from_url`. ([#502](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/502))
718
-
719
-
720
- ## 1.1.1 - 2014-04-03
721
-
722
- ### Bug Fixes
723
-
724
- * Radio button values were not showing saved value. ([#500](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/500))
725
-
726
- ## 1.1.0 - 2014-04-02
727
-
728
- ### Enhancements
729
-
730
- * [Repeatable groups](https://github.com/CMB2/CMB2/wiki/Field-Types#group)
731
- * Support for more fields to be repeatable, including oEmbed field, and date, time, and color picker fields, etc.
732
- * Codebase has been revamped to be more modular and object-oriented.
733
- * New filter, `"cmb_{$element}_attributes" ` for modifying an element's attributes.
734
- * Every field now supports an `attributes` parameter that takes an array of attributes. [Read more](https://github.com/CMB2/CMB2/wiki/Field-Types#attributes).
735
- * Removed `cmb_std_filter` in favor of `cmb_default_filter`. **THIS IS A BREAKING CHANGE**
736
- * Better handling of labels in sidebar. They are now placed on top of the input rather than adjacent.
737
- * Added i18n compatibility to text_money. props [@ArchCarrier](https://github.com/ArchCarrier), ([#485](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/485))
738
- * New helper functions: `cmb_get_field` and `cmb_get_field_value` for getting access to CMB's field object and/or value.
739
- * New JavaScript events, `cmb_add_row` and `cmb_remove_row` for hooking in and manipulating the new row's data.
740
- * New filter, `cmb_localized_data`, for modifiying localized data passed to the CMB JS.
741
-
742
- ### Bug Fixes
743
- * Resolved occasional issue where only the first character of the label/value was diplayed. props [@mustardBees](https://github.com/mustardBees), ([#486](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/486))
744
-
745
-
746
- ## 1.0.2 - 2014-03-03
747
-
748
- ### Enhancements
749
-
750
- * Change the way the `'cmb_validate_{$field['type']}'` filter works.
751
- It is now passed a null value vs saved value. If null is returned, default sanitization will follow. **THIS IS A BREAKING CHANGE**. If you're already using this filter, take note.
752
- * All field types that take an option array have been simplified to take `key => value` pairs (vs `array( 'name' => 'value', 'value' => 'key', )`). This effects the 'select', 'radio', 'radio_inline' field types. The 'multicheck' field type was already using the `key => value` format. Backwards compatibility has been maintained for those using the older style.
753
- * Added default value option for `taxonomy_select` field type. props [@darlantc](https://github.com/darlantc), ([#473](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/473))
754
- * Added `preview_size` parameter for `file_list` field type. props [@IgorCode](https://github.com/IgorCode), ([#471](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/471))
755
- * Updated `file_list` images to be displayed horizontally instead of vertically. props [@IgorCode](https://github.com/IgorCode), ([#467](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/467))
756
- * Use `get_the_terms` where possible since the data is cached.
757
-
758
- ### Bug Fixes
759
-
760
- * Fixed wysiwyg escaping slashes. props [@gregrickaby](https://github.com/gregrickaby), ([#465](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/465))
761
- * Replaced `__DIR__`, as `dirname( __FILE__ )` is easier to maintain back-compatibility.
762
- * Fixed missing table styling on new posts. props [@mustardBees](https://github.com/mustardBees), ([#438](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/438))
763
- * Fix undeclared JS variable. [@veelen](https://github.com/veelen), ([#451](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/451))
764
- * Fix `file_list` errors when removing all files and saving.
765
- * Set correct `object_id` to be used later in `cmb_show_on` filter. [@lauravaq](https://github.com/lauravaq), ([#445](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/445))
766
- * Fix sanitization recursion memeory issues.
767
-
768
- ## 1.0.1 - 2014-01-24
769
-
770
- ### Enhancements
771
-
772
- * Now works with option pages and site settings. ([view example in wiki](https://github.com/CMB2/CMB2/wiki/Using-CMB-to-create-an-Admin-Theme-Options-Page))
773
- * two filters to override the setting and getting of options, `cmb_override_option_get_$option_key` and `cmb_override_option_save_$option_key` respectively. Handy for using plugins like [WP Large Options](https://github.com/voceconnect/wp-large-options/) ([also here](http://vip.wordpress.com/plugins/wp-large-options/)).
774
- * Improved styling on taxonomy (\*tease\*) and options pages and for new 3.8 admin UI.
775
- * New sanitization class to sanitize data when saved.
776
- * New callback field parameter, `sanitization_cb`, for performing your own sanitization.
777
- * new `cmb_Meta_Box_types::esc()` method that handles escaping data for display.
778
- * New callback field parameter, `escape_cb`, for performing your own data escaping, as well as a new filter, `'cmb_types_esc_'. $field['type']`.
779
-
780
- ### Bug Fixes
781
-
782
- * Fixed wysiwyg editor button padding. props [@corvannoorloos](https://github.com/corvannoorloos), ([#391](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/391))
783
- * A few php < 5.3 errors were addressed.
784
- * Fields with quotation marks no longer break the input/textarea fields.
785
- * metaboxes for Attachment pages now save correctly. Thanks [@nciske](https://github.com/nciske) for reporting. ([#412](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/412))
786
- * Occasionally fields wouldn't save because of the admin show_on filter.
787
- * Smaller images loaded to the file field type will no longer be blown up larger than their dimensions.
788
-
789
- ## 1.0.0 - 2013-11-30
790
-
791
- * Added `text_datetime_timestamp_timezone` type, a datetime combo field with an additional timezone drop down, props [@dessibelle](https://github.com/dessibelle)
792
- * Added `select_timezone` type, a standalone time zone select dropdown. The time zone select can be used with standalone `text_datetime_timestamp` if desired. Props [@dessibelle](https://github.com/dessibelle)
793
- * Added `text_url` type, a basic url field. Props [@dessibelle](https://github.com/dessibelle)
794
- * Added `text_email` type, a basic email field. Props [@dessibelle](https://github.com/dessibelle)
795
- * Added ability to display metabox fields in frontend. Default is true, but can be overriden using the `cmb_allow_frontend filter`. If set to true, an entire metabox form can be output with the `cmb_metabox_form( $meta_box, $object_id, $echo )` function. Props [@dessibelle](https://github.com/dessibelle), [@messenlehner](https://github.com/messenlehner) & [@jtsternberg](https://github.com/jtsternberg).
796
- * Added hook `cmb_after_table` after all metabox output. Props [@wpsmith](https://github.com/wpsmith)
797
- * `file_list` now works like a repeatable field. Add as many files as you want. Props [@coreymcollins](https://github.com/coreymcollins)
798
- * `text`, `text_small`, `text_medium`, `text_url`, `text_email`, & `text_money` fields now all have the option to be repeatable. Props [@jtsternberg](https://github.com/jtsternberg)
799
- * Custom metaboxes can now be added for user meta. Add them on the user add/edit screen, or in a custom user profile edit page on the front-end. Props [@tw2113](https://github.com/tw2113), [@jtsternberg](https://github.com/jtsternberg)
800
-
801
- ## 0.9.4
802
-
803
- * Added field "before" and "after" options for each field. Solves issue with '$' not being the desired text_money monetary symbol, props [@GaryJones](https://github.com/GaryJones)
804
- * Added filter for 'std' default fallback value, props [@messenlehner](https://github.com/messenlehner)
805
- * Ensure oEmbed videos fit in their respective metaboxes, props [@jtsternberg](https://github.com/jtsternberg)
806
- * Fixed issue where an upload field with 'show_names' disabled wouldn't have the correct button label, props [@jtsternberg](https://github.com/jtsternberg)
807
- * Better file-extension check for images, props [@GhostToast](https://github.com/GhostToast)
808
- * New filter, `cmb_valid_img_types`, for whitelisted image file-extensions, props [@jtsternberg](https://github.com/jtsternberg)
809
-
810
- ## 0.9.3
811
- * Added field type and field id classes to each cmb table row, props [@jtsternberg](https://github.com/jtsternberg)
812
-
813
- ## 0.9.2
814
- * Added post type comparison to prevent storing null values for taxonomy selectors, props [@norcross](https://github.com/norcross)
815
-
816
- ## 0.9.1
817
- * Added `oEmbed` field type with ajax display, props [@jtsternberg](https://github.com/jtsternberg)
818
-
819
- ## 0.9
820
- * __Note: This release requires WordPress 3.3+__
821
- * Cleaned up scripts being queued, props [@jaredatch](https://github.com/jaredatch)
822
- * Cleaned up and reorganized jQuery, props [@GaryJones](https://github.com/GaryJones)
823
- * Use $pagenow instead of custom $current_page, props [@jaredatch](https://github.com/jaredatch)
824
- * Fixed CSS, removed inline styles, now all in style.css, props [@jaredatch](https://github.com/jaredatch)
825
- * Fixed multicheck issues (issue #48), props [@jaredatch](https://github.com/jaredatch)
826
- * Fixed jQuery UI datepicker CSS conflicting with WordPress UI elements, props [@jaredatch](https://github.com/jaredatch)
827
- * Fixed zeros not saving in fields, props [@GaryJones](https://github.com/GaryJones)
828
- * Fixed improper labels on radio and multicheck fields, props [@jaredatch](https://github.com/jaredatch)
829
- * Fixed fields not rendering properly when in sidebar, props [@jaredatch](https://github.com/jaredatch)
830
- * Fixed bug where datepicker triggers extra space after footer in Firefox (issue #14), props [@jaredatch](https://github.com/jaredatch)
831
- * Added jQuery UI datepicker packaged with 3.3 core, props [@jaredatch](https://github.com/jaredatch)
832
- * Added date time combo picker, props [@jaredatch](https://github.com/jaredatch)
833
- * Added color picker, props [@jaredatch](https://github.com/jaredatch)
834
- * Added readme.md markdown file, props [@jaredatch](https://github.com/jaredatch)
835
-
836
- ## 0.8 - 2012-01-19
837
- * Added jQuery timepicker, props [@norcross](https://github.com/norcross)
838
- * Added 'raw' textarea to convert special HTML entities back to characters, props [@norcross](https://github.com/norcross)
839
- * Added missing examples on example-functions.php, props [@norcross](https://github.com/norcross)
840
-
841
- ## 0.7
842
- * Added the new wp_editor() function for the WYSIWYG dialog box, props [@jcpry](https://github.com/jcpry)
843
- * Created 'cmb_show_on' filter to define your own Show On Filters, props [@billerickson](https://github.com/billerickson)
844
- * Added page template show_on filter, props [@billerickson](https://github.com/billerickson)
845
- * Improvements to the 'file' field type, props [@randyhoyt](https://github.com/randyhoyt)
846
- * Allow for default values on 'radio' and 'radio_inline' field types, props [@billerickson](https://github.com/billerickson)
847
-
848
- ## 0.6.1
849
- * Enabled the ability to define your own custom field types (issue #28). props [@randyhoyt](https://github.com/randyhoyt)
850
-
851
- ## 0.6
852
- * Added the ability to limit metaboxes to certain posts by id. props [@billerickson](https://github.com/billerickson)
853
-
854
- ## 0.5
855
- * Fixed define to prevent notices. props [@destos](https://github.com/destos)
856
- * Added text_date_timestap option. props [@andrewyno](https://github.com/andrewyno)
857
- * Fixed WYSIWYG paragraph breaking/spacing bug. props [@wpsmith](https://github.com/wpsmith)
858
- * Added taxonomy_radio and taxonomies_select options. props [@c3mdigital](https://github.com/c3mdigital)
859
- * Fixed script causing the dashboard widgets to not be collapsible.
860
- * Fixed various spacing and whitespace inconsistencies
861
-
862
- ## 0.4
863
- * Think we have a release that is mostly working. We'll say the initial release :)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/CODE_OF_CONDUCT.md DELETED
@@ -1,76 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, sex characteristics, gender identity and expression,
9
- level of experience, education, socio-economic status, nationality, personal
10
- appearance, race, religion, or sexual identity and orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at hello@cmb2.io. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
-
73
- [homepage]: https://www.contributor-covenant.org
74
-
75
- For answers to common questions about this code of conduct, see
76
- https://www.contributor-covenant.org/faq
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/CONTRIBUTING.md DELETED
@@ -1,60 +0,0 @@
1
- # Contributing to CMB2
2
-
3
- Thank you for your interest in contributing back to CMB2. Please help us review your issues and/or merge your pull requests by following the below guidelines.
4
-
5
- #### NOTE: The issues section is for bug reports and feature requests only.
6
- _Support is not offered for this library, and the likelihood that the maintainers will respond is very low. If you need help, please use [stackoverflow](http://stackoverflow.com/search?q=cmb), or the [wordpress.org plugin forums](http://wordpress.org/support/plugin/cmb2)._
7
-
8
- Before reporting a bug
9
- ---
10
- 1. Please review the [documentation](https://github.com/CMB2/CMB2/wiki). Most questions revolve around the [field types](https://github.com/CMB2/CMB2/wiki/Field-Types), [field parameters](https://github.com/CMB2/CMB2/wiki/Field-Parameters), or are addressed in the [troubleshooting](https://github.com/CMB2/CMB2/wiki/Troubleshooting) section.
11
- 2. Search [issues](https://github.com/CMB2/CMB2/issues) to see if the issue has been previously reported.
12
- 3. Install the [`develop`](https://github.com/CMB2/CMB2/tree/develop) version of CMB2 and test there.
13
-
14
-
15
- How to report a bug
16
- ---
17
- 1. Specify the version number for both WordPress and CMB2.
18
- 3. Describe the problem in detail. Explain what happened, and what you expected would happen.
19
- 4. Provide a small test-case and a link to a [gist](https://gist.github.com/) containing your entire metabox registration code.
20
- 5. If helpful, include a screenshot. Annotate the screenshot for clarity.
21
-
22
-
23
- How to contribute to CMB2
24
- ---
25
- All contributions welcome. If you would like to submit a pull request, please follow the steps below.
26
-
27
- 1. Make sure you have a GitHub account.
28
- 2. Fork the repository on GitHub.
29
- 3. **Check out the [`develop`](https://github.com/CMB2/CMB2/tree/develop) version of CMB2.** If you submit to the master branch, the PR will be closed with a link back to this document.
30
- 4. **Verify your issue still exists in the [`develop`](https://github.com/CMB2/CMB2/tree/develop) branch.**
31
- 5. Make changes to your clone of the repository.
32
- 1. Please follow the [WordPress code standards](https://make.wordpress.org/core/handbook/coding-standards).
33
- 2. If possible, and if applicable, please also add/update unit tests for your changes.
34
- 3. Please add documentation to any new functions, methods, actions and filters.
35
- 4. When committing, reference your issue (if present) and include a note about the fix.
36
- 6. [Submit a pull request](https://help.github.com/articles/creating-a-pull-request/).
37
-
38
- **Note:** You may gain more ground and avoid unecessary effort if you first open an issue with the proposed changes, but this step is not necessary.
39
-
40
- Translations
41
- ---
42
- If you are looking to provide language translation files, Please do so via [WordPress Plugin Translations](https://translate.wordpress.org/projects/wp-plugins/cmb2).
43
-
44
- Creating/Running Tests
45
- ---
46
- We use PHPUnit and the WordPress test suite for our unit/integration tests.
47
-
48
- 1. You can install the WordPress test suite [using the installer](https://github.com/CMB2/CMB2/blob/develop/tests/bin/install-wp-tests.sh#L3): `bash tests/bin/install-wp-tests.sh wordpress_test root ''`. (this will install the test suite in the temp folder on your computer, using a test database with those given credentials)
49
- 1. Install PHPUnit via composer, `composer install`.
50
- 1. Once Composer and the WordPress test sutie are installed, you can run phpunit via `./vendor/bin/phpunit` in the CMB2 directory.
51
-
52
- Additional Resources
53
- ---
54
-
55
- * [CMB2 Documentation Wiki](https://github.com/CMB2/CMB2/wiki)
56
- * [CMB2 Snippet Library](https://github.com/CMB2/CMB2-Snippet-Library)
57
- * [CMB2 API Documentation](http://cmb2.io/api/)
58
- * [General GitHub Documentation](http://help.github.com/)
59
- * [GitHub Pull Request documentation](http://help.github.com/send-pull-requests/)
60
- * [PHPUnit Tests Guide](http://phpunit.de/manual/current/en/writing-tests-for-phpunit.html)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/LICENSE DELETED
@@ -1,674 +0,0 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
3
-
4
- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
- Everyone is permitted to copy and distribute verbatim copies
6
- of this license document, but changing it is not allowed.
7
-
8
- Preamble
9
-
10
- The GNU General Public License is a free, copyleft license for
11
- software and other kinds of works.
12
-
13
- The licenses for most software and other practical works are designed
14
- to take away your freedom to share and change the works. By contrast,
15
- the GNU General Public License is intended to guarantee your freedom to
16
- share and change all versions of a program--to make sure it remains free
17
- software for all its users. We, the Free Software Foundation, use the
18
- GNU General Public License for most of our software; it applies also to
19
- any other work released this way by its authors. You can apply it to
20
- your programs, too.
21
-
22
- When we speak of free software, we are referring to freedom, not
23
- price. Our General Public Licenses are designed to make sure that you
24
- have the freedom to distribute copies of free software (and charge for
25
- them if you wish), that you receive source code or can get it if you
26
- want it, that you can change the software or use pieces of it in new
27
- free programs, and that you know you can do these things.
28
-
29
- To protect your rights, we need to prevent others from denying you
30
- these rights or asking you to surrender the rights. Therefore, you have
31
- certain responsibilities if you distribute copies of the software, or if
32
- you modify it: responsibilities to respect the freedom of others.
33
-
34
- For example, if you distribute copies of such a program, whether
35
- gratis or for a fee, you must pass on to the recipients the same
36
- freedoms that you received. You must make sure that they, too, receive
37
- or can get the source code. And you must show them these terms so they
38
- know their rights.
39
-
40
- Developers that use the GNU GPL protect your rights with two steps:
41
- (1) assert copyright on the software, and (2) offer you this License
42
- giving you legal permission to copy, distribute and/or modify it.
43
-
44
- For the developers' and authors' protection, the GPL clearly explains
45
- that there is no warranty for this free software. For both users' and
46
- authors' sake, the GPL requires that modified versions be marked as
47
- changed, so that their problems will not be attributed erroneously to
48
- authors of previous versions.
49
-
50
- Some devices are designed to deny users access to install or run
51
- modified versions of the software inside them, although the manufacturer
52
- can do so. This is fundamentally incompatible with the aim of
53
- protecting users' freedom to change the software. The systematic
54
- pattern of such abuse occurs in the area of products for individuals to
55
- use, which is precisely where it is most unacceptable. Therefore, we
56
- have designed this version of the GPL to prohibit the practice for those
57
- products. If such problems arise substantially in other domains, we
58
- stand ready to extend this provision to those domains in future versions
59
- of the GPL, as needed to protect the freedom of users.
60
-
61
- Finally, every program is threatened constantly by software patents.
62
- States should not allow patents to restrict development and use of
63
- software on general-purpose computers, but in those that do, we wish to
64
- avoid the special danger that patents applied to a free program could
65
- make it effectively proprietary. To prevent this, the GPL assures that
66
- patents cannot be used to render the program non-free.
67
-
68
- The precise terms and conditions for copying, distribution and
69
- modification follow.
70
-
71
- TERMS AND CONDITIONS
72
-
73
- 0. Definitions.
74
-
75
- "This License" refers to version 3 of the GNU General Public License.
76
-
77
- "Copyright" also means copyright-like laws that apply to other kinds of
78
- works, such as semiconductor masks.
79
-
80
- "The Program" refers to any copyrightable work licensed under this
81
- License. Each licensee is addressed as "you". "Licensees" and
82
- "recipients" may be individuals or organizations.
83
-
84
- To "modify" a work means to copy from or adapt all or part of the work
85
- in a fashion requiring copyright permission, other than the making of an
86
- exact copy. The resulting work is called a "modified version" of the
87
- earlier work or a work "based on" the earlier work.
88
-
89
- A "covered work" means either the unmodified Program or a work based
90
- on the Program.
91
-
92
- To "propagate" a work means to do anything with it that, without
93
- permission, would make you directly or secondarily liable for
94
- infringement under applicable copyright law, except executing it on a
95
- computer or modifying a private copy. Propagation includes copying,
96
- distribution (with or without modification), making available to the
97
- public, and in some countries other activities as well.
98
-
99
- To "convey" a work means any kind of propagation that enables other
100
- parties to make or receive copies. Mere interaction with a user through
101
- a computer network, with no transfer of a copy, is not conveying.
102
-
103
- An interactive user interface displays "Appropriate Legal Notices"
104
- to the extent that it includes a convenient and prominently visible
105
- feature that (1) displays an appropriate copyright notice, and (2)
106
- tells the user that there is no warranty for the work (except to the
107
- extent that warranties are provided), that licensees may convey the
108
- work under this License, and how to view a copy of this License. If
109
- the interface presents a list of user commands or options, such as a
110
- menu, a prominent item in the list meets this criterion.
111
-
112
- 1. Source Code.
113
-
114
- The "source code" for a work means the preferred form of the work
115
- for making modifications to it. "Object code" means any non-source
116
- form of a work.
117
-
118
- A "Standard Interface" means an interface that either is an official
119
- standard defined by a recognized standards body, or, in the case of
120
- interfaces specified for a particular programming language, one that
121
- is widely used among developers working in that language.
122
-
123
- The "System Libraries" of an executable work include anything, other
124
- than the work as a whole, that (a) is included in the normal form of
125
- packaging a Major Component, but which is not part of that Major
126
- Component, and (b) serves only to enable use of the work with that
127
- Major Component, or to implement a Standard Interface for which an
128
- implementation is available to the public in source code form. A
129
- "Major Component", in this context, means a major essential component
130
- (kernel, window system, and so on) of the specific operating system
131
- (if any) on which the executable work runs, or a compiler used to
132
- produce the work, or an object code interpreter used to run it.
133
-
134
- The "Corresponding Source" for a work in object code form means all
135
- the source code needed to generate, install, and (for an executable
136
- work) run the object code and to modify the work, including scripts to
137
- control those activities. However, it does not include the work's
138
- System Libraries, or general-purpose tools or generally available free
139
- programs which are used unmodified in performing those activities but
140
- which are not part of the work. For example, Corresponding Source
141
- includes interface definition files associated with source files for
142
- the work, and the source code for shared libraries and dynamically
143
- linked subprograms that the work is specifically designed to require,
144
- such as by intimate data communication or control flow between those
145
- subprograms and other parts of the work.
146
-
147
- The Corresponding Source need not include anything that users
148
- can regenerate automatically from other parts of the Corresponding
149
- Source.
150
-
151
- The Corresponding Source for a work in source code form is that
152
- same work.
153
-
154
- 2. Basic Permissions.
155
-
156
- All rights granted under this License are granted for the term of
157
- copyright on the Program, and are irrevocable provided the stated
158
- conditions are met. This License explicitly affirms your unlimited
159
- permission to run the unmodified Program. The output from running a
160
- covered work is covered by this License only if the output, given its
161
- content, constitutes a covered work. This License acknowledges your
162
- rights of fair use or other equivalent, as provided by copyright law.
163
-
164
- You may make, run and propagate covered works that you do not
165
- convey, without conditions so long as your license otherwise remains
166
- in force. You may convey covered works to others for the sole purpose
167
- of having them make modifications exclusively for you, or provide you
168
- with facilities for running those works, provided that you comply with
169
- the terms of this License in conveying all material for which you do
170
- not control copyright. Those thus making or running the covered works
171
- for you must do so exclusively on your behalf, under your direction
172
- and control, on terms that prohibit them from making any copies of
173
- your copyrighted material outside their relationship with you.
174
-
175
- Conveying under any other circumstances is permitted solely under
176
- the conditions stated below. Sublicensing is not allowed; section 10
177
- makes it unnecessary.
178
-
179
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
-
181
- No covered work shall be deemed part of an effective technological
182
- measure under any applicable law fulfilling obligations under article
183
- 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
- similar laws prohibiting or restricting circumvention of such
185
- measures.
186
-
187
- When you convey a covered work, you waive any legal power to forbid
188
- circumvention of technological measures to the extent such circumvention
189
- is effected by exercising rights under this License with respect to
190
- the covered work, and you disclaim any intention to limit operation or
191
- modification of the work as a means of enforcing, against the work's
192
- users, your or third parties' legal rights to forbid circumvention of
193
- technological measures.
194
-
195
- 4. Conveying Verbatim Copies.
196
-
197
- You may convey verbatim copies of the Program's source code as you
198
- receive it, in any medium, provided that you conspicuously and
199
- appropriately publish on each copy an appropriate copyright notice;
200
- keep intact all notices stating that this License and any
201
- non-permissive terms added in accord with section 7 apply to the code;
202
- keep intact all notices of the absence of any warranty; and give all
203
- recipients a copy of this License along with the Program.
204
-
205
- You may charge any price or no price for each copy that you convey,
206
- and you may offer support or warranty protection for a fee.
207
-
208
- 5. Conveying Modified Source Versions.
209
-
210
- You may convey a work based on the Program, or the modifications to
211
- produce it from the Program, in the form of source code under the
212
- terms of section 4, provided that you also meet all of these conditions:
213
-
214
- a) The work must carry prominent notices stating that you modified
215
- it, and giving a relevant date.
216
-
217
- b) The work must carry prominent notices stating that it is
218
- released under this License and any conditions added under section
219
- 7. This requirement modifies the requirement in section 4 to
220
- "keep intact all notices".
221
-
222
- c) You must license the entire work, as a whole, under this
223
- License to anyone who comes into possession of a copy. This
224
- License will therefore apply, along with any applicable section 7
225
- additional terms, to the whole of the work, and all its parts,
226
- regardless of how they are packaged. This License gives no
227
- permission to license the work in any other way, but it does not
228
- invalidate such permission if you have separately received it.
229
-
230
- d) If the work has interactive user interfaces, each must display
231
- Appropriate Legal Notices; however, if the Program has interactive
232
- interfaces that do not display Appropriate Legal Notices, your
233
- work need not make them do so.
234
-
235
- A compilation of a covered work with other separate and independent
236
- works, which are not by their nature extensions of the covered work,
237
- and which are not combined with it such as to form a larger program,
238
- in or on a volume of a storage or distribution medium, is called an
239
- "aggregate" if the compilation and its resulting copyright are not
240
- used to limit the access or legal rights of the compilation's users
241
- beyond what the individual works permit. Inclusion of a covered work
242
- in an aggregate does not cause this License to apply to the other
243
- parts of the aggregate.
244
-
245
- 6. Conveying Non-Source Forms.
246
-
247
- You may convey a covered work in object code form under the terms
248
- of sections 4 and 5, provided that you also convey the
249
- machine-readable Corresponding Source under the terms of this License,
250
- in one of these ways:
251
-
252
- a) Convey the object code in, or embodied in, a physical product
253
- (including a physical distribution medium), accompanied by the
254
- Corresponding Source fixed on a durable physical medium
255
- customarily used for software interchange.
256
-
257
- b) Convey the object code in, or embodied in, a physical product
258
- (including a physical distribution medium), accompanied by a
259
- written offer, valid for at least three years and valid for as
260
- long as you offer spare parts or customer support for that product
261
- model, to give anyone who possesses the object code either (1) a
262
- copy of the Corresponding Source for all the software in the
263
- product that is covered by this License, on a durable physical
264
- medium customarily used for software interchange, for a price no
265
- more than your reasonable cost of physically performing this
266
- conveying of source, or (2) access to copy the
267
- Corresponding Source from a network server at no charge.
268
-
269
- c) Convey individual copies of the object code with a copy of the
270
- written offer to provide the Corresponding Source. This
271
- alternative is allowed only occasionally and noncommercially, and
272
- only if you received the object code with such an offer, in accord
273
- with subsection 6b.
274
-
275
- d) Convey the object code by offering access from a designated
276
- place (gratis or for a charge), and offer equivalent access to the
277
- Corresponding Source in the same way through the same place at no
278
- further charge. You need not require recipients to copy the
279
- Corresponding Source along with the object code. If the place to
280
- copy the object code is a network server, the Corresponding Source
281
- may be on a different server (operated by you or a third party)
282
- that supports equivalent copying facilities, provided you maintain
283
- clear directions next to the object code saying where to find the
284
- Corresponding Source. Regardless of what server hosts the
285
- Corresponding Source, you remain obligated to ensure that it is
286
- available for as long as needed to satisfy these requirements.
287
-
288
- e) Convey the object code using peer-to-peer transmission, provided
289
- you inform other peers where the object code and Corresponding
290
- Source of the work are being offered to the general public at no
291
- charge under subsection 6d.
292
-
293
- A separable portion of the object code, whose source code is excluded
294
- from the Corresponding Source as a System Library, need not be
295
- included in conveying the object code work.
296
-
297
- A "User Product" is either (1) a "consumer product", which means any
298
- tangible personal property which is normally used for personal, family,
299
- or household purposes, or (2) anything designed or sold for incorporation
300
- into a dwelling. In determining whether a product is a consumer product,
301
- doubtful cases shall be resolved in favor of coverage. For a particular
302
- product received by a particular user, "normally used" refers to a
303
- typical or common use of that class of product, regardless of the status
304
- of the particular user or of the way in which the particular user
305
- actually uses, or expects or is expected to use, the product. A product
306
- is a consumer product regardless of whether the product has substantial
307
- commercial, industrial or non-consumer uses, unless such uses represent
308
- the only significant mode of use of the product.
309
-
310
- "Installation Information" for a User Product means any methods,
311
- procedures, authorization keys, or other information required to install
312
- and execute modified versions of a covered work in that User Product from
313
- a modified version of its Corresponding Source. The information must
314
- suffice to ensure that the continued functioning of the modified object
315
- code is in no case prevented or interfered with solely because
316
- modification has been made.
317
-
318
- If you convey an object code work under this section in, or with, or
319
- specifically for use in, a User Product, and the conveying occurs as
320
- part of a transaction in which the right of possession and use of the
321
- User Product is transferred to the recipient in perpetuity or for a
322
- fixed term (regardless of how the transaction is characterized), the
323
- Corresponding Source conveyed under this section must be accompanied
324
- by the Installation Information. But this requirement does not apply
325
- if neither you nor any third party retains the ability to install
326
- modified object code on the User Product (for example, the work has
327
- been installed in ROM).
328
-
329
- The requirement to provide Installation Information does not include a
330
- requirement to continue to provide support service, warranty, or updates
331
- for a work that has been modified or installed by the recipient, or for
332
- the User Product in which it has been modified or installed. Access to a
333
- network may be denied when the modification itself materially and
334
- adversely affects the operation of the network or violates the rules and
335
- protocols for communication across the network.
336
-
337
- Corresponding Source conveyed, and Installation Information provided,
338
- in accord with this section must be in a format that is publicly
339
- documented (and with an implementation available to the public in
340
- source code form), and must require no special password or key for
341
- unpacking, reading or copying.
342
-
343
- 7. Additional Terms.
344
-
345
- "Additional permissions" are terms that supplement the terms of this
346
- License by making exceptions from one or more of its conditions.
347
- Additional permissions that are applicable to the entire Program shall
348
- be treated as though they were included in this License, to the extent
349
- that they are valid under applicable law. If additional permissions
350
- apply only to part of the Program, that part may be used separately
351
- under those permissions, but the entire Program remains governed by
352
- this License without regard to the additional permissions.
353
-
354
- When you convey a copy of a covered work, you may at your option
355
- remove any additional permissions from that copy, or from any part of
356
- it. (Additional permissions may be written to require their own
357
- removal in certain cases when you modify the work.) You may place
358
- additional permissions on material, added by you to a covered work,
359
- for which you have or can give appropriate copyright permission.
360
-
361
- Notwithstanding any other provision of this License, for material you
362
- add to a covered work, you may (if authorized by the copyright holders of
363
- that material) supplement the terms of this License with terms:
364
-
365
- a) Disclaiming warranty or limiting liability differently from the
366
- terms of sections 15 and 16 of this License; or
367
-
368
- b) Requiring preservation of specified reasonable legal notices or
369
- author attributions in that material or in the Appropriate Legal
370
- Notices displayed by works containing it; or
371
-
372
- c) Prohibiting misrepresentation of the origin of that material, or
373
- requiring that modified versions of such material be marked in
374
- reasonable ways as different from the original version; or
375
-
376
- d) Limiting the use for publicity purposes of names of licensors or
377
- authors of the material; or
378
-
379
- e) Declining to grant rights under trademark law for use of some
380
- trade names, trademarks, or service marks; or
381
-
382
- f) Requiring indemnification of licensors and authors of that
383
- material by anyone who conveys the material (or modified versions of
384
- it) with contractual assumptions of liability to the recipient, for
385
- any liability that these contractual assumptions directly impose on
386
- those licensors and authors.
387
-
388
- All other non-permissive additional terms are considered "further
389
- restrictions" within the meaning of section 10. If the Program as you
390
- received it, or any part of it, contains a notice stating that it is
391
- governed by this License along with a term that is a further
392
- restriction, you may remove that term. If a license document contains
393
- a further restriction but permits relicensing or conveying under this
394
- License, you may add to a covered work material governed by the terms
395
- of that license document, provided that the further restriction does
396
- not survive such relicensing or conveying.
397
-
398
- If you add terms to a covered work in accord with this section, you
399
- must place, in the relevant source files, a statement of the
400
- additional terms that apply to those files, or a notice indicating
401
- where to find the applicable terms.
402
-
403
- Additional terms, permissive or non-permissive, may be stated in the
404
- form of a separately written license, or stated as exceptions;
405
- the above requirements apply either way.
406
-
407
- 8. Termination.
408
-
409
- You may not propagate or modify a covered work except as expressly
410
- provided under this License. Any attempt otherwise to propagate or
411
- modify it is void, and will automatically terminate your rights under
412
- this License (including any patent licenses granted under the third
413
- paragraph of section 11).
414
-
415
- However, if you cease all violation of this License, then your
416
- license from a particular copyright holder is reinstated (a)
417
- provisionally, unless and until the copyright holder explicitly and
418
- finally terminates your license, and (b) permanently, if the copyright
419
- holder fails to notify you of the violation by some reasonable means
420
- prior to 60 days after the cessation.
421
-
422
- Moreover, your license from a particular copyright holder is
423
- reinstated permanently if the copyright holder notifies you of the
424
- violation by some reasonable means, this is the first time you have
425
- received notice of violation of this License (for any work) from that
426
- copyright holder, and you cure the violation prior to 30 days after
427
- your receipt of the notice.
428
-
429
- Termination of your rights under this section does not terminate the
430
- licenses of parties who have received copies or rights from you under
431
- this License. If your rights have been terminated and not permanently
432
- reinstated, you do not qualify to receive new licenses for the same
433
- material under section 10.
434
-
435
- 9. Acceptance Not Required for Having Copies.
436
-
437
- You are not required to accept this License in order to receive or
438
- run a copy of the Program. Ancillary propagation of a covered work
439
- occurring solely as a consequence of using peer-to-peer transmission
440
- to receive a copy likewise does not require acceptance. However,
441
- nothing other than this License grants you permission to propagate or
442
- modify any covered work. These actions infringe copyright if you do
443
- not accept this License. Therefore, by modifying or propagating a
444
- covered work, you indicate your acceptance of this License to do so.
445
-
446
- 10. Automatic Licensing of Downstream Recipients.
447
-
448
- Each time you convey a covered work, the recipient automatically
449
- receives a license from the original licensors, to run, modify and
450
- propagate that work, subject to this License. You are not responsible
451
- for enforcing compliance by third parties with this License.
452
-
453
- An "entity transaction" is a transaction transferring control of an
454
- organization, or substantially all assets of one, or subdividing an
455
- organization, or merging organizations. If propagation of a covered
456
- work results from an entity transaction, each party to that
457
- transaction who receives a copy of the work also receives whatever
458
- licenses to the work the party's predecessor in interest had or could
459
- give under the previous paragraph, plus a right to possession of the
460
- Corresponding Source of the work from the predecessor in interest, if
461
- the predecessor has it or can get it with reasonable efforts.
462
-
463
- You may not impose any further restrictions on the exercise of the
464
- rights granted or affirmed under this License. For example, you may
465
- not impose a license fee, royalty, or other charge for exercise of
466
- rights granted under this License, and you may not initiate litigation
467
- (including a cross-claim or counterclaim in a lawsuit) alleging that
468
- any patent claim is infringed by making, using, selling, offering for
469
- sale, or importing the Program or any portion of it.
470
-
471
- 11. Patents.
472
-
473
- A "contributor" is a copyright holder who authorizes use under this
474
- License of the Program or a work on which the Program is based. The
475
- work thus licensed is called the contributor's "contributor version".
476
-
477
- A contributor's "essential patent claims" are all patent claims
478
- owned or controlled by the contributor, whether already acquired or
479
- hereafter acquired, that would be infringed by some manner, permitted
480
- by this License, of making, using, or selling its contributor version,
481
- but do not include claims that would be infringed only as a
482
- consequence of further modification of the contributor version. For
483
- purposes of this definition, "control" includes the right to grant
484
- patent sublicenses in a manner consistent with the requirements of
485
- this License.
486
-
487
- Each contributor grants you a non-exclusive, worldwide, royalty-free
488
- patent license under the contributor's essential patent claims, to
489
- make, use, sell, offer for sale, import and otherwise run, modify and
490
- propagate the contents of its contributor version.
491
-
492
- In the following three paragraphs, a "patent license" is any express
493
- agreement or commitment, however denominated, not to enforce a patent
494
- (such as an express permission to practice a patent or covenant not to
495
- sue for patent infringement). To "grant" such a patent license to a
496
- party means to make such an agreement or commitment not to enforce a
497
- patent against the party.
498
-
499
- If you convey a covered work, knowingly relying on a patent license,
500
- and the Corresponding Source of the work is not available for anyone
501
- to copy, free of charge and under the terms of this License, through a
502
- publicly available network server or other readily accessible means,
503
- then you must either (1) cause the Corresponding Source to be so
504
- available, or (2) arrange to deprive yourself of the benefit of the
505
- patent license for this particular work, or (3) arrange, in a manner
506
- consistent with the requirements of this License, to extend the patent
507
- license to downstream recipients. "Knowingly relying" means you have
508
- actual knowledge that, but for the patent license, your conveying the
509
- covered work in a country, or your recipient's use of the covered work
510
- in a country, would infringe one or more identifiable patents in that
511
- country that you have reason to believe are valid.
512
-
513
- If, pursuant to or in connection with a single transaction or
514
- arrangement, you convey, or propagate by procuring conveyance of, a
515
- covered work, and grant a patent license to some of the parties
516
- receiving the covered work authorizing them to use, propagate, modify
517
- or convey a specific copy of the covered work, then the patent license
518
- you grant is automatically extended to all recipients of the covered
519
- work and works based on it.
520
-
521
- A patent license is "discriminatory" if it does not include within
522
- the scope of its coverage, prohibits the exercise of, or is
523
- conditioned on the non-exercise of one or more of the rights that are
524
- specifically granted under this License. You may not convey a covered
525
- work if you are a party to an arrangement with a third party that is
526
- in the business of distributing software, under which you make payment
527
- to the third party based on the extent of your activity of conveying
528
- the work, and under which the third party grants, to any of the
529
- parties who would receive the covered work from you, a discriminatory
530
- patent license (a) in connection with copies of the covered work
531
- conveyed by you (or copies made from those copies), or (b) primarily
532
- for and in connection with specific products or compilations that
533
- contain the covered work, unless you entered into that arrangement,
534
- or that patent license was granted, prior to 28 March 2007.
535
-
536
- Nothing in this License shall be construed as excluding or limiting
537
- any implied license or other defenses to infringement that may
538
- otherwise be available to you under applicable patent law.
539
-
540
- 12. No Surrender of Others' Freedom.
541
-
542
- If conditions are imposed on you (whether by court order, agreement or
543
- otherwise) that contradict the conditions of this License, they do not
544
- excuse you from the conditions of this License. If you cannot convey a
545
- covered work so as to satisfy simultaneously your obligations under this
546
- License and any other pertinent obligations, then as a consequence you may
547
- not convey it at all. For example, if you agree to terms that obligate you
548
- to collect a royalty for further conveying from those to whom you convey
549
- the Program, the only way you could satisfy both those terms and this
550
- License would be to refrain entirely from conveying the Program.
551
-
552
- 13. Use with the GNU Affero General Public License.
553
-
554
- Notwithstanding any other provision of this License, you have
555
- permission to link or combine any covered work with a work licensed
556
- under version 3 of the GNU Affero General Public License into a single
557
- combined work, and to convey the resulting work. The terms of this
558
- License will continue to apply to the part which is the covered work,
559
- but the special requirements of the GNU Affero General Public License,
560
- section 13, concerning interaction through a network will apply to the
561
- combination as such.
562
-
563
- 14. Revised Versions of this License.
564
-
565
- The Free Software Foundation may publish revised and/or new versions of
566
- the GNU General Public License from time to time. Such new versions will
567
- be similar in spirit to the present version, but may differ in detail to
568
- address new problems or concerns.
569
-
570
- Each version is given a distinguishing version number. If the
571
- Program specifies that a certain numbered version of the GNU General
572
- Public License "or any later version" applies to it, you have the
573
- option of following the terms and conditions either of that numbered
574
- version or of any later version published by the Free Software
575
- Foundation. If the Program does not specify a version number of the
576
- GNU General Public License, you may choose any version ever published
577
- by the Free Software Foundation.
578
-
579
- If the Program specifies that a proxy can decide which future
580
- versions of the GNU General Public License can be used, that proxy's
581
- public statement of acceptance of a version permanently authorizes you
582
- to choose that version for the Program.
583
-
584
- Later license versions may give you additional or different
585
- permissions. However, no additional obligations are imposed on any
586
- author or copyright holder as a result of your choosing to follow a
587
- later version.
588
-
589
- 15. Disclaimer of Warranty.
590
-
591
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
- APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
- OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
- IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
- ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
-
600
- 16. Limitation of Liability.
601
-
602
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
- GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
- USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
- PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
- EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
- SUCH DAMAGES.
611
-
612
- 17. Interpretation of Sections 15 and 16.
613
-
614
- If the disclaimer of warranty and limitation of liability provided
615
- above cannot be given local legal effect according to their terms,
616
- reviewing courts shall apply local law that most closely approximates
617
- an absolute waiver of all civil liability in connection with the
618
- Program, unless a warranty or assumption of liability accompanies a
619
- copy of the Program in return for a fee.
620
-
621
- END OF TERMS AND CONDITIONS
622
-
623
- How to Apply These Terms to Your New Programs
624
-
625
- If you develop a new program, and you want it to be of the greatest
626
- possible use to the public, the best way to achieve this is to make it
627
- free software which everyone can redistribute and change under these terms.
628
-
629
- To do so, attach the following notices to the program. It is safest
630
- to attach them to the start of each source file to most effectively
631
- state the exclusion of warranty; and each file should have at least
632
- the "copyright" line and a pointer to where the full notice is found.
633
-
634
- <one line to give the program's name and a brief idea of what it does.>
635
- Copyright (C) <year> <name of author>
636
-
637
- This program is free software: you can redistribute it and/or modify
638
- it under the terms of the GNU General Public License as published by
639
- the Free Software Foundation, either version 3 of the License, or
640
- (at your option) any later version.
641
-
642
- This program is distributed in the hope that it will be useful,
643
- but WITHOUT ANY WARRANTY; without even the implied warranty of
644
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
- GNU General Public License for more details.
646
-
647
- You should have received a copy of the GNU General Public License
648
- along with this program. If not, see <https://www.gnu.org/licenses/>.
649
-
650
- Also add information on how to contact you by electronic and paper mail.
651
-
652
- If the program does terminal interaction, make it output a short
653
- notice like this when it starts in an interactive mode:
654
-
655
- <program> Copyright (C) <year> <name of author>
656
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
- This is free software, and you are welcome to redistribute it
658
- under certain conditions; type `show c' for details.
659
-
660
- The hypothetical commands `show w' and `show c' should show the appropriate
661
- parts of the General Public License. Of course, your program's commands
662
- might be different; for a GUI interface, you would use an "about box".
663
-
664
- You should also get your employer (if you work as a programmer) or school,
665
- if any, to sign a "copyright disclaimer" for the program, if necessary.
666
- For more information on this, and how to apply and follow the GNU GPL, see
667
- <https://www.gnu.org/licenses/>.
668
-
669
- The GNU General Public License does not permit incorporating your program
670
- into proprietary programs. If your program is a subroutine library, you
671
- may consider it more useful to permit linking proprietary applications with
672
- the library. If this is what you want to do, use the GNU Lesser General
673
- Public License instead of this License. But first, please read
674
- <https://www.gnu.org/licenses/why-not-lgpl.html>.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/bootstrap.php DELETED
@@ -1,84 +0,0 @@
1
- <?php
2
- /**
3
- * Bootstraps the CMB2 process
4
- *
5
- * @category WordPress_Plugin
6
- * @package CMB2
7
- * @author CMB2
8
- * @license GPL-2.0+
9
- * @link https://cmb2.io
10
- */
11
-
12
- /**
13
- * Function to encapsulate the CMB2 bootstrap process.
14
- *
15
- * @since 2.2.0
16
- * @return void
17
- */
18
- function cmb2_bootstrap() {
19
-
20
- if ( is_admin() ) {
21
- /**
22
- * Fires on the admin side when CMB2 is included/loaded.
23
- *
24
- * In most cases, this should be used to add metaboxes. See example-functions.php
25
- */
26
- do_action( 'cmb2_admin_init' );
27
- }
28
-
29
- /**
30
- * Fires when CMB2 is included/loaded
31
- *
32
- * Can be used to add metaboxes if needed on the front-end or WP-API (or the front and backend).
33
- */
34
- do_action( 'cmb2_init' );
35
-
36
- /**
37
- * For back-compat. Does the dirty-work of instantiating all the
38
- * CMB2 instances for the cmb2_meta_boxes filter
39
- *
40
- * @since 2.0.2
41
- */
42
- $cmb_config_arrays = apply_filters( 'cmb2_meta_boxes', array() );
43
- foreach ( (array) $cmb_config_arrays as $cmb_config ) {
44
- new CMB2( $cmb_config );
45
- }
46
-
47
- /**
48
- * Fires after all CMB2 instances are created
49
- */
50
- do_action( 'cmb2_init_before_hookup' );
51
-
52
- /**
53
- * Get all created metaboxes, and instantiate CMB2_Hookup
54
- * on metaboxes which require it.
55
- *
56
- * @since 2.0.2
57
- */
58
- foreach ( CMB2_Boxes::get_all() as $cmb ) {
59
-
60
- /**
61
- * Initiates the box "hookup" into WordPress.
62
- *
63
- * Unless the 'hookup' box property is `false`, the box will be hooked in as
64
- * a post/user/comment/option/term box.
65
- *
66
- * And if the 'show_in_rest' box property is set, the box will be hooked
67
- * into the CMB2 REST API.
68
- *
69
- * The dynamic portion of the hook name, $cmb->cmb_id, is the box id.
70
- *
71
- * @since 2.2.6
72
- *
73
- * @param array $cmb The CMB2 object to hookup.
74
- */
75
- do_action( "cmb2_init_hookup_{$cmb->cmb_id}", $cmb );
76
- }
77
-
78
- /**
79
- * Fires after CMB2 initiation process has been completed
80
- */
81
- do_action( 'cmb2_after_init' );
82
- }
83
-
84
- /* End. That's it, folks! */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/css/cmb2-display-rtl.css DELETED
@@ -1,45 +0,0 @@
1
- /*!
2
- * CMB2 - v2.9.0 - 2021-03-03
3
- * https://cmb2.io
4
- * Copyright (c) 2021
5
- * Licensed GPLv2+
6
- */
7
-
8
- /*--------------------------------------------------------------
9
- * CMB2 Display Styling
10
- --------------------------------------------------------------*/
11
- /* line 6, sass/partials/_display.scss */
12
- .cmb2-colorpicker-swatch span {
13
- display: inline-block;
14
- width: 1em;
15
- height: 1em;
16
- border-radius: 1em;
17
- float: right;
18
- margin-top: 3px;
19
- margin-left: 2px;
20
- }
21
-
22
- /* line 17, sass/partials/_display.scss */
23
- .cmb2-code {
24
- overflow: scroll;
25
- }
26
-
27
- /* line 21, sass/partials/_display.scss */
28
- .cmb-image-display {
29
- max-width: 100%;
30
- height: auto;
31
- }
32
-
33
- /* line 26, sass/partials/_display.scss */
34
- .cmb2-display-file-list li {
35
- display: inline;
36
- margin: 0 0 .5em .5em;
37
- }
38
-
39
- /* line 31, sass/partials/_display.scss */
40
- .cmb2-oembed * {
41
- max-width: 100%;
42
- height: auto;
43
- }
44
-
45
- /*# sourceMappingURL=cmb2-display.css.map */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/css/cmb2-display-rtl.min.css DELETED
@@ -1 +0,0 @@
1
- .cmb2-colorpicker-swatch span{display:inline-block;width:1em;height:1em;border-radius:1em;float:right;margin-top:3px;margin-left:2px}.cmb2-code{overflow:scroll}.cmb-image-display{max-width:100%;height:auto}.cmb2-display-file-list li{display:inline;margin:0 0 .5em .5em}.cmb2-oembed *{max-width:100%;height:auto}
 
includes/lib/cmb2/css/cmb2-display.css DELETED
@@ -1,45 +0,0 @@
1
- /*!
2
- * CMB2 - v2.9.0 - 2021-03-03
3
- * https://cmb2.io
4
- * Copyright (c) 2021
5
- * Licensed GPLv2+
6
- */
7
-
8
- /*--------------------------------------------------------------
9
- * CMB2 Display Styling
10
- --------------------------------------------------------------*/
11
- /* line 6, sass/partials/_display.scss */
12
- .cmb2-colorpicker-swatch span {
13
- display: inline-block;
14
- width: 1em;
15
- height: 1em;
16
- border-radius: 1em;
17
- float: left;
18
- margin-top: 3px;
19
- margin-right: 2px;
20
- }
21
-
22
- /* line 17, sass/partials/_display.scss */
23
- .cmb2-code {
24
- overflow: scroll;
25
- }
26
-
27
- /* line 21, sass/partials/_display.scss */
28
- .cmb-image-display {
29
- max-width: 100%;
30
- height: auto;
31
- }
32
-
33
- /* line 26, sass/partials/_display.scss */
34
- .cmb2-display-file-list li {
35
- display: inline;
36
- margin: 0 .5em .5em 0;
37
- }
38
-
39
- /* line 31, sass/partials/_display.scss */
40
- .cmb2-oembed * {
41
- max-width: 100%;
42
- height: auto;
43
- }
44
-
45
- /*# sourceMappingURL=cmb2-display.css.map */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/css/cmb2-display.css.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "mappings": "AAAA;;gEAEgE;;AAG/D,6BAAK;EACJ,OAAO,EAAE,YAAY;EACrB,KAAK,EAAE,GAAG;EACV,MAAM,EAAE,GAAG;EACX,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,IAAI;EACX,UAAU,EAAE,GAAG;EACf,YAAY,EAAE,GAAG;;;;AAInB,UAAW;EACV,QAAQ,EAAE,MAAM;;;;AAGjB,kBAAmB;EAClB,SAAS,EAAE,IAAI;EACf,MAAM,EAAE,IAAI;;;;AAGb,0BAA2B;EAC1B,OAAO,EAAE,MAAM;EACf,MAAM,EAAE,aAAa;;;;AAGtB,cAAe;EACd,SAAS,EAAE,IAAI;EACf,MAAM,EAAE,IAAI",
4
- "sources": ["sass/partials/_display.scss"],
5
- "names": [],
6
- "file": "cmb2-display.css"
7
- }
 
 
 
 
 
 
 
includes/lib/cmb2/css/cmb2-display.min.css DELETED
@@ -1 +0,0 @@
1
- .cmb2-colorpicker-swatch span{display:inline-block;width:1em;height:1em;border-radius:1em;float:left;margin-top:3px;margin-right:2px}.cmb2-code{overflow:scroll}.cmb-image-display{max-width:100%;height:auto}.cmb2-display-file-list li{display:inline;margin:0 .5em .5em 0}.cmb2-oembed *{max-width:100%;height:auto}
 
includes/lib/cmb2/css/cmb2-front-rtl.css DELETED
@@ -1,1373 +0,0 @@
1
- /*!
2
- * CMB2 - v2.9.0 - 2021-03-03
3
- * https://cmb2.io
4
- * Copyright (c) 2021
5
- * Licensed GPLv2+
6
- */
7
-
8
- @charset "UTF-8";
9
- /*--------------------------------------------------------------
10
- * Main Wrap
11
- --------------------------------------------------------------*/
12
- /* line 5, sass/partials/_main_wrap.scss */
13
- .cmb2-wrap {
14
- margin: 0;
15
- }
16
- /* line 8, sass/partials/_main_wrap.scss */
17
- .cmb2-wrap input,
18
- .cmb2-wrap textarea {
19
- max-width: 100%;
20
- }
21
- /* line 15, sass/partials/_main_wrap.scss */
22
- .cmb2-wrap input[type="text"].cmb2-oembed {
23
- width: 100%;
24
- }
25
- /* line 20, sass/partials/_main_wrap.scss */
26
- .cmb2-wrap textarea {
27
- width: 500px;
28
- padding: 8px;
29
- }
30
- /* line 24, sass/partials/_main_wrap.scss */
31
- .cmb2-wrap textarea.cmb2-textarea-code {
32
- font-family: "Courier 10 Pitch", Courier, monospace;
33
- line-height: 16px;
34
- }
35
- /* line 32, sass/partials/_main_wrap.scss */
36
- .cmb2-wrap input.cmb2-text-small, .cmb2-wrap input.cmb2-timepicker {
37
- width: 100px;
38
- }
39
- /* line 38, sass/partials/_main_wrap.scss */
40
- .cmb2-wrap input.cmb2-text-money {
41
- width: 90px;
42
- }
43
- /* line 43, sass/partials/_main_wrap.scss */
44
- .cmb2-wrap input.cmb2-text-medium {
45
- width: 230px;
46
- }
47
- /* line 48, sass/partials/_main_wrap.scss */
48
- .cmb2-wrap input.cmb2-upload-file {
49
- width: 65%;
50
- }
51
- /* line 52, sass/partials/_main_wrap.scss */
52
- .cmb2-wrap input.ed_button {
53
- padding: 2px 4px;
54
- }
55
- /* line 57, sass/partials/_main_wrap.scss */
56
- .cmb2-wrap input:not([type="hidden"]) + input,
57
- .cmb2-wrap input:not([type="hidden"]) + .button-secondary,
58
- .cmb2-wrap input:not([type="hidden"]) + select {
59
- margin-right: 20px;
60
- }
61
- /* line 65, sass/partials/_main_wrap.scss */
62
- .cmb2-wrap ul {
63
- margin: 0;
64
- }
65
- /* line 69, sass/partials/_main_wrap.scss */
66
- .cmb2-wrap li {
67
- font-size: 14px;
68
- line-height: 16px;
69
- margin: 1px 0 5px 0;
70
- }
71
- /* line 80, sass/partials/_main_wrap.scss */
72
- .cmb2-wrap select {
73
- font-size: 14px;
74
- margin-top: 3px;
75
- }
76
- /* line 85, sass/partials/_main_wrap.scss */
77
- .cmb2-wrap input:focus,
78
- .cmb2-wrap textarea:focus {
79
- background: #fffff8;
80
- }
81
- /* line 90, sass/partials/_main_wrap.scss */
82
- .cmb2-wrap input[type="radio"] {
83
- margin: 0 0 0 5px;
84
- padding: 0;
85
- }
86
- /* line 95, sass/partials/_main_wrap.scss */
87
- .cmb2-wrap input[type="checkbox"] {
88
- margin: 0 0 0 5px;
89
- padding: 0;
90
- }
91
- /* line 100, sass/partials/_main_wrap.scss */
92
- .cmb2-wrap button,
93
- .cmb2-wrap .button-secondary {
94
- white-space: nowrap;
95
- }
96
- /* line 105, sass/partials/_main_wrap.scss */
97
- .cmb2-wrap .mceLayout {
98
- border: 1px solid #e9e9e9 !important;
99
- }
100
- /* line 109, sass/partials/_main_wrap.scss */
101
- .cmb2-wrap .mceIframeContainer {
102
- background: #ffffff;
103
- }
104
- /* line 113, sass/partials/_main_wrap.scss */
105
- .cmb2-wrap .meta_mce {
106
- width: 97%;
107
- }
108
- /* line 116, sass/partials/_main_wrap.scss */
109
- .cmb2-wrap .meta_mce textarea {
110
- width: 100%;
111
- }
112
- /* line 122, sass/partials/_main_wrap.scss */
113
- .cmb2-wrap .cmb-multicheck-toggle {
114
- margin-top: -1em;
115
- }
116
- /* line 127, sass/partials/_main_wrap.scss */
117
- .cmb2-wrap .wp-picker-clear.button,
118
- .cmb2-wrap .wp-picker-default.button {
119
- margin-right: 6px;
120
- padding: 2px 8px;
121
- }
122
- /* line 133, sass/partials/_main_wrap.scss */
123
- .cmb2-wrap .cmb-row {
124
- margin: 0;
125
- }
126
- /* line 136, sass/partials/_main_wrap.scss */
127
- .cmb2-wrap .cmb-row:after {
128
- content: '';
129
- clear: both;
130
- display: block;
131
- width: 100%;
132
- }
133
- /* line 143, sass/partials/_main_wrap.scss */
134
- .cmb2-wrap .cmb-row.cmb-repeat .cmb2-metabox-description {
135
- padding-top: 0;
136
- padding-bottom: 1em;
137
- }
138
-
139
- /* line 154, sass/partials/_main_wrap.scss */
140
- body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type="radio"]::before {
141
- margin: .1875rem;
142
- }
143
- @media screen and (max-width: 782px) {
144
- /* line 154, sass/partials/_main_wrap.scss */
145
- body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type="radio"]::before {
146
- margin: .4375rem;
147
- }
148
- }
149
-
150
- /* line 162, sass/partials/_main_wrap.scss */
151
- .cmb2-metabox {
152
- clear: both;
153
- margin: 0;
154
- }
155
- /* line 168, sass/partials/_main_wrap.scss */
156
- .cmb2-metabox > .cmb-row:first-of-type > .cmb-td,
157
- .cmb2-metabox > .cmb-row:first-of-type > .cmb-th,
158
- .cmb2-metabox .cmb-field-list > .cmb-row:first-of-type > .cmb-td,
159
- .cmb2-metabox .cmb-field-list > .cmb-row:first-of-type > .cmb-th {
160
- border: 0;
161
- }
162
-
163
- /* line 175, sass/partials/_main_wrap.scss */
164
- .cmb-add-row {
165
- margin: 1.8em 0 0;
166
- }
167
-
168
- /* line 179, sass/partials/_main_wrap.scss */
169
- .cmb-nested .cmb-td,
170
- .cmb-repeatable-group .cmb-th,
171
- .cmb-repeatable-group:first-of-type {
172
- border: 0;
173
- }
174
-
175
- /* line 185, sass/partials/_main_wrap.scss */
176
- .cmb-row:last-of-type,
177
- .cmb2-wrap .cmb-row:last-of-type,
178
- .cmb-repeatable-group:last-of-type {
179
- border-bottom: 0;
180
- }
181
-
182
- /* line 191, sass/partials/_main_wrap.scss */
183
- .cmb-repeatable-grouping {
184
- border: 1px solid #e9e9e9;
185
- padding: 0 1em;
186
- }
187
- /* line 195, sass/partials/_main_wrap.scss */
188
- .cmb-repeatable-grouping.cmb-row {
189
- margin: 0 0 0.8em;
190
- }
191
-
192
- /* line 203, sass/partials/_main_wrap.scss */
193
- .cmb-th {
194
- color: #222222;
195
- float: right;
196
- font-weight: 600;
197
- padding: 20px 0 20px 10px;
198
- vertical-align: top;
199
- width: 200px;
200
- }
201
- @media (max-width: 450px) {
202
- /* line 203, sass/partials/_main_wrap.scss */
203
- .cmb-th {
204
- font-size: 1.2em;
205
- display: block;
206
- float: none;
207
- padding-bottom: 1em;
208
- text-align: right;
209
- width: 100%;
210
- }
211
- /* line 27, sass/partials/_mixins.scss */
212
- .cmb-th label {
213
- display: block;
214
- margin-top: 0;
215
- margin-bottom: 0.5em;
216
- }
217
- }
218
-
219
- /* line 216, sass/partials/_main_wrap.scss */
220
- .cmb-td {
221
- line-height: 1.3;
222
- max-width: 100%;
223
- padding: 15px 10px;
224
- vertical-align: middle;
225
- }
226
-
227
- /* line 225, sass/partials/_main_wrap.scss */
228
- .cmb-type-title .cmb-td {
229
- padding: 0;
230
- }
231
-
232
- /* line 230, sass/partials/_main_wrap.scss */
233
- .cmb-th label {
234
- display: block;
235
- padding: 5px 0;
236
- }
237
-
238
- /* line 235, sass/partials/_main_wrap.scss */
239
- .cmb-th + .cmb-td {
240
- float: right;
241
- }
242
-
243
- /* line 239, sass/partials/_main_wrap.scss */
244
- .cmb-td .cmb-td {
245
- padding-bottom: 1em;
246
- }
247
-
248
- /* line 243, sass/partials/_main_wrap.scss */
249
- .cmb-remove-row {
250
- text-align: left;
251
- }
252
-
253
- /* line 247, sass/partials/_main_wrap.scss */
254
- .empty-row.hidden {
255
- display: none;
256
- }
257
-
258
- /* line 252, sass/partials/_main_wrap.scss */
259
- .cmb-repeat-table {
260
- background-color: #fafafa;
261
- border: 1px solid #e1e1e1;
262
- }
263
- /* line 256, sass/partials/_main_wrap.scss */
264
- .cmb-repeat-table .cmb-row.cmb-repeat-row {
265
- position: relative;
266
- counter-increment: el;
267
- margin: 0;
268
- padding: 10px 50px 10px 10px;
269
- border-bottom: none !important;
270
- }
271
- /* line 264, sass/partials/_main_wrap.scss */
272
- .cmb-repeat-table .cmb-row.cmb-repeat-row + .cmb-repeat-row {
273
- border-top: solid 1px #e9e9e9;
274
- }
275
- /* line 268, sass/partials/_main_wrap.scss */
276
- .cmb-repeat-table .cmb-row.cmb-repeat-row.ui-sortable-helper {
277
- outline: dashed 2px #e9e9e9 !important;
278
- }
279
- /* line 272, sass/partials/_main_wrap.scss */
280
- .cmb-repeat-table .cmb-row.cmb-repeat-row:before {
281
- content: counter(el);
282
- display: block;
283
- top: 0;
284
- right: 0;
285
- position: absolute;
286
- width: 35px;
287
- height: 100%;
288
- line-height: 35px;
289
- cursor: move;
290
- color: #757575;
291
- text-align: center;
292
- border-left: solid 1px #e9e9e9;
293
- }
294
- /* line 289, sass/partials/_main_wrap.scss */
295
- .cmb-repeat-table .cmb-row.cmb-repeat-row .cmb-td {
296
- margin: 0;
297
- padding: 0;
298
- }
299
- /* line 296, sass/partials/_main_wrap.scss */
300
- .cmb-repeat-table + .cmb-add-row {
301
- margin: 0;
302
- }
303
- /* line 299, sass/partials/_main_wrap.scss */
304
- .cmb-repeat-table + .cmb-add-row:before {
305
- content: '';
306
- width: 1px;
307
- height: 1.6em;
308
- display: block;
309
- margin-right: 17px;
310
- background-color: gainsboro;
311
- }
312
- /* line 309, sass/partials/_main_wrap.scss */
313
- .cmb-repeat-table .cmb-remove-row {
314
- top: 7px;
315
- left: 7px;
316
- position: absolute;
317
- width: auto;
318
- margin-right: 0;
319
- padding: 0 !important;
320
- display: none;
321
- }
322
- /* line 320, sass/partials/_main_wrap.scss */
323
- .cmb-repeat-table .cmb-remove-row > .cmb-remove-row-button {
324
- font-size: 20px;
325
- text-indent: -1000px;
326
- overflow: hidden;
327
- position: relative;
328
- height: auto;
329
- line-height: 1;
330
- padding: 0 10px 0;
331
- }
332
- /* line 331, sass/partials/_main_wrap.scss */
333
- .cmb-repeat-table .cmb-remove-row > .cmb-remove-row-button:before {
334
- content: "";
335
- font-family: 'Dashicons';
336
- speak: none;
337
- font-weight: normal;
338
- font-variant: normal;
339
- text-transform: none;
340
- line-height: 1;
341
- -webkit-font-smoothing: antialiased;
342
- margin: 0;
343
- text-indent: 0;
344
- position: absolute;
345
- top: 0;
346
- right: 0;
347
- width: 100%;
348
- height: 100%;
349
- text-align: center;
350
- }
351
- /* line 337, sass/partials/_main_wrap.scss */
352
- .cmb-repeat-table .cmb-repeat-row:hover .cmb-remove-row {
353
- display: block;
354
- }
355
-
356
- /* line 345, sass/partials/_main_wrap.scss */
357
- .cmb-repeatable-group .cmb-th {
358
- padding: 5px;
359
- }
360
- /* line 349, sass/partials/_main_wrap.scss */
361
- .cmb-repeatable-group .cmb-group-title {
362
- background-color: #e9e9e9;
363
- padding: 8px 2.2em 8px 12px;
364
- margin: 0 -1em;
365
- min-height: 1.5em;
366
- font-size: 14px;
367
- line-height: 1.4;
368
- }
369
- /* line 357, sass/partials/_main_wrap.scss */
370
- .cmb-repeatable-group .cmb-group-title h4 {
371
- border: 0;
372
- margin: 0;
373
- font-size: 1.2em;
374
- font-weight: 500;
375
- padding: 0.5em 0.75em;
376
- }
377
- /* line 365, sass/partials/_main_wrap.scss */
378
- .cmb-repeatable-group .cmb-group-title .cmb-th {
379
- display: block;
380
- width: 100%;
381
- }
382
- /* line 371, sass/partials/_main_wrap.scss */
383
- .cmb-repeatable-group .cmb-group-description .cmb-th {
384
- font-size: 1.2em;
385
- display: block;
386
- float: none;
387
- padding-bottom: 1em;
388
- text-align: right;
389
- width: 100%;
390
- }
391
- /* line 27, sass/partials/_mixins.scss */
392
- .cmb-repeatable-group .cmb-group-description .cmb-th label {
393
- display: block;
394
- margin-top: 0;
395
- margin-bottom: 0.5em;
396
- }
397
- /* line 375, sass/partials/_main_wrap.scss */
398
- .cmb-repeatable-group .cmb-shift-rows {
399
- margin-left: 1em;
400
- }
401
- /* line 378, sass/partials/_main_wrap.scss */
402
- .cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-up-alt2 {
403
- margin-top: .15em;
404
- }
405
- /* line 382, sass/partials/_main_wrap.scss */
406
- .cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-down-alt2 {
407
- margin-top: .2em;
408
- }
409
- /* line 387, sass/partials/_main_wrap.scss */
410
- .cmb-repeatable-group .cmb2-upload-button {
411
- float: left;
412
- }
413
-
414
- /* line 393, sass/partials/_main_wrap.scss */
415
- p.cmb2-metabox-description {
416
- color: #666;
417
- letter-spacing: 0.01em;
418
- margin: 0;
419
- padding-top: .5em;
420
- }
421
-
422
- /* line 400, sass/partials/_main_wrap.scss */
423
- span.cmb2-metabox-description {
424
- color: #666;
425
- letter-spacing: 0.01em;
426
- }
427
-
428
- /* line 405, sass/partials/_main_wrap.scss */
429
- .cmb2-metabox-title {
430
- margin: 0 0 5px 0;
431
- padding: 5px 0 0 0;
432
- font-size: 14px;
433
- }
434
-
435
- /* line 411, sass/partials/_main_wrap.scss */
436
- .cmb-inline ul {
437
- padding: 4px 0 0 0;
438
- }
439
-
440
- /* line 415, sass/partials/_main_wrap.scss */
441
- .cmb-inline li {
442
- display: inline-block;
443
- padding-left: 18px;
444
- }
445
-
446
- /* line 420, sass/partials/_main_wrap.scss */
447
- .cmb-type-textarea-code pre {
448
- margin: 0;
449
- }
450
-
451
- /* line 426, sass/partials/_main_wrap.scss */
452
- .cmb2-media-status .img-status {
453
- clear: none;
454
- display: inline-block;
455
- vertical-align: middle;
456
- margin-left: 10px;
457
- width: auto;
458
- }
459
- /* line 433, sass/partials/_main_wrap.scss */
460
- .cmb2-media-status .img-status img {
461
- max-width: 350px;
462
- height: auto;
463
- }
464
- /* line 439, sass/partials/_main_wrap.scss */
465
- .cmb2-media-status .img-status img,
466
- .cmb2-media-status .embed-status {
467
- background: #eee;
468
- border: 5px solid #ffffff;
469
- outline: 1px solid #e9e9e9;
470
- box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
471
- background-image: linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%, #d0d0d0), linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%, #d0d0d0);
472
- background-position: 0 0, 10px 10px;
473
- background-size: 20px 20px;
474
- border-radius: 2px;
475
- -moz-border-radius: 2px;
476
- margin: 15px 0 0 0;
477
- }
478
- /* line 453, sass/partials/_main_wrap.scss */
479
- .cmb2-media-status .embed-status {
480
- float: right;
481
- max-width: 800px;
482
- }
483
- /* line 458, sass/partials/_main_wrap.scss */
484
- .cmb2-media-status .img-status, .cmb2-media-status .embed-status {
485
- position: relative;
486
- }
487
- /* line 461, sass/partials/_main_wrap.scss */
488
- .cmb2-media-status .img-status .cmb2-remove-file-button, .cmb2-media-status .embed-status .cmb2-remove-file-button {
489
- background: url(../images/ico-delete.png);
490
- height: 16px;
491
- right: -5px;
492
- position: absolute;
493
- text-indent: -9999px;
494
- top: -5px;
495
- width: 16px;
496
- }
497
- /* line 475, sass/partials/_main_wrap.scss */
498
- .cmb2-media-status .img-status .cmb2-remove-file-button {
499
- top: 10px;
500
- }
501
- /* line 480, sass/partials/_main_wrap.scss */
502
- .cmb2-media-status .img-status img, .cmb2-media-status .file-status > span {
503
- cursor: pointer;
504
- }
505
- /* line 485, sass/partials/_main_wrap.scss */
506
- .cmb2-media-status.cmb-attach-list .img-status img, .cmb2-media-status.cmb-attach-list .file-status > span {
507
- cursor: move;
508
- }
509
-
510
- /* line 492, sass/partials/_main_wrap.scss */
511
- .cmb-type-file-list .cmb2-media-status .img-status {
512
- clear: none;
513
- vertical-align: middle;
514
- width: auto;
515
- margin-left: 10px;
516
- margin-bottom: 10px;
517
- margin-top: 0;
518
- }
519
-
520
- /* line 501, sass/partials/_main_wrap.scss */
521
- .cmb-attach-list li {
522
- clear: both;
523
- display: inline-block;
524
- width: 100%;
525
- margin-top: 5px;
526
- margin-bottom: 10px;
527
- }
528
- /* line 507, sass/partials/_main_wrap.scss */
529
- .cmb-attach-list li img {
530
- float: right;
531
- margin-left: 10px;
532
- }
533
-
534
- /* line 513, sass/partials/_main_wrap.scss */
535
- .cmb2-remove-wrapper {
536
- margin: 0;
537
- }
538
-
539
- /* line 517, sass/partials/_main_wrap.scss */
540
- .child-cmb2 .cmb-th {
541
- text-align: right;
542
- }
543
-
544
- /* line 521, sass/partials/_main_wrap.scss */
545
- .cmb2-indented-hierarchy {
546
- padding-right: 1.5em;
547
- }
548
-
549
- @media (max-width: 450px) {
550
- /* line 526, sass/partials/_main_wrap.scss */
551
- .cmb-th,
552
- .cmb-td,
553
- .cmb-th + .cmb-td {
554
- display: block;
555
- float: none;
556
- width: 100%;
557
- }
558
- }
559
- /*--------------------------------------------------------------
560
- * Post Metaboxes
561
- --------------------------------------------------------------*/
562
- /* line 5, sass/partials/_post_metaboxes.scss */
563
- #poststuff .cmb-group-title {
564
- margin-right: -1em;
565
- margin-left: -1em;
566
- min-height: 1.5em;
567
- }
568
-
569
- /* line 11, sass/partials/_post_metaboxes.scss */
570
- #poststuff .repeatable .cmb-group-title {
571
- padding-right: 2.2em;
572
- }
573
-
574
- /* line 17, sass/partials/_post_metaboxes.scss */
575
- .cmb2-postbox .cmb2-wrap, .cmb-type-group .cmb2-wrap {
576
- margin: 0;
577
- }
578
- /* line 20, sass/partials/_post_metaboxes.scss */
579
- .cmb2-postbox .cmb2-wrap > .cmb-field-list > .cmb-row, .cmb-type-group .cmb2-wrap > .cmb-field-list > .cmb-row {
580
- padding: 1.8em 0;
581
- }
582
- /* line 26, sass/partials/_post_metaboxes.scss */
583
- .cmb2-postbox .cmb2-wrap input[type=text].cmb2-oembed, .cmb-type-group .cmb2-wrap input[type=text].cmb2-oembed {
584
- width: 100%;
585
- }
586
- /* line 32, sass/partials/_post_metaboxes.scss */
587
- .cmb2-postbox .cmb-row, .cmb-type-group .cmb-row {
588
- padding: 0 0 1.8em;
589
- margin: 0 0 0.8em;
590
- }
591
- /* line 36, sass/partials/_post_metaboxes.scss */
592
- .cmb2-postbox .cmb-row .cmbhandle, .cmb-type-group .cmb-row .cmbhandle {
593
- left: -1em;
594
- position: relative;
595
- color: #222222;
596
- }
597
- /* line 43, sass/partials/_post_metaboxes.scss */
598
- .cmb2-postbox .cmb-repeatable-grouping, .cmb-type-group .cmb-repeatable-grouping {
599
- padding: 0 1em;
600
- max-width: 100%;
601
- min-width: 1px !important;
602
- }
603
- /* line 49, sass/partials/_post_metaboxes.scss */
604
- .cmb2-postbox .cmb-repeatable-group > .cmb-row, .cmb-type-group .cmb-repeatable-group > .cmb-row {
605
- padding-bottom: 0;
606
- }
607
- /* line 53, sass/partials/_post_metaboxes.scss */
608
- .cmb2-postbox .cmb-th, .cmb-type-group .cmb-th {
609
- width: 18%;
610
- padding: 0 0 0 2%;
611
- }
612
- /* line 59, sass/partials/_post_metaboxes.scss */
613
- .cmb2-postbox .cmb-td, .cmb-type-group .cmb-td {
614
- margin-bottom: 0;
615
- padding: 0;
616
- line-height: 1.3;
617
- }
618
- /* line 65, sass/partials/_post_metaboxes.scss */
619
- .cmb2-postbox .cmb-th + .cmb-td, .cmb-type-group .cmb-th + .cmb-td {
620
- width: 80%;
621
- float: left;
622
- }
623
- /* line 70, sass/partials/_post_metaboxes.scss */
624
- .cmb2-postbox .cmb-row:not(:last-of-type),
625
- .cmb2-postbox .cmb-repeatable-group:not(:last-of-type), .cmb-type-group .cmb-row:not(:last-of-type),
626
- .cmb-type-group .cmb-repeatable-group:not(:last-of-type) {
627
- border-bottom: 1px solid #e9e9e9;
628
- }
629
- @media (max-width: 450px) {
630
- /* line 70, sass/partials/_post_metaboxes.scss */
631
- .cmb2-postbox .cmb-row:not(:last-of-type),
632
- .cmb2-postbox .cmb-repeatable-group:not(:last-of-type), .cmb-type-group .cmb-row:not(:last-of-type),
633
- .cmb-type-group .cmb-repeatable-group:not(:last-of-type) {
634
- border-bottom: 0;
635
- }
636
- }
637
- /* line 79, sass/partials/_post_metaboxes.scss */
638
- .cmb2-postbox .cmb-repeat-group-field,
639
- .cmb2-postbox .cmb-remove-field-row, .cmb-type-group .cmb-repeat-group-field,
640
- .cmb-type-group .cmb-remove-field-row {
641
- padding-top: 1.8em;
642
- }
643
-
644
- /*--------------------------------------------------------------
645
- * Context Metaboxes
646
- --------------------------------------------------------------*/
647
- /* Metabox collapse arrow indicators */
648
- /* line 8, sass/partials/_context_metaboxes.scss */
649
- .js .cmb2-postbox.context-box .handlediv {
650
- text-align: center;
651
- }
652
- /* line 13, sass/partials/_context_metaboxes.scss */
653
- .js .cmb2-postbox.context-box .toggle-indicator:before {
654
- content: "\f142";
655
- display: inline-block;
656
- font: normal 20px/1 dashicons;
657
- speak: none;
658
- -webkit-font-smoothing: antialiased;
659
- -moz-osx-font-smoothing: grayscale;
660
- text-decoration: none !important;
661
- }
662
- /* line 26, sass/partials/_context_metaboxes.scss */
663
- .js .cmb2-postbox.context-box.closed .toggle-indicator:before {
664
- content: "\f140";
665
- }
666
-
667
- /* line 34, sass/partials/_context_metaboxes.scss */
668
- .cmb2-postbox.context-box {
669
- margin-bottom: 10px;
670
- }
671
- /* line 38, sass/partials/_context_metaboxes.scss */
672
- .cmb2-postbox.context-box.context-before_permalink-box {
673
- margin-top: 10px;
674
- }
675
- /* line 42, sass/partials/_context_metaboxes.scss */
676
- .cmb2-postbox.context-box.context-after_title-box {
677
- margin-top: 10px;
678
- }
679
- /* line 46, sass/partials/_context_metaboxes.scss */
680
- .cmb2-postbox.context-box.context-after_editor-box {
681
- margin-top: 20px;
682
- margin-bottom: 0;
683
- }
684
- /* line 51, sass/partials/_context_metaboxes.scss */
685
- .cmb2-postbox.context-box.context-form_top-box {
686
- margin-top: 10px;
687
- }
688
- /* line 55, sass/partials/_context_metaboxes.scss */
689
- .cmb2-postbox.context-box.context-form_top-box .hndle {
690
- font-size: 14px;
691
- padding: 8px 12px;
692
- margin: 0;
693
- line-height: 1.4;
694
- }
695
- /* line 63, sass/partials/_context_metaboxes.scss */
696
- .cmb2-postbox.context-box .hndle {
697
- cursor: auto;
698
- }
699
-
700
- /* line 68, sass/partials/_context_metaboxes.scss */
701
- .cmb2-context-wrap {
702
- margin-top: 10px;
703
- }
704
- /* line 72, sass/partials/_context_metaboxes.scss */
705
- .cmb2-context-wrap.cmb2-context-wrap-form_top {
706
- margin-left: 300px;
707
- width: auto;
708
- }
709
- /* line 79, sass/partials/_context_metaboxes.scss */
710
- .cmb2-context-wrap.cmb2-context-wrap-no-title .cmb2-metabox {
711
- padding: 10px;
712
- }
713
- /* line 84, sass/partials/_context_metaboxes.scss */
714
- .cmb2-context-wrap .cmb-th {
715
- padding: 0 0 0 2%;
716
- width: 18%;
717
- }
718
- /* line 89, sass/partials/_context_metaboxes.scss */
719
- .cmb2-context-wrap .cmb-td {
720
- width: 80%;
721
- padding: 0;
722
- }
723
- /* line 94, sass/partials/_context_metaboxes.scss */
724
- .cmb2-context-wrap .cmb-row {
725
- margin-bottom: 10px;
726
- }
727
- /* line 97, sass/partials/_context_metaboxes.scss */
728
- .cmb2-context-wrap .cmb-row:last-of-type {
729
- margin-bottom: 0;
730
- }
731
-
732
- /* one column on the post write/edit screen */
733
- @media only screen and (max-width: 850px) {
734
- /* line 107, sass/partials/_context_metaboxes.scss */
735
- .cmb2-context-wrap.cmb2-context-wrap-form_top {
736
- margin-left: 0;
737
- }
738
- }
739
- /*--------------------------------------------------------------
740
- * Misc.
741
- --------------------------------------------------------------*/
742
- /* line 5, sass/partials/_misc.scss */
743
- #poststuff .cmb-repeatable-group h2 {
744
- margin: 0;
745
- }
746
-
747
- /* line 12, sass/partials/_misc.scss */
748
- .edit-tags-php .cmb2-metabox-title,
749
- .profile-php .cmb2-metabox-title,
750
- .user-edit-php .cmb2-metabox-title {
751
- font-size: 1.4em;
752
- }
753
-
754
- /* line 18, sass/partials/_misc.scss */
755
- .cmb2-postbox .cmb-spinner, .cmb2-no-box-wrap .cmb-spinner {
756
- float: right;
757
- display: none;
758
- }
759
-
760
- /* line 24, sass/partials/_misc.scss */
761
- .cmb-spinner {
762
- display: none;
763
- }
764
- /* line 26, sass/partials/_misc.scss */
765
- .cmb-spinner.is-active {
766
- display: block;
767
- }
768
-
769
- /*--------------------------------------------------------------
770
- * Collapsible UI
771
- --------------------------------------------------------------*/
772
- /* line 6, sass/partials/_collapsible_ui.scss */
773
- .cmb2-metabox .cmbhandle {
774
- color: #757575;
775
- float: left;
776
- width: 27px;
777
- height: 30px;
778
- cursor: pointer;
779
- left: -1em;
780
- position: relative;
781
- }
782
- /* line 14, sass/partials/_collapsible_ui.scss */
783
- .cmb2-metabox .cmbhandle:before {
784
- content: '\f142';
785
- left: 12px;
786
- font: normal 20px/1 'dashicons';
787
- speak: none;
788
- display: inline-block;
789
- padding: 8px 10px;
790
- top: 0;
791
- position: relative;
792
- -webkit-font-smoothing: antialiased;
793
- -moz-osx-font-smoothing: grayscale;
794
- text-decoration: none !important;
795
- }
796
- /* line 31, sass/partials/_collapsible_ui.scss */
797
- .cmb2-metabox .postbox.closed .cmbhandle:before {
798
- content: '\f140';
799
- }
800
- /* line 37, sass/partials/_collapsible_ui.scss */
801
- .cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row {
802
- -webkit-appearance: none !important;
803
- background: none !important;
804
- border: none !important;
805
- position: absolute;
806
- right: 0;
807
- top: .5em;
808
- line-height: 1em;
809
- padding: 2px 6px 3px;
810
- opacity: .5;
811
- }
812
- /* line 47, sass/partials/_collapsible_ui.scss */
813
- .cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]) {
814
- cursor: pointer;
815
- color: #a00;
816
- opacity: 1;
817
- }
818
- /* line 51, sass/partials/_collapsible_ui.scss */
819
- .cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]):hover {
820
- color: #f00;
821
- }
822
-
823
- /*
824
- * jQuery UI CSS Framework 1.8.16
825
- *
826
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
827
- * Dual licensed under the MIT or GPL Version 2 licenses.
828
- * http://jquery.org/license
829
- *
830
- * http://docs.jquery.com/UI/Theming/API
831
- *
832
- * WordPress Styles adopted from "jQuery UI Datepicker CSS for WordPress"
833
- * https://github.com/stuttter/wp-datepicker-styling
834
- *
835
- */
836
- /* line 15, sass/partials/_jquery_ui.scss */
837
- * html .cmb2-element.ui-helper-clearfix {
838
- height: 1%;
839
- }
840
-
841
- /* line 24, sass/partials/_jquery_ui.scss */
842
- .cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
843
- padding: 0;
844
- margin: 0;
845
- -webkit-border-radius: 0;
846
- -moz-border-radius: 0;
847
- border-radius: 0;
848
- background-color: #fff;
849
- border: 1px solid #dfdfdf;
850
- border-top: none;
851
- -webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
852
- box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
853
- min-width: 17em;
854
- width: auto;
855
- /* Default Color Scheme */
856
- }
857
- /* line 38, sass/partials/_jquery_ui.scss */
858
- .cmb2-element.ui-datepicker *, .cmb2-element .ui-datepicker * {
859
- padding: 0;
860
- font-family: "Open Sans", sans-serif;
861
- -webkit-border-radius: 0;
862
- -moz-border-radius: 0;
863
- border-radius: 0;
864
- }
865
- /* line 46, sass/partials/_jquery_ui.scss */
866
- .cmb2-element.ui-datepicker table, .cmb2-element .ui-datepicker table {
867
- font-size: 13px;
868
- margin: 0;
869
- border: none;
870
- border-collapse: collapse;
871
- }
872
- /* line 53, sass/partials/_jquery_ui.scss */
873
- .cmb2-element.ui-datepicker .ui-widget-header,
874
- .cmb2-element.ui-datepicker .ui-datepicker-header, .cmb2-element .ui-datepicker .ui-widget-header,
875
- .cmb2-element .ui-datepicker .ui-datepicker-header {
876
- background-image: none;
877
- border: none;
878
- color: #fff;
879
- font-weight: normal;
880
- }
881
- /* line 61, sass/partials/_jquery_ui.scss */
882
- .cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover, .cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover {
883
- background: transparent;
884
- border-color: transparent;
885
- cursor: pointer;
886
- }
887
- /* line 67, sass/partials/_jquery_ui.scss */
888
- .cmb2-element.ui-datepicker .ui-datepicker-title, .cmb2-element .ui-datepicker .ui-datepicker-title {
889
- margin: 0;
890
- padding: 10px 0;
891
- color: #fff;
892
- font-size: 14px;
893
- line-height: 14px;
894
- text-align: center;
895
- }
896
- /* line 75, sass/partials/_jquery_ui.scss */
897
- .cmb2-element.ui-datepicker .ui-datepicker-title select, .cmb2-element .ui-datepicker .ui-datepicker-title select {
898
- margin-top: -8px;
899
- margin-bottom: -8px;
900
- }
901
- /* line 81, sass/partials/_jquery_ui.scss */
902
- .cmb2-element.ui-datepicker .ui-datepicker-prev,
903
- .cmb2-element.ui-datepicker .ui-datepicker-next, .cmb2-element .ui-datepicker .ui-datepicker-prev,
904
- .cmb2-element .ui-datepicker .ui-datepicker-next {
905
- position: relative;
906
- top: 0;
907
- height: 34px;
908
- width: 34px;
909
- }
910
- /* line 89, sass/partials/_jquery_ui.scss */
911
- .cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-prev,
912
- .cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-next, .cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-prev,
913
- .cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-next {
914
- border: none;
915
- }
916
- /* line 94, sass/partials/_jquery_ui.scss */
917
- .cmb2-element.ui-datepicker .ui-datepicker-prev,
918
- .cmb2-element.ui-datepicker .ui-datepicker-prev-hover, .cmb2-element .ui-datepicker .ui-datepicker-prev,
919
- .cmb2-element .ui-datepicker .ui-datepicker-prev-hover {
920
- right: 0;
921
- }
922
- /* line 99, sass/partials/_jquery_ui.scss */
923
- .cmb2-element.ui-datepicker .ui-datepicker-next,
924
- .cmb2-element.ui-datepicker .ui-datepicker-next-hover, .cmb2-element .ui-datepicker .ui-datepicker-next,
925
- .cmb2-element .ui-datepicker .ui-datepicker-next-hover {
926
- left: 0;
927
- }
928
- /* line 104, sass/partials/_jquery_ui.scss */
929
- .cmb2-element.ui-datepicker .ui-datepicker-next span,
930
- .cmb2-element.ui-datepicker .ui-datepicker-prev span, .cmb2-element .ui-datepicker .ui-datepicker-next span,
931
- .cmb2-element .ui-datepicker .ui-datepicker-prev span {
932
- display: none;
933
- }
934
- /* line 109, sass/partials/_jquery_ui.scss */
935
- .cmb2-element.ui-datepicker .ui-datepicker-prev, .cmb2-element .ui-datepicker .ui-datepicker-prev {
936
- float: right;
937
- }
938
- /* line 113, sass/partials/_jquery_ui.scss */
939
- .cmb2-element.ui-datepicker .ui-datepicker-next, .cmb2-element .ui-datepicker .ui-datepicker-next {
940
- float: left;
941
- }
942
- /* line 117, sass/partials/_jquery_ui.scss */
943
- .cmb2-element.ui-datepicker .ui-datepicker-prev:before,
944
- .cmb2-element.ui-datepicker .ui-datepicker-next:before, .cmb2-element .ui-datepicker .ui-datepicker-prev:before,
945
- .cmb2-element .ui-datepicker .ui-datepicker-next:before {
946
- font: normal 20px/34px 'dashicons';
947
- padding-right: 7px;
948
- color: #fff;
949
- speak: none;
950
- -webkit-font-smoothing: antialiased;
951
- -moz-osx-font-smoothing: grayscale;
952
- width: 34px;
953
- height: 34px;
954
- }
955
- /* line 129, sass/partials/_jquery_ui.scss */
956
- .cmb2-element.ui-datepicker .ui-datepicker-prev:before, .cmb2-element .ui-datepicker .ui-datepicker-prev:before {
957
- content: '\f341';
958
- }
959
- /* line 133, sass/partials/_jquery_ui.scss */
960
- .cmb2-element.ui-datepicker .ui-datepicker-next:before, .cmb2-element .ui-datepicker .ui-datepicker-next:before {
961
- content: '\f345';
962
- }
963
- /* line 137, sass/partials/_jquery_ui.scss */
964
- .cmb2-element.ui-datepicker .ui-datepicker-prev-hover:before,
965
- .cmb2-element.ui-datepicker .ui-datepicker-next-hover:before, .cmb2-element .ui-datepicker .ui-datepicker-prev-hover:before,
966
- .cmb2-element .ui-datepicker .ui-datepicker-next-hover:before {
967
- opacity: 0.7;
968
- }
969
- /* line 142, sass/partials/_jquery_ui.scss */
970
- .cmb2-element.ui-datepicker select.ui-datepicker-month,
971
- .cmb2-element.ui-datepicker select.ui-datepicker-year, .cmb2-element .ui-datepicker select.ui-datepicker-month,
972
- .cmb2-element .ui-datepicker select.ui-datepicker-year {
973
- width: 33%;
974
- background: transparent;
975
- border-color: transparent;
976
- box-shadow: none;
977
- color: #fff;
978
- }
979
- /* line 149, sass/partials/_jquery_ui.scss */
980
- .cmb2-element.ui-datepicker select.ui-datepicker-month option,
981
- .cmb2-element.ui-datepicker select.ui-datepicker-year option, .cmb2-element .ui-datepicker select.ui-datepicker-month option,
982
- .cmb2-element .ui-datepicker select.ui-datepicker-year option {
983
- color: #333;
984
- }
985
- /* line 154, sass/partials/_jquery_ui.scss */
986
- .cmb2-element.ui-datepicker thead, .cmb2-element .ui-datepicker thead {
987
- color: #fff;
988
- font-weight: 600;
989
- }
990
- /* line 157, sass/partials/_jquery_ui.scss */
991
- .cmb2-element.ui-datepicker thead th, .cmb2-element .ui-datepicker thead th {
992
- font-weight: normal;
993
- }
994
- /* line 162, sass/partials/_jquery_ui.scss */
995
- .cmb2-element.ui-datepicker th, .cmb2-element .ui-datepicker th {
996
- padding: 10px;
997
- }
998
- /* line 166, sass/partials/_jquery_ui.scss */
999
- .cmb2-element.ui-datepicker td, .cmb2-element .ui-datepicker td {
1000
- padding: 0;
1001
- border: 1px solid #f4f4f4;
1002
- }
1003
- /* line 171, sass/partials/_jquery_ui.scss */
1004
- .cmb2-element.ui-datepicker td.ui-datepicker-other-month, .cmb2-element .ui-datepicker td.ui-datepicker-other-month {
1005
- border: transparent;
1006
- }
1007
- /* line 175, sass/partials/_jquery_ui.scss */
1008
- .cmb2-element.ui-datepicker td.ui-datepicker-week-end, .cmb2-element .ui-datepicker td.ui-datepicker-week-end {
1009
- background-color: #f4f4f4;
1010
- border: 1px solid #f4f4f4;
1011
- }
1012
- /* line 178, sass/partials/_jquery_ui.scss */
1013
- .cmb2-element.ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today, .cmb2-element .ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today {
1014
- -webkit-box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
1015
- -moz-box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
1016
- box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
1017
- }
1018
- /* line 185, sass/partials/_jquery_ui.scss */
1019
- .cmb2-element.ui-datepicker td.ui-datepicker-today, .cmb2-element .ui-datepicker td.ui-datepicker-today {
1020
- background-color: #f0f0c0;
1021
- }
1022
- /* line 189, sass/partials/_jquery_ui.scss */
1023
- .cmb2-element.ui-datepicker td.ui-datepicker-current-day, .cmb2-element .ui-datepicker td.ui-datepicker-current-day {
1024
- background: #bbdd88;
1025
- }
1026
- /* line 193, sass/partials/_jquery_ui.scss */
1027
- .cmb2-element.ui-datepicker td .ui-state-default, .cmb2-element .ui-datepicker td .ui-state-default {
1028
- background: transparent;
1029
- border: none;
1030
- text-align: center;
1031
- text-decoration: none;
1032
- width: auto;
1033
- display: block;
1034
- padding: 5px 10px;
1035
- font-weight: normal;
1036
- color: #444;
1037
- }
1038
- /* line 205, sass/partials/_jquery_ui.scss */
1039
- .cmb2-element.ui-datepicker td.ui-state-disabled .ui-state-default, .cmb2-element .ui-datepicker td.ui-state-disabled .ui-state-default {
1040
- opacity: 0.5;
1041
- }
1042
- /* line 210, sass/partials/_jquery_ui.scss */
1043
- .cmb2-element.ui-datepicker .ui-widget-header,
1044
- .cmb2-element.ui-datepicker .ui-datepicker-header, .cmb2-element .ui-datepicker .ui-widget-header,
1045
- .cmb2-element .ui-datepicker .ui-datepicker-header {
1046
- background: #00a0d2;
1047
- }
1048
- /* line 215, sass/partials/_jquery_ui.scss */
1049
- .cmb2-element.ui-datepicker thead, .cmb2-element .ui-datepicker thead {
1050
- background: #32373c;
1051
- }
1052
- /* line 219, sass/partials/_jquery_ui.scss */
1053
- .cmb2-element.ui-datepicker td .ui-state-hover, .cmb2-element.ui-datepicker td .ui-state-active, .cmb2-element .ui-datepicker td .ui-state-hover, .cmb2-element .ui-datepicker td .ui-state-active {
1054
- background: #0073aa;
1055
- color: #fff;
1056
- }
1057
- /* line 224, sass/partials/_jquery_ui.scss */
1058
- .cmb2-element.ui-datepicker .ui-timepicker-div, .cmb2-element .ui-datepicker .ui-timepicker-div {
1059
- font-size: 14px;
1060
- }
1061
- /* line 226, sass/partials/_jquery_ui.scss */
1062
- .cmb2-element.ui-datepicker .ui-timepicker-div dl, .cmb2-element .ui-datepicker .ui-timepicker-div dl {
1063
- text-align: right;
1064
- padding: 0 .6em;
1065
- }
1066
- /* line 229, sass/partials/_jquery_ui.scss */
1067
- .cmb2-element.ui-datepicker .ui-timepicker-div dl dt, .cmb2-element .ui-datepicker .ui-timepicker-div dl dt {
1068
- float: right;
1069
- clear: right;
1070
- padding: 0 5px 0 0;
1071
- }
1072
- /* line 234, sass/partials/_jquery_ui.scss */
1073
- .cmb2-element.ui-datepicker .ui-timepicker-div dl dd, .cmb2-element .ui-datepicker .ui-timepicker-div dl dd {
1074
- margin: 0 40% 10px 10px;
1075
- }
1076
- /* line 236, sass/partials/_jquery_ui.scss */
1077
- .cmb2-element.ui-datepicker .ui-timepicker-div dl dd select, .cmb2-element .ui-datepicker .ui-timepicker-div dl dd select {
1078
- width: 100%;
1079
- }
1080
- /* line 242, sass/partials/_jquery_ui.scss */
1081
- .cmb2-element.ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane, .cmb2-element .ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane {
1082
- padding: .6em;
1083
- text-align: right;
1084
- }
1085
- /* line 246, sass/partials/_jquery_ui.scss */
1086
- .cmb2-element.ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-primary, .cmb2-element.ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-secondary, .cmb2-element .ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-primary, .cmb2-element .ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-secondary {
1087
- padding: 0 10px 1px;
1088
- -webkit-border-radius: 3px;
1089
- -moz-border-radius: 3px;
1090
- border-radius: 3px;
1091
- margin: 0 .4em .4em .6em;
1092
- }
1093
-
1094
- /* line 260, sass/partials/_jquery_ui.scss */
1095
- .admin-color-fresh .cmb2-element.ui-datepicker .ui-widget-header,
1096
- .admin-color-fresh .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-fresh .cmb2-element .ui-datepicker .ui-widget-header,
1097
- .admin-color-fresh .cmb2-element .ui-datepicker .ui-datepicker-header {
1098
- background: #00a0d2;
1099
- }
1100
- /* line 265, sass/partials/_jquery_ui.scss */
1101
- .admin-color-fresh .cmb2-element.ui-datepicker thead, .admin-color-fresh .cmb2-element .ui-datepicker thead {
1102
- background: #32373c;
1103
- }
1104
- /* line 269, sass/partials/_jquery_ui.scss */
1105
- .admin-color-fresh .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-fresh .cmb2-element .ui-datepicker td .ui-state-hover {
1106
- background: #0073aa;
1107
- color: #fff;
1108
- }
1109
-
1110
- /* line 277, sass/partials/_jquery_ui.scss */
1111
- .admin-color-blue .cmb2-element.ui-datepicker .ui-widget-header,
1112
- .admin-color-blue .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-blue .cmb2-element .ui-datepicker .ui-widget-header,
1113
- .admin-color-blue .cmb2-element .ui-datepicker .ui-datepicker-header {
1114
- background: #52accc;
1115
- }
1116
- /* line 282, sass/partials/_jquery_ui.scss */
1117
- .admin-color-blue .cmb2-element.ui-datepicker thead, .admin-color-blue .cmb2-element .ui-datepicker thead {
1118
- background: #4796b3;
1119
- }
1120
- /* line 291, sass/partials/_jquery_ui.scss */
1121
- .admin-color-blue .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-blue .cmb2-element.ui-datepicker td .ui-state-active, .admin-color-blue .cmb2-element .ui-datepicker td .ui-state-hover, .admin-color-blue .cmb2-element .ui-datepicker td .ui-state-active {
1122
- background: #096484;
1123
- color: #fff;
1124
- }
1125
- /* line 296, sass/partials/_jquery_ui.scss */
1126
- .admin-color-blue .cmb2-element.ui-datepicker td.ui-datepicker-today, .admin-color-blue .cmb2-element .ui-datepicker td.ui-datepicker-today {
1127
- background: #eee;
1128
- }
1129
-
1130
- /* line 305, sass/partials/_jquery_ui.scss */
1131
- .admin-color-coffee .cmb2-element.ui-datepicker .ui-widget-header,
1132
- .admin-color-coffee .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-coffee .cmb2-element .ui-datepicker .ui-widget-header,
1133
- .admin-color-coffee .cmb2-element .ui-datepicker .ui-datepicker-header {
1134
- background: #59524c;
1135
- }
1136
- /* line 310, sass/partials/_jquery_ui.scss */
1137
- .admin-color-coffee .cmb2-element.ui-datepicker thead, .admin-color-coffee .cmb2-element .ui-datepicker thead {
1138
- background: #46403c;
1139
- }
1140
- /* line 314, sass/partials/_jquery_ui.scss */
1141
- .admin-color-coffee .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-coffee .cmb2-element .ui-datepicker td .ui-state-hover {
1142
- background: #c7a589;
1143
- color: #fff;
1144
- }
1145
-
1146
- /* line 322, sass/partials/_jquery_ui.scss */
1147
- .admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-widget-header,
1148
- .admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-widget-header,
1149
- .admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-datepicker-header {
1150
- background: #523f6d;
1151
- }
1152
- /* line 327, sass/partials/_jquery_ui.scss */
1153
- .admin-color-ectoplasm .cmb2-element.ui-datepicker thead, .admin-color-ectoplasm .cmb2-element .ui-datepicker thead {
1154
- background: #413256;
1155
- }
1156
- /* line 331, sass/partials/_jquery_ui.scss */
1157
- .admin-color-ectoplasm .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-ectoplasm .cmb2-element .ui-datepicker td .ui-state-hover {
1158
- background: #a3b745;
1159
- color: #fff;
1160
- }
1161
-
1162
- /* line 339, sass/partials/_jquery_ui.scss */
1163
- .admin-color-midnight .cmb2-element.ui-datepicker .ui-widget-header,
1164
- .admin-color-midnight .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-midnight .cmb2-element .ui-datepicker .ui-widget-header,
1165
- .admin-color-midnight .cmb2-element .ui-datepicker .ui-datepicker-header {
1166
- background: #363b3f;
1167
- }
1168
- /* line 344, sass/partials/_jquery_ui.scss */
1169
- .admin-color-midnight .cmb2-element.ui-datepicker thead, .admin-color-midnight .cmb2-element .ui-datepicker thead {
1170
- background: #26292c;
1171
- }
1172
- /* line 348, sass/partials/_jquery_ui.scss */
1173
- .admin-color-midnight .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-midnight .cmb2-element .ui-datepicker td .ui-state-hover {
1174
- background: #e14d43;
1175
- color: #fff;
1176
- }
1177
-
1178
- /* line 356, sass/partials/_jquery_ui.scss */
1179
- .admin-color-ocean .cmb2-element.ui-datepicker .ui-widget-header,
1180
- .admin-color-ocean .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-ocean .cmb2-element .ui-datepicker .ui-widget-header,
1181
- .admin-color-ocean .cmb2-element .ui-datepicker .ui-datepicker-header {
1182
- background: #738e96;
1183
- }
1184
- /* line 361, sass/partials/_jquery_ui.scss */
1185
- .admin-color-ocean .cmb2-element.ui-datepicker thead, .admin-color-ocean .cmb2-element .ui-datepicker thead {
1186
- background: #627c83;
1187
- }
1188
- /* line 365, sass/partials/_jquery_ui.scss */
1189
- .admin-color-ocean .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-ocean .cmb2-element .ui-datepicker td .ui-state-hover {
1190
- background: #9ebaa0;
1191
- color: #fff;
1192
- }
1193
-
1194
- /* line 373, sass/partials/_jquery_ui.scss */
1195
- .admin-color-sunrise .cmb2-element.ui-datepicker .ui-widget-header,
1196
- .admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header,
1197
- .admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover, .admin-color-sunrise .cmb2-element .ui-datepicker .ui-widget-header,
1198
- .admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header,
1199
- .admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover {
1200
- background: #cf4944;
1201
- }
1202
- /* line 379, sass/partials/_jquery_ui.scss */
1203
- .admin-color-sunrise .cmb2-element.ui-datepicker th, .admin-color-sunrise .cmb2-element .ui-datepicker th {
1204
- border-color: #be3631;
1205
- background: #be3631;
1206
- }
1207
- /* line 384, sass/partials/_jquery_ui.scss */
1208
- .admin-color-sunrise .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-sunrise .cmb2-element .ui-datepicker td .ui-state-hover {
1209
- background: #dd823b;
1210
- color: #fff;
1211
- }
1212
-
1213
- /* line 392, sass/partials/_jquery_ui.scss */
1214
- .admin-color-light .cmb2-element.ui-datepicker .ui-widget-header,
1215
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-light .cmb2-element .ui-datepicker .ui-widget-header,
1216
- .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-header {
1217
- background: #e5e5e5;
1218
- }
1219
- /* line 397, sass/partials/_jquery_ui.scss */
1220
- .admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-month,
1221
- .admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-year, .admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-month,
1222
- .admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-year {
1223
- color: #555;
1224
- }
1225
- /* line 402, sass/partials/_jquery_ui.scss */
1226
- .admin-color-light .cmb2-element.ui-datepicker thead, .admin-color-light .cmb2-element .ui-datepicker thead {
1227
- background: #888;
1228
- }
1229
- /* line 406, sass/partials/_jquery_ui.scss */
1230
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-title,
1231
- .admin-color-light .cmb2-element.ui-datepicker td .ui-state-default,
1232
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-prev:before,
1233
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-next:before, .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-title,
1234
- .admin-color-light .cmb2-element .ui-datepicker td .ui-state-default,
1235
- .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-prev:before,
1236
- .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-next:before {
1237
- color: #555;
1238
- }
1239
- /* line 414, sass/partials/_jquery_ui.scss */
1240
- .admin-color-light .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-light .cmb2-element.ui-datepicker td .ui-state-active, .admin-color-light .cmb2-element .ui-datepicker td .ui-state-hover, .admin-color-light .cmb2-element .ui-datepicker td .ui-state-active {
1241
- background: #ccc;
1242
- }
1243
- /* line 418, sass/partials/_jquery_ui.scss */
1244
- .admin-color-light .cmb2-element.ui-datepicker td.ui-datepicker-today, .admin-color-light .cmb2-element .ui-datepicker td.ui-datepicker-today {
1245
- background: #eee;
1246
- }
1247
-
1248
- /* line 426, sass/partials/_jquery_ui.scss */
1249
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-widget-header,
1250
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-widget-header,
1251
- .admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-datepicker-header {
1252
- background: #56b274;
1253
- }
1254
- /* line 431, sass/partials/_jquery_ui.scss */
1255
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker thead, .admin-color-bbp-evergreen .cmb2-element .ui-datepicker thead {
1256
- background: #36533f;
1257
- }
1258
- /* line 435, sass/partials/_jquery_ui.scss */
1259
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-bbp-evergreen .cmb2-element .ui-datepicker td .ui-state-hover {
1260
- background: #446950;
1261
- color: #fff;
1262
- }
1263
-
1264
- /* line 443, sass/partials/_jquery_ui.scss */
1265
- .admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-widget-header,
1266
- .admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-widget-header,
1267
- .admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-datepicker-header {
1268
- background: #4ca26a;
1269
- }
1270
- /* line 448, sass/partials/_jquery_ui.scss */
1271
- .admin-color-bbp-mint .cmb2-element.ui-datepicker thead, .admin-color-bbp-mint .cmb2-element .ui-datepicker thead {
1272
- background: #4f6d59;
1273
- }
1274
- /* line 452, sass/partials/_jquery_ui.scss */
1275
- .admin-color-bbp-mint .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-bbp-mint .cmb2-element .ui-datepicker td .ui-state-hover {
1276
- background: #5fb37c;
1277
- color: #fff;
1278
- }
1279
-
1280
- /*--------------------------------------------------------------
1281
- * Character counter
1282
- --------------------------------------------------------------*/
1283
- /* line 5, sass/partials/_char_counter.scss */
1284
- .cmb2-char-counter-wrap {
1285
- margin: .5em 0 1em;
1286
- }
1287
- /* line 8, sass/partials/_char_counter.scss */
1288
- .cmb2-char-counter-wrap input[type="text"] {
1289
- font-size: 12px;
1290
- width: 25px;
1291
- }
1292
- /* line 14, sass/partials/_char_counter.scss */
1293
- .cmb2-char-counter-wrap.cmb2-max-exceeded input[type="text"] {
1294
- border-color: #a00 !important;
1295
- }
1296
- /* line 17, sass/partials/_char_counter.scss */
1297
- .cmb2-char-counter-wrap.cmb2-max-exceeded .cmb2-char-max-msg {
1298
- display: inline-block;
1299
- }
1300
-
1301
- /* line 23, sass/partials/_char_counter.scss */
1302
- .cmb2-char-max-msg {
1303
- color: #a00;
1304
- display: none;
1305
- font-weight: 600;
1306
- margin-right: 1em;
1307
- }
1308
-
1309
- /**
1310
- * CMB2 Frontend
1311
- */
1312
- /*--------------------------------------------------------------
1313
- * CMB2 Frontend
1314
- --------------------------------------------------------------*/
1315
- /* line 5, sass/partials/_front.scss */
1316
- .closed .inside {
1317
- display: none;
1318
- }
1319
-
1320
- /* line 9, sass/partials/_front.scss */
1321
- .cmb-repeatable-grouping {
1322
- position: relative;
1323
- }
1324
- /* line 12, sass/partials/_front.scss */
1325
- .cmb-repeatable-grouping .cmb-group-title {
1326
- margin-right: -1em;
1327
- margin-left: -1em;
1328
- min-height: 1.5em;
1329
- }
1330
- /* line 18, sass/partials/_front.scss */
1331
- .cmb-repeatable-grouping h3 {
1332
- font-size: 14px;
1333
- padding: 8px 12px;
1334
- margin: 0;
1335
- line-height: 1.4;
1336
- }
1337
-
1338
- /* line 29, sass/partials/_front.scss */
1339
- .cmb-repeatable-group.repeatable .cmb-group-title {
1340
- padding-right: 2.2em;
1341
- }
1342
- /* line 33, sass/partials/_front.scss */
1343
- .cmb-repeatable-group.non-repeatable .cmb-group-title {
1344
- padding-right: 12px;
1345
- }
1346
-
1347
- /* line 39, sass/partials/_front.scss */
1348
- .cmb-type-group .cmb-row .cmbhandle {
1349
- left: 0;
1350
- position: absolute;
1351
- }
1352
-
1353
- /* line 44, sass/partials/_front.scss */
1354
- .cmb-spinner {
1355
- background: url(/wp-admin/images/spinner.gif) no-repeat;
1356
- -webkit-background-size: 20px 20px;
1357
- background-size: 20px 20px;
1358
- display: none;
1359
- float: left;
1360
- vertical-align: middle;
1361
- opacity: 0.7;
1362
- filter: alpha(opacity=70);
1363
- width: 20px;
1364
- height: 20px;
1365
- margin: 4px 10px 0;
1366
- }
1367
-
1368
- /* line 58, sass/partials/_front.scss */
1369
- .cmb2-char-max-msg {
1370
- display: none;
1371
- }
1372
-
1373
- /*# sourceMappingURL=cmb2-front.css.map */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/css/cmb2-front-rtl.min.css DELETED
@@ -1 +0,0 @@
1
- @charset "UTF-8";.cmb2-wrap{margin:0}.cmb2-wrap input,.cmb2-wrap textarea{max-width:100%}.cmb2-wrap input[type=text].cmb2-oembed{width:100%}.cmb2-wrap textarea{width:500px;padding:8px}.cmb2-wrap textarea.cmb2-textarea-code{font-family:"Courier 10 Pitch",Courier,monospace;line-height:16px}.cmb2-wrap input.cmb2-text-small,.cmb2-wrap input.cmb2-timepicker{width:100px}.cmb2-wrap input.cmb2-text-money{width:90px}.cmb2-wrap input.cmb2-text-medium{width:230px}.cmb2-wrap input.cmb2-upload-file{width:65%}.cmb2-wrap input.ed_button{padding:2px 4px}.cmb2-wrap input:not([type=hidden])+.button-secondary,.cmb2-wrap input:not([type=hidden])+input,.cmb2-wrap input:not([type=hidden])+select{margin-right:20px}.cmb2-wrap ul{margin:0}.cmb2-wrap li{font-size:14px;line-height:16px;margin:1px 0 5px 0}.cmb2-wrap select{font-size:14px;margin-top:3px}.cmb2-wrap input:focus,.cmb2-wrap textarea:focus{background:#fffff8}.cmb2-wrap input[type=radio]{margin:0 0 0 5px;padding:0}.cmb2-wrap input[type=checkbox]{margin:0 0 0 5px;padding:0}.cmb2-wrap .button-secondary,.cmb2-wrap button{white-space:nowrap}.cmb2-wrap .mceLayout{border:1px solid #e9e9e9!important}.cmb2-wrap .mceIframeContainer{background:#fff}.cmb2-wrap .meta_mce{width:97%}.cmb2-wrap .meta_mce textarea{width:100%}.cmb2-wrap .cmb-multicheck-toggle{margin-top:-1em}.cmb2-wrap .wp-picker-clear.button,.cmb2-wrap .wp-picker-default.button{margin-right:6px;padding:2px 8px}.cmb2-wrap .cmb-row{margin:0}.cmb2-wrap .cmb-row:after{content:'';clear:both;display:block;width:100%}.cmb2-wrap .cmb-row.cmb-repeat .cmb2-metabox-description{padding-top:0;padding-bottom:1em}body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type=radio]::before{margin:.1875rem}@media screen and (max-width:782px){body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type=radio]::before{margin:.4375rem}}.cmb2-metabox{clear:both;margin:0}.cmb2-metabox .cmb-field-list>.cmb-row:first-of-type>.cmb-td,.cmb2-metabox .cmb-field-list>.cmb-row:first-of-type>.cmb-th,.cmb2-metabox>.cmb-row:first-of-type>.cmb-td,.cmb2-metabox>.cmb-row:first-of-type>.cmb-th{border:0}.cmb-add-row{margin:1.8em 0 0}.cmb-nested .cmb-td,.cmb-repeatable-group .cmb-th,.cmb-repeatable-group:first-of-type{border:0}.cmb-repeatable-group:last-of-type,.cmb-row:last-of-type,.cmb2-wrap .cmb-row:last-of-type{border-bottom:0}.cmb-repeatable-grouping{border:1px solid #e9e9e9;padding:0 1em}.cmb-repeatable-grouping.cmb-row{margin:0 0 .8em}.cmb-th{color:#222;float:right;font-weight:600;padding:20px 0 20px 10px;vertical-align:top;width:200px}@media (max-width:450px){.cmb-th{font-size:1.2em;display:block;float:none;padding-bottom:1em;text-align:right;width:100%}.cmb-th label{display:block;margin-top:0;margin-bottom:.5em}}.cmb-td{line-height:1.3;max-width:100%;padding:15px 10px;vertical-align:middle}.cmb-type-title .cmb-td{padding:0}.cmb-th label{display:block;padding:5px 0}.cmb-th+.cmb-td{float:right}.cmb-td .cmb-td{padding-bottom:1em}.cmb-remove-row{text-align:left}.empty-row.hidden{display:none}.cmb-repeat-table{background-color:#fafafa;border:1px solid #e1e1e1}.cmb-repeat-table .cmb-row.cmb-repeat-row{position:relative;counter-increment:el;margin:0;padding:10px 50px 10px 10px;border-bottom:none!important}.cmb-repeat-table .cmb-row.cmb-repeat-row+.cmb-repeat-row{border-top:solid 1px #e9e9e9}.cmb-repeat-table .cmb-row.cmb-repeat-row.ui-sortable-helper{outline:dashed 2px #e9e9e9!important}.cmb-repeat-table .cmb-row.cmb-repeat-row:before{content:counter(el);display:block;top:0;right:0;position:absolute;width:35px;height:100%;line-height:35px;cursor:move;color:#757575;text-align:center;border-left:solid 1px #e9e9e9}.cmb-repeat-table .cmb-row.cmb-repeat-row .cmb-td{margin:0;padding:0}.cmb-repeat-table+.cmb-add-row{margin:0}.cmb-repeat-table+.cmb-add-row:before{content:'';width:1px;height:1.6em;display:block;margin-right:17px;background-color:#dcdcdc}.cmb-repeat-table .cmb-remove-row{top:7px;left:7px;position:absolute;width:auto;margin-right:0;padding:0!important;display:none}.cmb-repeat-table .cmb-remove-row>.cmb-remove-row-button{font-size:20px;text-indent:-1000px;overflow:hidden;position:relative;height:auto;line-height:1;padding:0 10px 0}.cmb-repeat-table .cmb-remove-row>.cmb-remove-row-button:before{content:"";font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;right:0;width:100%;height:100%;text-align:center}.cmb-repeat-table .cmb-repeat-row:hover .cmb-remove-row{display:block}.cmb-repeatable-group .cmb-th{padding:5px}.cmb-repeatable-group .cmb-group-title{background-color:#e9e9e9;padding:8px 2.2em 8px 12px;margin:0 -1em;min-height:1.5em;font-size:14px;line-height:1.4}.cmb-repeatable-group .cmb-group-title h4{border:0;margin:0;font-size:1.2em;font-weight:500;padding:.5em .75em}.cmb-repeatable-group .cmb-group-title .cmb-th{display:block;width:100%}.cmb-repeatable-group .cmb-group-description .cmb-th{font-size:1.2em;display:block;float:none;padding-bottom:1em;text-align:right;width:100%}.cmb-repeatable-group .cmb-group-description .cmb-th label{display:block;margin-top:0;margin-bottom:.5em}.cmb-repeatable-group .cmb-shift-rows{margin-left:1em}.cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-up-alt2{margin-top:.15em}.cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-down-alt2{margin-top:.2em}.cmb-repeatable-group .cmb2-upload-button{float:left}p.cmb2-metabox-description{color:#666;letter-spacing:.01em;margin:0;padding-top:.5em}span.cmb2-metabox-description{color:#666;letter-spacing:.01em}.cmb2-metabox-title{margin:0 0 5px 0;padding:5px 0 0 0;font-size:14px}.cmb-inline ul{padding:4px 0 0 0}.cmb-inline li{display:inline-block;padding-left:18px}.cmb-type-textarea-code pre{margin:0}.cmb2-media-status .img-status{clear:none;display:inline-block;vertical-align:middle;margin-left:10px;width:auto}.cmb2-media-status .img-status img{max-width:350px;height:auto}.cmb2-media-status .embed-status,.cmb2-media-status .img-status img{background:#eee;border:5px solid #fff;outline:1px solid #e9e9e9;box-shadow:inset 0 0 15px rgba(0,0,0,.3),inset 0 0 0 1px rgba(0,0,0,.05);background-image:linear-gradient(45deg,#d0d0d0 25%,transparent 25%,transparent 75%,#d0d0d0 75%,#d0d0d0),linear-gradient(45deg,#d0d0d0 25%,transparent 25%,transparent 75%,#d0d0d0 75%,#d0d0d0);background-position:0 0,10px 10px;background-size:20px 20px;border-radius:2px;-moz-border-radius:2px;margin:15px 0 0 0}.cmb2-media-status .embed-status{float:right;max-width:800px}.cmb2-media-status .embed-status,.cmb2-media-status .img-status{position:relative}.cmb2-media-status .embed-status .cmb2-remove-file-button,.cmb2-media-status .img-status .cmb2-remove-file-button{background:url(../images/ico-delete.png);height:16px;right:-5px;position:absolute;text-indent:-9999px;top:-5px;width:16px}.cmb2-media-status .img-status .cmb2-remove-file-button{top:10px}.cmb2-media-status .file-status>span,.cmb2-media-status .img-status img{cursor:pointer}.cmb2-media-status.cmb-attach-list .file-status>span,.cmb2-media-status.cmb-attach-list .img-status img{cursor:move}.cmb-type-file-list .cmb2-media-status .img-status{clear:none;vertical-align:middle;width:auto;margin-left:10px;margin-bottom:10px;margin-top:0}.cmb-attach-list li{clear:both;display:inline-block;width:100%;margin-top:5px;margin-bottom:10px}.cmb-attach-list li img{float:right;margin-left:10px}.cmb2-remove-wrapper{margin:0}.child-cmb2 .cmb-th{text-align:right}.cmb2-indented-hierarchy{padding-right:1.5em}@media (max-width:450px){.cmb-td,.cmb-th,.cmb-th+.cmb-td{display:block;float:none;width:100%}}#poststuff .cmb-group-title{margin-right:-1em;margin-left:-1em;min-height:1.5em}#poststuff .repeatable .cmb-group-title{padding-right:2.2em}.cmb-type-group .cmb2-wrap,.cmb2-postbox .cmb2-wrap{margin:0}.cmb-type-group .cmb2-wrap>.cmb-field-list>.cmb-row,.cmb2-postbox .cmb2-wrap>.cmb-field-list>.cmb-row{padding:1.8em 0}.cmb-type-group .cmb2-wrap input[type=text].cmb2-oembed,.cmb2-postbox .cmb2-wrap input[type=text].cmb2-oembed{width:100%}.cmb-type-group .cmb-row,.cmb2-postbox .cmb-row{padding:0 0 1.8em;margin:0 0 .8em}.cmb-type-group .cmb-row .cmbhandle,.cmb2-postbox .cmb-row .cmbhandle{left:-1em;position:relative;color:#222}.cmb-type-group .cmb-repeatable-grouping,.cmb2-postbox .cmb-repeatable-grouping{padding:0 1em;max-width:100%;min-width:1px!important}.cmb-type-group .cmb-repeatable-group>.cmb-row,.cmb2-postbox .cmb-repeatable-group>.cmb-row{padding-bottom:0}.cmb-type-group .cmb-th,.cmb2-postbox .cmb-th{width:18%;padding:0 0 0 2%}.cmb-type-group .cmb-td,.cmb2-postbox .cmb-td{margin-bottom:0;padding:0;line-height:1.3}.cmb-type-group .cmb-th+.cmb-td,.cmb2-postbox .cmb-th+.cmb-td{width:80%;float:left}.cmb-type-group .cmb-repeatable-group:not(:last-of-type),.cmb-type-group .cmb-row:not(:last-of-type),.cmb2-postbox .cmb-repeatable-group:not(:last-of-type),.cmb2-postbox .cmb-row:not(:last-of-type){border-bottom:1px solid #e9e9e9}@media (max-width:450px){.cmb-type-group .cmb-repeatable-group:not(:last-of-type),.cmb-type-group .cmb-row:not(:last-of-type),.cmb2-postbox .cmb-repeatable-group:not(:last-of-type),.cmb2-postbox .cmb-row:not(:last-of-type){border-bottom:0}}.cmb-type-group .cmb-remove-field-row,.cmb-type-group .cmb-repeat-group-field,.cmb2-postbox .cmb-remove-field-row,.cmb2-postbox .cmb-repeat-group-field{padding-top:1.8em}.js .cmb2-postbox.context-box .handlediv{text-align:center}.js .cmb2-postbox.context-box .toggle-indicator:before{content:"\f142";display:inline-block;font:normal 20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.js .cmb2-postbox.context-box.closed .toggle-indicator:before{content:"\f140"}.cmb2-postbox.context-box{margin-bottom:10px}.cmb2-postbox.context-box.context-before_permalink-box{margin-top:10px}.cmb2-postbox.context-box.context-after_title-box{margin-top:10px}.cmb2-postbox.context-box.context-after_editor-box{margin-top:20px;margin-bottom:0}.cmb2-postbox.context-box.context-form_top-box{margin-top:10px}.cmb2-postbox.context-box.context-form_top-box .hndle{font-size:14px;padding:8px 12px;margin:0;line-height:1.4}.cmb2-postbox.context-box .hndle{cursor:auto}.cmb2-context-wrap{margin-top:10px}.cmb2-context-wrap.cmb2-context-wrap-form_top{margin-left:300px;width:auto}.cmb2-context-wrap.cmb2-context-wrap-no-title .cmb2-metabox{padding:10px}.cmb2-context-wrap .cmb-th{padding:0 0 0 2%;width:18%}.cmb2-context-wrap .cmb-td{width:80%;padding:0}.cmb2-context-wrap .cmb-row{margin-bottom:10px}.cmb2-context-wrap .cmb-row:last-of-type{margin-bottom:0}@media only screen and (max-width:850px){.cmb2-context-wrap.cmb2-context-wrap-form_top{margin-left:0}}#poststuff .cmb-repeatable-group h2{margin:0}.edit-tags-php .cmb2-metabox-title,.profile-php .cmb2-metabox-title,.user-edit-php .cmb2-metabox-title{font-size:1.4em}.cmb2-no-box-wrap .cmb-spinner,.cmb2-postbox .cmb-spinner{float:right;display:none}.cmb-spinner{display:none}.cmb-spinner.is-active{display:block}.cmb2-metabox .cmbhandle{color:#757575;float:left;width:27px;height:30px;cursor:pointer;left:-1em;position:relative}.cmb2-metabox .cmbhandle:before{content:'\f142';left:12px;font:normal 20px/1 dashicons;speak:none;display:inline-block;padding:8px 10px;top:0;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.cmb2-metabox .postbox.closed .cmbhandle:before{content:'\f140'}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row{-webkit-appearance:none!important;background:0 0!important;border:none!important;position:absolute;right:0;top:.5em;line-height:1em;padding:2px 6px 3px;opacity:.5}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]){cursor:pointer;color:#a00;opacity:1}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]):hover{color:red}* html .cmb2-element.ui-helper-clearfix{height:1%}.cmb2-element .ui-datepicker,.cmb2-element.ui-datepicker{padding:0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;background-color:#fff;border:1px solid #dfdfdf;border-top:none;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.075);box-shadow:0 3px 6px rgba(0,0,0,.075);min-width:17em;width:auto}.cmb2-element .ui-datepicker *,.cmb2-element.ui-datepicker *{padding:0;font-family:"Open Sans",sans-serif;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.cmb2-element .ui-datepicker table,.cmb2-element.ui-datepicker table{font-size:13px;margin:0;border:none;border-collapse:collapse}.cmb2-element .ui-datepicker .ui-datepicker-header,.cmb2-element .ui-datepicker .ui-widget-header,.cmb2-element.ui-datepicker .ui-datepicker-header,.cmb2-element.ui-datepicker .ui-widget-header{background-image:none;border:none;color:#fff;font-weight:400}.cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover,.cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover{background:0 0;border-color:transparent;cursor:pointer}.cmb2-element .ui-datepicker .ui-datepicker-title,.cmb2-element.ui-datepicker .ui-datepicker-title{margin:0;padding:10px 0;color:#fff;font-size:14px;line-height:14px;text-align:center}.cmb2-element .ui-datepicker .ui-datepicker-title select,.cmb2-element.ui-datepicker .ui-datepicker-title select{margin-top:-8px;margin-bottom:-8px}.cmb2-element .ui-datepicker .ui-datepicker-next,.cmb2-element .ui-datepicker .ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-datepicker-next,.cmb2-element.ui-datepicker .ui-datepicker-prev{position:relative;top:0;height:34px;width:34px}.cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-next,.cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-next,.cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-prev{border:none}.cmb2-element .ui-datepicker .ui-datepicker-prev,.cmb2-element .ui-datepicker .ui-datepicker-prev-hover,.cmb2-element.ui-datepicker .ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-datepicker-prev-hover{right:0}.cmb2-element .ui-datepicker .ui-datepicker-next,.cmb2-element .ui-datepicker .ui-datepicker-next-hover,.cmb2-element.ui-datepicker .ui-datepicker-next,.cmb2-element.ui-datepicker .ui-datepicker-next-hover{left:0}.cmb2-element .ui-datepicker .ui-datepicker-next span,.cmb2-element .ui-datepicker .ui-datepicker-prev span,.cmb2-element.ui-datepicker .ui-datepicker-next span,.cmb2-element.ui-datepicker .ui-datepicker-prev span{display:none}.cmb2-element .ui-datepicker .ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-datepicker-prev{float:right}.cmb2-element .ui-datepicker .ui-datepicker-next,.cmb2-element.ui-datepicker .ui-datepicker-next{float:left}.cmb2-element .ui-datepicker .ui-datepicker-next:before,.cmb2-element .ui-datepicker .ui-datepicker-prev:before,.cmb2-element.ui-datepicker .ui-datepicker-next:before,.cmb2-element.ui-datepicker .ui-datepicker-prev:before{font:normal 20px/34px dashicons;padding-right:7px;color:#fff;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:34px;height:34px}.cmb2-element .ui-datepicker .ui-datepicker-prev:before,.cmb2-element.ui-datepicker .ui-datepicker-prev:before{content:'\f341'}.cmb2-element .ui-datepicker .ui-datepicker-next:before,.cmb2-element.ui-datepicker .ui-datepicker-next:before{content:'\f345'}.cmb2-element .ui-datepicker .ui-datepicker-next-hover:before,.cmb2-element .ui-datepicker .ui-datepicker-prev-hover:before,.cmb2-element.ui-datepicker .ui-datepicker-next-hover:before,.cmb2-element.ui-datepicker .ui-datepicker-prev-hover:before{opacity:.7}.cmb2-element .ui-datepicker select.ui-datepicker-month,.cmb2-element .ui-datepicker select.ui-datepicker-year,.cmb2-element.ui-datepicker select.ui-datepicker-month,.cmb2-element.ui-datepicker select.ui-datepicker-year{width:33%;background:0 0;border-color:transparent;box-shadow:none;color:#fff}.cmb2-element .ui-datepicker select.ui-datepicker-month option,.cmb2-element .ui-datepicker select.ui-datepicker-year option,.cmb2-element.ui-datepicker select.ui-datepicker-month option,.cmb2-element.ui-datepicker select.ui-datepicker-year option{color:#333}.cmb2-element .ui-datepicker thead,.cmb2-element.ui-datepicker thead{color:#fff;font-weight:600}.cmb2-element .ui-datepicker thead th,.cmb2-element.ui-datepicker thead th{font-weight:400}.cmb2-element .ui-datepicker th,.cmb2-element.ui-datepicker th{padding:10px}.cmb2-element .ui-datepicker td,.cmb2-element.ui-datepicker td{padding:0;border:1px solid #f4f4f4}.cmb2-element .ui-datepicker td.ui-datepicker-other-month,.cmb2-element.ui-datepicker td.ui-datepicker-other-month{border:transparent}.cmb2-element .ui-datepicker td.ui-datepicker-week-end,.cmb2-element.ui-datepicker td.ui-datepicker-week-end{background-color:#f4f4f4;border:1px solid #f4f4f4}.cmb2-element .ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today,.cmb2-element.ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today{-webkit-box-shadow:inset 0 0 1px 0 rgba(0,0,0,.1);-moz-box-shadow:inset 0 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 0 1px 0 rgba(0,0,0,.1)}.cmb2-element .ui-datepicker td.ui-datepicker-today,.cmb2-element.ui-datepicker td.ui-datepicker-today{background-color:#f0f0c0}.cmb2-element .ui-datepicker td.ui-datepicker-current-day,.cmb2-element.ui-datepicker td.ui-datepicker-current-day{background:#bd8}.cmb2-element .ui-datepicker td .ui-state-default,.cmb2-element.ui-datepicker td .ui-state-default{background:0 0;border:none;text-align:center;text-decoration:none;width:auto;display:block;padding:5px 10px;font-weight:400;color:#444}.cmb2-element .ui-datepicker td.ui-state-disabled .ui-state-default,.cmb2-element.ui-datepicker td.ui-state-disabled .ui-state-default{opacity:.5}.cmb2-element .ui-datepicker .ui-datepicker-header,.cmb2-element .ui-datepicker .ui-widget-header,.cmb2-element.ui-datepicker .ui-datepicker-header,.cmb2-element.ui-datepicker .ui-widget-header{background:#00a0d2}.cmb2-element .ui-datepicker thead,.cmb2-element.ui-datepicker thead{background:#32373c}.cmb2-element .ui-datepicker td .ui-state-active,.cmb2-element .ui-datepicker td .ui-state-hover,.cmb2-element.ui-datepicker td .ui-state-active,.cmb2-element.ui-datepicker td .ui-state-hover{background:#0073aa;color:#fff}.cmb2-element .ui-datepicker .ui-timepicker-div,.cmb2-element.ui-datepicker .ui-timepicker-div{font-size:14px}.cmb2-element .ui-datepicker .ui-timepicker-div dl,.cmb2-element.ui-datepicker .ui-timepicker-div dl{text-align:right;padding:0 .6em}.cmb2-element .ui-datepicker .ui-timepicker-div dl dt,.cmb2-element.ui-datepicker .ui-timepicker-div dl dt{float:right;clear:right;padding:0 5px 0 0}.cmb2-element .ui-datepicker .ui-timepicker-div dl dd,.cmb2-element.ui-datepicker .ui-timepicker-div dl dd{margin:0 40% 10px 10px}.cmb2-element .ui-datepicker .ui-timepicker-div dl dd select,.cmb2-element.ui-datepicker .ui-timepicker-div dl dd select{width:100%}.cmb2-element .ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane,.cmb2-element.ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane{padding:.6em;text-align:right}.cmb2-element .ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-primary,.cmb2-element .ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-secondary,.cmb2-element.ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-primary,.cmb2-element.ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-secondary{padding:0 10px 1px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;margin:0 .4em .4em .6em}.admin-color-fresh .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-fresh .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-fresh .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-fresh .cmb2-element.ui-datepicker .ui-widget-header{background:#00a0d2}.admin-color-fresh .cmb2-element .ui-datepicker thead,.admin-color-fresh .cmb2-element.ui-datepicker thead{background:#32373c}.admin-color-fresh .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-fresh .cmb2-element.ui-datepicker td .ui-state-hover{background:#0073aa;color:#fff}.admin-color-blue .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-blue .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-blue .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-blue .cmb2-element.ui-datepicker .ui-widget-header{background:#52accc}.admin-color-blue .cmb2-element .ui-datepicker thead,.admin-color-blue .cmb2-element.ui-datepicker thead{background:#4796b3}.admin-color-blue .cmb2-element .ui-datepicker td .ui-state-active,.admin-color-blue .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-blue .cmb2-element.ui-datepicker td .ui-state-active,.admin-color-blue .cmb2-element.ui-datepicker td .ui-state-hover{background:#096484;color:#fff}.admin-color-blue .cmb2-element .ui-datepicker td.ui-datepicker-today,.admin-color-blue .cmb2-element.ui-datepicker td.ui-datepicker-today{background:#eee}.admin-color-coffee .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-coffee .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-coffee .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-coffee .cmb2-element.ui-datepicker .ui-widget-header{background:#59524c}.admin-color-coffee .cmb2-element .ui-datepicker thead,.admin-color-coffee .cmb2-element.ui-datepicker thead{background:#46403c}.admin-color-coffee .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-coffee .cmb2-element.ui-datepicker td .ui-state-hover{background:#c7a589;color:#fff}.admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-widget-header{background:#523f6d}.admin-color-ectoplasm .cmb2-element .ui-datepicker thead,.admin-color-ectoplasm .cmb2-element.ui-datepicker thead{background:#413256}.admin-color-ectoplasm .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-ectoplasm .cmb2-element.ui-datepicker td .ui-state-hover{background:#a3b745;color:#fff}.admin-color-midnight .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-midnight .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-midnight .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-midnight .cmb2-element.ui-datepicker .ui-widget-header{background:#363b3f}.admin-color-midnight .cmb2-element .ui-datepicker thead,.admin-color-midnight .cmb2-element.ui-datepicker thead{background:#26292c}.admin-color-midnight .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-midnight .cmb2-element.ui-datepicker td .ui-state-hover{background:#e14d43;color:#fff}.admin-color-ocean .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-ocean .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-ocean .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-ocean .cmb2-element.ui-datepicker .ui-widget-header{background:#738e96}.admin-color-ocean .cmb2-element .ui-datepicker thead,.admin-color-ocean .cmb2-element.ui-datepicker thead{background:#627c83}.admin-color-ocean .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-ocean .cmb2-element.ui-datepicker td .ui-state-hover{background:#9ebaa0;color:#fff}.admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover,.admin-color-sunrise .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover,.admin-color-sunrise .cmb2-element.ui-datepicker .ui-widget-header{background:#cf4944}.admin-color-sunrise .cmb2-element .ui-datepicker th,.admin-color-sunrise .cmb2-element.ui-datepicker th{border-color:#be3631;background:#be3631}.admin-color-sunrise .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-sunrise .cmb2-element.ui-datepicker td .ui-state-hover{background:#dd823b;color:#fff}.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-light .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-light .cmb2-element.ui-datepicker .ui-widget-header{background:#e5e5e5}.admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-month,.admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-year,.admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-month,.admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-year{color:#555}.admin-color-light .cmb2-element .ui-datepicker thead,.admin-color-light .cmb2-element.ui-datepicker thead{background:#888}.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-next:before,.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-prev:before,.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-title,.admin-color-light .cmb2-element .ui-datepicker td .ui-state-default,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-next:before,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-prev:before,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-title,.admin-color-light .cmb2-element.ui-datepicker td .ui-state-default{color:#555}.admin-color-light .cmb2-element .ui-datepicker td .ui-state-active,.admin-color-light .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-light .cmb2-element.ui-datepicker td .ui-state-active,.admin-color-light .cmb2-element.ui-datepicker td .ui-state-hover{background:#ccc}.admin-color-light .cmb2-element .ui-datepicker td.ui-datepicker-today,.admin-color-light .cmb2-element.ui-datepicker td.ui-datepicker-today{background:#eee}.admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-widget-header{background:#56b274}.admin-color-bbp-evergreen .cmb2-element .ui-datepicker thead,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker thead{background:#36533f}.admin-color-bbp-evergreen .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker td .ui-state-hover{background:#446950;color:#fff}.admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-widget-header{background:#4ca26a}.admin-color-bbp-mint .cmb2-element .ui-datepicker thead,.admin-color-bbp-mint .cmb2-element.ui-datepicker thead{background:#4f6d59}.admin-color-bbp-mint .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-bbp-mint .cmb2-element.ui-datepicker td .ui-state-hover{background:#5fb37c;color:#fff}.cmb2-char-counter-wrap{margin:.5em 0 1em}.cmb2-char-counter-wrap input[type=text]{font-size:12px;width:25px}.cmb2-char-counter-wrap.cmb2-max-exceeded input[type=text]{border-color:#a00!important}.cmb2-char-counter-wrap.cmb2-max-exceeded .cmb2-char-max-msg{display:inline-block}.cmb2-char-max-msg{color:#a00;display:none;font-weight:600;margin-right:1em}.closed .inside{display:none}.cmb-repeatable-grouping{position:relative}.cmb-repeatable-grouping .cmb-group-title{margin-right:-1em;margin-left:-1em;min-height:1.5em}.cmb-repeatable-grouping h3{font-size:14px;padding:8px 12px;margin:0;line-height:1.4}.cmb-repeatable-group.repeatable .cmb-group-title{padding-right:2.2em}.cmb-repeatable-group.non-repeatable .cmb-group-title{padding-right:12px}.cmb-type-group .cmb-row .cmbhandle{left:0;position:absolute}.cmb-spinner{background:url(/wp-admin/images/spinner.gif) no-repeat;-webkit-background-size:20px 20px;background-size:20px 20px;display:none;float:left;vertical-align:middle;opacity:.7;width:20px;height:20px;margin:4px 10px 0}.cmb2-char-max-msg{display:none}
 
includes/lib/cmb2/css/cmb2-front.css DELETED
@@ -1,1373 +0,0 @@
1
- /*!
2
- * CMB2 - v2.9.0 - 2021-03-03
3
- * https://cmb2.io
4
- * Copyright (c) 2021
5
- * Licensed GPLv2+
6
- */
7
-
8
- @charset "UTF-8";
9
- /*--------------------------------------------------------------
10
- * Main Wrap
11
- --------------------------------------------------------------*/
12
- /* line 5, sass/partials/_main_wrap.scss */
13
- .cmb2-wrap {
14
- margin: 0;
15
- }
16
- /* line 8, sass/partials/_main_wrap.scss */
17
- .cmb2-wrap input,
18
- .cmb2-wrap textarea {
19
- max-width: 100%;
20
- }
21
- /* line 15, sass/partials/_main_wrap.scss */
22
- .cmb2-wrap input[type="text"].cmb2-oembed {
23
- width: 100%;
24
- }
25
- /* line 20, sass/partials/_main_wrap.scss */
26
- .cmb2-wrap textarea {
27
- width: 500px;
28
- padding: 8px;
29
- }
30
- /* line 24, sass/partials/_main_wrap.scss */
31
- .cmb2-wrap textarea.cmb2-textarea-code {
32
- font-family: "Courier 10 Pitch", Courier, monospace;
33
- line-height: 16px;
34
- }
35
- /* line 32, sass/partials/_main_wrap.scss */
36
- .cmb2-wrap input.cmb2-text-small, .cmb2-wrap input.cmb2-timepicker {
37
- width: 100px;
38
- }
39
- /* line 38, sass/partials/_main_wrap.scss */
40
- .cmb2-wrap input.cmb2-text-money {
41
- width: 90px;
42
- }
43
- /* line 43, sass/partials/_main_wrap.scss */
44
- .cmb2-wrap input.cmb2-text-medium {
45
- width: 230px;
46
- }
47
- /* line 48, sass/partials/_main_wrap.scss */
48
- .cmb2-wrap input.cmb2-upload-file {
49
- width: 65%;
50
- }
51
- /* line 52, sass/partials/_main_wrap.scss */
52
- .cmb2-wrap input.ed_button {
53
- padding: 2px 4px;
54
- }
55
- /* line 57, sass/partials/_main_wrap.scss */
56
- .cmb2-wrap input:not([type="hidden"]) + input,
57
- .cmb2-wrap input:not([type="hidden"]) + .button-secondary,
58
- .cmb2-wrap input:not([type="hidden"]) + select {
59
- margin-left: 20px;
60
- }
61
- /* line 65, sass/partials/_main_wrap.scss */
62
- .cmb2-wrap ul {
63
- margin: 0;
64
- }
65
- /* line 69, sass/partials/_main_wrap.scss */
66
- .cmb2-wrap li {
67
- font-size: 14px;
68
- line-height: 16px;
69
- margin: 1px 0 5px 0;
70
- }
71
- /* line 80, sass/partials/_main_wrap.scss */
72
- .cmb2-wrap select {
73
- font-size: 14px;
74
- margin-top: 3px;
75
- }
76
- /* line 85, sass/partials/_main_wrap.scss */
77
- .cmb2-wrap input:focus,
78
- .cmb2-wrap textarea:focus {
79
- background: #fffff8;
80
- }
81
- /* line 90, sass/partials/_main_wrap.scss */
82
- .cmb2-wrap input[type="radio"] {
83
- margin: 0 5px 0 0;
84
- padding: 0;
85
- }
86
- /* line 95, sass/partials/_main_wrap.scss */
87
- .cmb2-wrap input[type="checkbox"] {
88
- margin: 0 5px 0 0;
89
- padding: 0;
90
- }
91
- /* line 100, sass/partials/_main_wrap.scss */
92
- .cmb2-wrap button,
93
- .cmb2-wrap .button-secondary {
94
- white-space: nowrap;
95
- }
96
- /* line 105, sass/partials/_main_wrap.scss */
97
- .cmb2-wrap .mceLayout {
98
- border: 1px solid #e9e9e9 !important;
99
- }
100
- /* line 109, sass/partials/_main_wrap.scss */
101
- .cmb2-wrap .mceIframeContainer {
102
- background: #ffffff;
103
- }
104
- /* line 113, sass/partials/_main_wrap.scss */
105
- .cmb2-wrap .meta_mce {
106
- width: 97%;
107
- }
108
- /* line 116, sass/partials/_main_wrap.scss */
109
- .cmb2-wrap .meta_mce textarea {
110
- width: 100%;
111
- }
112
- /* line 122, sass/partials/_main_wrap.scss */
113
- .cmb2-wrap .cmb-multicheck-toggle {
114
- margin-top: -1em;
115
- }
116
- /* line 127, sass/partials/_main_wrap.scss */
117
- .cmb2-wrap .wp-picker-clear.button,
118
- .cmb2-wrap .wp-picker-default.button {
119
- margin-left: 6px;
120
- padding: 2px 8px;
121
- }
122
- /* line 133, sass/partials/_main_wrap.scss */
123
- .cmb2-wrap .cmb-row {
124
- margin: 0;
125
- }
126
- /* line 136, sass/partials/_main_wrap.scss */
127
- .cmb2-wrap .cmb-row:after {
128
- content: '';
129
- clear: both;
130
- display: block;
131
- width: 100%;
132
- }
133
- /* line 143, sass/partials/_main_wrap.scss */
134
- .cmb2-wrap .cmb-row.cmb-repeat .cmb2-metabox-description {
135
- padding-top: 0;
136
- padding-bottom: 1em;
137
- }
138
-
139
- /* line 154, sass/partials/_main_wrap.scss */
140
- body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type="radio"]::before {
141
- margin: .1875rem;
142
- }
143
- @media screen and (max-width: 782px) {
144
- /* line 154, sass/partials/_main_wrap.scss */
145
- body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type="radio"]::before {
146
- margin: .4375rem;
147
- }
148
- }
149
-
150
- /* line 162, sass/partials/_main_wrap.scss */
151
- .cmb2-metabox {
152
- clear: both;
153
- margin: 0;
154
- }
155
- /* line 168, sass/partials/_main_wrap.scss */
156
- .cmb2-metabox > .cmb-row:first-of-type > .cmb-td,
157
- .cmb2-metabox > .cmb-row:first-of-type > .cmb-th,
158
- .cmb2-metabox .cmb-field-list > .cmb-row:first-of-type > .cmb-td,
159
- .cmb2-metabox .cmb-field-list > .cmb-row:first-of-type > .cmb-th {
160
- border: 0;
161
- }
162
-
163
- /* line 175, sass/partials/_main_wrap.scss */
164
- .cmb-add-row {
165
- margin: 1.8em 0 0;
166
- }
167
-
168
- /* line 179, sass/partials/_main_wrap.scss */
169
- .cmb-nested .cmb-td,
170
- .cmb-repeatable-group .cmb-th,
171
- .cmb-repeatable-group:first-of-type {
172
- border: 0;
173
- }
174
-
175
- /* line 185, sass/partials/_main_wrap.scss */
176
- .cmb-row:last-of-type,
177
- .cmb2-wrap .cmb-row:last-of-type,
178
- .cmb-repeatable-group:last-of-type {
179
- border-bottom: 0;
180
- }
181
-
182
- /* line 191, sass/partials/_main_wrap.scss */
183
- .cmb-repeatable-grouping {
184
- border: 1px solid #e9e9e9;
185
- padding: 0 1em;
186
- }
187
- /* line 195, sass/partials/_main_wrap.scss */
188
- .cmb-repeatable-grouping.cmb-row {
189
- margin: 0 0 0.8em;
190
- }
191
-
192
- /* line 203, sass/partials/_main_wrap.scss */
193
- .cmb-th {
194
- color: #222222;
195
- float: left;
196
- font-weight: 600;
197
- padding: 20px 10px 20px 0;
198
- vertical-align: top;
199
- width: 200px;
200
- }
201
- @media (max-width: 450px) {
202
- /* line 203, sass/partials/_main_wrap.scss */
203
- .cmb-th {
204
- font-size: 1.2em;
205
- display: block;
206
- float: none;
207
- padding-bottom: 1em;
208
- text-align: left;
209
- width: 100%;
210
- }
211
- /* line 27, sass/partials/_mixins.scss */
212
- .cmb-th label {
213
- display: block;
214
- margin-top: 0;
215
- margin-bottom: 0.5em;
216
- }
217
- }
218
-
219
- /* line 216, sass/partials/_main_wrap.scss */
220
- .cmb-td {
221
- line-height: 1.3;
222
- max-width: 100%;
223
- padding: 15px 10px;
224
- vertical-align: middle;
225
- }
226
-
227
- /* line 225, sass/partials/_main_wrap.scss */
228
- .cmb-type-title .cmb-td {
229
- padding: 0;
230
- }
231
-
232
- /* line 230, sass/partials/_main_wrap.scss */
233
- .cmb-th label {
234
- display: block;
235
- padding: 5px 0;
236
- }
237
-
238
- /* line 235, sass/partials/_main_wrap.scss */
239
- .cmb-th + .cmb-td {
240
- float: left;
241
- }
242
-
243
- /* line 239, sass/partials/_main_wrap.scss */
244
- .cmb-td .cmb-td {
245
- padding-bottom: 1em;
246
- }
247
-
248
- /* line 243, sass/partials/_main_wrap.scss */
249
- .cmb-remove-row {
250
- text-align: right;
251
- }
252
-
253
- /* line 247, sass/partials/_main_wrap.scss */
254
- .empty-row.hidden {
255
- display: none;
256
- }
257
-
258
- /* line 252, sass/partials/_main_wrap.scss */
259
- .cmb-repeat-table {
260
- background-color: #fafafa;
261
- border: 1px solid #e1e1e1;
262
- }
263
- /* line 256, sass/partials/_main_wrap.scss */
264
- .cmb-repeat-table .cmb-row.cmb-repeat-row {
265
- position: relative;
266
- counter-increment: el;
267
- margin: 0;
268
- padding: 10px 10px 10px 50px;
269
- border-bottom: none !important;
270
- }
271
- /* line 264, sass/partials/_main_wrap.scss */
272
- .cmb-repeat-table .cmb-row.cmb-repeat-row + .cmb-repeat-row {
273
- border-top: solid 1px #e9e9e9;
274
- }
275
- /* line 268, sass/partials/_main_wrap.scss */
276
- .cmb-repeat-table .cmb-row.cmb-repeat-row.ui-sortable-helper {
277
- outline: dashed 2px #e9e9e9 !important;
278
- }
279
- /* line 272, sass/partials/_main_wrap.scss */
280
- .cmb-repeat-table .cmb-row.cmb-repeat-row:before {
281
- content: counter(el);
282
- display: block;
283
- top: 0;
284
- left: 0;
285
- position: absolute;
286
- width: 35px;
287
- height: 100%;
288
- line-height: 35px;
289
- cursor: move;
290
- color: #757575;
291
- text-align: center;
292
- border-right: solid 1px #e9e9e9;
293
- }
294
- /* line 289, sass/partials/_main_wrap.scss */
295
- .cmb-repeat-table .cmb-row.cmb-repeat-row .cmb-td {
296
- margin: 0;
297
- padding: 0;
298
- }
299
- /* line 296, sass/partials/_main_wrap.scss */
300
- .cmb-repeat-table + .cmb-add-row {
301
- margin: 0;
302
- }
303
- /* line 299, sass/partials/_main_wrap.scss */
304
- .cmb-repeat-table + .cmb-add-row:before {
305
- content: '';
306
- width: 1px;
307
- height: 1.6em;
308
- display: block;
309
- margin-left: 17px;
310
- background-color: gainsboro;
311
- }
312
- /* line 309, sass/partials/_main_wrap.scss */
313
- .cmb-repeat-table .cmb-remove-row {
314
- top: 7px;
315
- right: 7px;
316
- position: absolute;
317
- width: auto;
318
- margin-left: 0;
319
- padding: 0 !important;
320
- display: none;
321
- }
322
- /* line 320, sass/partials/_main_wrap.scss */
323
- .cmb-repeat-table .cmb-remove-row > .cmb-remove-row-button {
324
- font-size: 20px;
325
- text-indent: -1000px;
326
- overflow: hidden;
327
- position: relative;
328
- height: auto;
329
- line-height: 1;
330
- padding: 0 10px 0;
331
- }
332
- /* line 331, sass/partials/_main_wrap.scss */
333
- .cmb-repeat-table .cmb-remove-row > .cmb-remove-row-button:before {
334
- content: "";
335
- font-family: 'Dashicons';
336
- speak: none;
337
- font-weight: normal;
338
- font-variant: normal;
339
- text-transform: none;
340
- line-height: 1;
341
- -webkit-font-smoothing: antialiased;
342
- margin: 0;
343
- text-indent: 0;
344
- position: absolute;
345
- top: 0;
346
- left: 0;
347
- width: 100%;
348
- height: 100%;
349
- text-align: center;
350
- }
351
- /* line 337, sass/partials/_main_wrap.scss */
352
- .cmb-repeat-table .cmb-repeat-row:hover .cmb-remove-row {
353
- display: block;
354
- }
355
-
356
- /* line 345, sass/partials/_main_wrap.scss */
357
- .cmb-repeatable-group .cmb-th {
358
- padding: 5px;
359
- }
360
- /* line 349, sass/partials/_main_wrap.scss */
361
- .cmb-repeatable-group .cmb-group-title {
362
- background-color: #e9e9e9;
363
- padding: 8px 12px 8px 2.2em;
364
- margin: 0 -1em;
365
- min-height: 1.5em;
366
- font-size: 14px;
367
- line-height: 1.4;
368
- }
369
- /* line 357, sass/partials/_main_wrap.scss */
370
- .cmb-repeatable-group .cmb-group-title h4 {
371
- border: 0;
372
- margin: 0;
373
- font-size: 1.2em;
374
- font-weight: 500;
375
- padding: 0.5em 0.75em;
376
- }
377
- /* line 365, sass/partials/_main_wrap.scss */
378
- .cmb-repeatable-group .cmb-group-title .cmb-th {
379
- display: block;
380
- width: 100%;
381
- }
382
- /* line 371, sass/partials/_main_wrap.scss */
383
- .cmb-repeatable-group .cmb-group-description .cmb-th {
384
- font-size: 1.2em;
385
- display: block;
386
- float: none;
387
- padding-bottom: 1em;
388
- text-align: left;
389
- width: 100%;
390
- }
391
- /* line 27, sass/partials/_mixins.scss */
392
- .cmb-repeatable-group .cmb-group-description .cmb-th label {
393
- display: block;
394
- margin-top: 0;
395
- margin-bottom: 0.5em;
396
- }
397
- /* line 375, sass/partials/_main_wrap.scss */
398
- .cmb-repeatable-group .cmb-shift-rows {
399
- margin-right: 1em;
400
- }
401
- /* line 378, sass/partials/_main_wrap.scss */
402
- .cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-up-alt2 {
403
- margin-top: .15em;
404
- }
405
- /* line 382, sass/partials/_main_wrap.scss */
406
- .cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-down-alt2 {
407
- margin-top: .2em;
408
- }
409
- /* line 387, sass/partials/_main_wrap.scss */
410
- .cmb-repeatable-group .cmb2-upload-button {
411
- float: right;
412
- }
413
-
414
- /* line 393, sass/partials/_main_wrap.scss */
415
- p.cmb2-metabox-description {
416
- color: #666;
417
- letter-spacing: 0.01em;
418
- margin: 0;
419
- padding-top: .5em;
420
- }
421
-
422
- /* line 400, sass/partials/_main_wrap.scss */
423
- span.cmb2-metabox-description {
424
- color: #666;
425
- letter-spacing: 0.01em;
426
- }
427
-
428
- /* line 405, sass/partials/_main_wrap.scss */
429
- .cmb2-metabox-title {
430
- margin: 0 0 5px 0;
431
- padding: 5px 0 0 0;
432
- font-size: 14px;
433
- }
434
-
435
- /* line 411, sass/partials/_main_wrap.scss */
436
- .cmb-inline ul {
437
- padding: 4px 0 0 0;
438
- }
439
-
440
- /* line 415, sass/partials/_main_wrap.scss */
441
- .cmb-inline li {
442
- display: inline-block;
443
- padding-right: 18px;
444
- }
445
-
446
- /* line 420, sass/partials/_main_wrap.scss */
447
- .cmb-type-textarea-code pre {
448
- margin: 0;
449
- }
450
-
451
- /* line 426, sass/partials/_main_wrap.scss */
452
- .cmb2-media-status .img-status {
453
- clear: none;
454
- display: inline-block;
455
- vertical-align: middle;
456
- margin-right: 10px;
457
- width: auto;
458
- }
459
- /* line 433, sass/partials/_main_wrap.scss */
460
- .cmb2-media-status .img-status img {
461
- max-width: 350px;
462
- height: auto;
463
- }
464
- /* line 439, sass/partials/_main_wrap.scss */
465
- .cmb2-media-status .img-status img,
466
- .cmb2-media-status .embed-status {
467
- background: #eee;
468
- border: 5px solid #ffffff;
469
- outline: 1px solid #e9e9e9;
470
- box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
471
- background-image: linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%, #d0d0d0), linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%, #d0d0d0);
472
- background-position: 0 0, 10px 10px;
473
- background-size: 20px 20px;
474
- border-radius: 2px;
475
- -moz-border-radius: 2px;
476
- margin: 15px 0 0 0;
477
- }
478
- /* line 453, sass/partials/_main_wrap.scss */
479
- .cmb2-media-status .embed-status {
480
- float: left;
481
- max-width: 800px;
482
- }
483
- /* line 458, sass/partials/_main_wrap.scss */
484
- .cmb2-media-status .img-status, .cmb2-media-status .embed-status {
485
- position: relative;
486
- }
487
- /* line 461, sass/partials/_main_wrap.scss */
488
- .cmb2-media-status .img-status .cmb2-remove-file-button, .cmb2-media-status .embed-status .cmb2-remove-file-button {
489
- background: url(../images/ico-delete.png);
490
- height: 16px;
491
- left: -5px;
492
- position: absolute;
493
- text-indent: -9999px;
494
- top: -5px;
495
- width: 16px;
496
- }
497
- /* line 475, sass/partials/_main_wrap.scss */
498
- .cmb2-media-status .img-status .cmb2-remove-file-button {
499
- top: 10px;
500
- }
501
- /* line 480, sass/partials/_main_wrap.scss */
502
- .cmb2-media-status .img-status img, .cmb2-media-status .file-status > span {
503
- cursor: pointer;
504
- }
505
- /* line 485, sass/partials/_main_wrap.scss */
506
- .cmb2-media-status.cmb-attach-list .img-status img, .cmb2-media-status.cmb-attach-list .file-status > span {
507
- cursor: move;
508
- }
509
-
510
- /* line 492, sass/partials/_main_wrap.scss */
511
- .cmb-type-file-list .cmb2-media-status .img-status {
512
- clear: none;
513
- vertical-align: middle;
514
- width: auto;
515
- margin-right: 10px;
516
- margin-bottom: 10px;
517
- margin-top: 0;
518
- }
519
-
520
- /* line 501, sass/partials/_main_wrap.scss */
521
- .cmb-attach-list li {
522
- clear: both;
523
- display: inline-block;
524
- width: 100%;
525
- margin-top: 5px;
526
- margin-bottom: 10px;
527
- }
528
- /* line 507, sass/partials/_main_wrap.scss */
529
- .cmb-attach-list li img {
530
- float: left;
531
- margin-right: 10px;
532
- }
533
-
534
- /* line 513, sass/partials/_main_wrap.scss */
535
- .cmb2-remove-wrapper {
536
- margin: 0;
537
- }
538
-
539
- /* line 517, sass/partials/_main_wrap.scss */
540
- .child-cmb2 .cmb-th {
541
- text-align: left;
542
- }
543
-
544
- /* line 521, sass/partials/_main_wrap.scss */
545
- .cmb2-indented-hierarchy {
546
- padding-left: 1.5em;
547
- }
548
-
549
- @media (max-width: 450px) {
550
- /* line 526, sass/partials/_main_wrap.scss */
551
- .cmb-th,
552
- .cmb-td,
553
- .cmb-th + .cmb-td {
554
- display: block;
555
- float: none;
556
- width: 100%;
557
- }
558
- }
559
- /*--------------------------------------------------------------
560
- * Post Metaboxes
561
- --------------------------------------------------------------*/
562
- /* line 5, sass/partials/_post_metaboxes.scss */
563
- #poststuff .cmb-group-title {
564
- margin-left: -1em;
565
- margin-right: -1em;
566
- min-height: 1.5em;
567
- }
568
-
569
- /* line 11, sass/partials/_post_metaboxes.scss */
570
- #poststuff .repeatable .cmb-group-title {
571
- padding-left: 2.2em;
572
- }
573
-
574
- /* line 17, sass/partials/_post_metaboxes.scss */
575
- .cmb2-postbox .cmb2-wrap, .cmb-type-group .cmb2-wrap {
576
- margin: 0;
577
- }
578
- /* line 20, sass/partials/_post_metaboxes.scss */
579
- .cmb2-postbox .cmb2-wrap > .cmb-field-list > .cmb-row, .cmb-type-group .cmb2-wrap > .cmb-field-list > .cmb-row {
580
- padding: 1.8em 0;
581
- }
582
- /* line 26, sass/partials/_post_metaboxes.scss */
583
- .cmb2-postbox .cmb2-wrap input[type=text].cmb2-oembed, .cmb-type-group .cmb2-wrap input[type=text].cmb2-oembed {
584
- width: 100%;
585
- }
586
- /* line 32, sass/partials/_post_metaboxes.scss */
587
- .cmb2-postbox .cmb-row, .cmb-type-group .cmb-row {
588
- padding: 0 0 1.8em;
589
- margin: 0 0 0.8em;
590
- }
591
- /* line 36, sass/partials/_post_metaboxes.scss */
592
- .cmb2-postbox .cmb-row .cmbhandle, .cmb-type-group .cmb-row .cmbhandle {
593
- right: -1em;
594
- position: relative;
595
- color: #222222;
596
- }
597
- /* line 43, sass/partials/_post_metaboxes.scss */
598
- .cmb2-postbox .cmb-repeatable-grouping, .cmb-type-group .cmb-repeatable-grouping {
599
- padding: 0 1em;
600
- max-width: 100%;
601
- min-width: 1px !important;
602
- }
603
- /* line 49, sass/partials/_post_metaboxes.scss */
604
- .cmb2-postbox .cmb-repeatable-group > .cmb-row, .cmb-type-group .cmb-repeatable-group > .cmb-row {
605
- padding-bottom: 0;
606
- }
607
- /* line 53, sass/partials/_post_metaboxes.scss */
608
- .cmb2-postbox .cmb-th, .cmb-type-group .cmb-th {
609
- width: 18%;
610
- padding: 0 2% 0 0;
611
- }
612
- /* line 59, sass/partials/_post_metaboxes.scss */
613
- .cmb2-postbox .cmb-td, .cmb-type-group .cmb-td {
614
- margin-bottom: 0;
615
- padding: 0;
616
- line-height: 1.3;
617
- }
618
- /* line 65, sass/partials/_post_metaboxes.scss */
619
- .cmb2-postbox .cmb-th + .cmb-td, .cmb-type-group .cmb-th + .cmb-td {
620
- width: 80%;
621
- float: right;
622
- }
623
- /* line 70, sass/partials/_post_metaboxes.scss */
624
- .cmb2-postbox .cmb-row:not(:last-of-type),
625
- .cmb2-postbox .cmb-repeatable-group:not(:last-of-type), .cmb-type-group .cmb-row:not(:last-of-type),
626
- .cmb-type-group .cmb-repeatable-group:not(:last-of-type) {
627
- border-bottom: 1px solid #e9e9e9;
628
- }
629
- @media (max-width: 450px) {
630
- /* line 70, sass/partials/_post_metaboxes.scss */
631
- .cmb2-postbox .cmb-row:not(:last-of-type),
632
- .cmb2-postbox .cmb-repeatable-group:not(:last-of-type), .cmb-type-group .cmb-row:not(:last-of-type),
633
- .cmb-type-group .cmb-repeatable-group:not(:last-of-type) {
634
- border-bottom: 0;
635
- }
636
- }
637
- /* line 79, sass/partials/_post_metaboxes.scss */
638
- .cmb2-postbox .cmb-repeat-group-field,
639
- .cmb2-postbox .cmb-remove-field-row, .cmb-type-group .cmb-repeat-group-field,
640
- .cmb-type-group .cmb-remove-field-row {
641
- padding-top: 1.8em;
642
- }
643
-
644
- /*--------------------------------------------------------------
645
- * Context Metaboxes
646
- --------------------------------------------------------------*/
647
- /* Metabox collapse arrow indicators */
648
- /* line 8, sass/partials/_context_metaboxes.scss */
649
- .js .cmb2-postbox.context-box .handlediv {
650
- text-align: center;
651
- }
652
- /* line 13, sass/partials/_context_metaboxes.scss */
653
- .js .cmb2-postbox.context-box .toggle-indicator:before {
654
- content: "\f142";
655
- display: inline-block;
656
- font: normal 20px/1 dashicons;
657
- speak: none;
658
- -webkit-font-smoothing: antialiased;
659
- -moz-osx-font-smoothing: grayscale;
660
- text-decoration: none !important;
661
- }
662
- /* line 26, sass/partials/_context_metaboxes.scss */
663
- .js .cmb2-postbox.context-box.closed .toggle-indicator:before {
664
- content: "\f140";
665
- }
666
-
667
- /* line 34, sass/partials/_context_metaboxes.scss */
668
- .cmb2-postbox.context-box {
669
- margin-bottom: 10px;
670
- }
671
- /* line 38, sass/partials/_context_metaboxes.scss */
672
- .cmb2-postbox.context-box.context-before_permalink-box {
673
- margin-top: 10px;
674
- }
675
- /* line 42, sass/partials/_context_metaboxes.scss */
676
- .cmb2-postbox.context-box.context-after_title-box {
677
- margin-top: 10px;
678
- }
679
- /* line 46, sass/partials/_context_metaboxes.scss */
680
- .cmb2-postbox.context-box.context-after_editor-box {
681
- margin-top: 20px;
682
- margin-bottom: 0;
683
- }
684
- /* line 51, sass/partials/_context_metaboxes.scss */
685
- .cmb2-postbox.context-box.context-form_top-box {
686
- margin-top: 10px;
687
- }
688
- /* line 55, sass/partials/_context_metaboxes.scss */
689
- .cmb2-postbox.context-box.context-form_top-box .hndle {
690
- font-size: 14px;
691
- padding: 8px 12px;
692
- margin: 0;
693
- line-height: 1.4;
694
- }
695
- /* line 63, sass/partials/_context_metaboxes.scss */
696
- .cmb2-postbox.context-box .hndle {
697
- cursor: auto;
698
- }
699
-
700
- /* line 68, sass/partials/_context_metaboxes.scss */
701
- .cmb2-context-wrap {
702
- margin-top: 10px;
703
- }
704
- /* line 72, sass/partials/_context_metaboxes.scss */
705
- .cmb2-context-wrap.cmb2-context-wrap-form_top {
706
- margin-right: 300px;
707
- width: auto;
708
- }
709
- /* line 79, sass/partials/_context_metaboxes.scss */
710
- .cmb2-context-wrap.cmb2-context-wrap-no-title .cmb2-metabox {
711
- padding: 10px;
712
- }
713
- /* line 84, sass/partials/_context_metaboxes.scss */
714
- .cmb2-context-wrap .cmb-th {
715
- padding: 0 2% 0 0;
716
- width: 18%;
717
- }
718
- /* line 89, sass/partials/_context_metaboxes.scss */
719
- .cmb2-context-wrap .cmb-td {
720
- width: 80%;
721
- padding: 0;
722
- }
723
- /* line 94, sass/partials/_context_metaboxes.scss */
724
- .cmb2-context-wrap .cmb-row {
725
- margin-bottom: 10px;
726
- }
727
- /* line 97, sass/partials/_context_metaboxes.scss */
728
- .cmb2-context-wrap .cmb-row:last-of-type {
729
- margin-bottom: 0;
730
- }
731
-
732
- /* one column on the post write/edit screen */
733
- @media only screen and (max-width: 850px) {
734
- /* line 107, sass/partials/_context_metaboxes.scss */
735
- .cmb2-context-wrap.cmb2-context-wrap-form_top {
736
- margin-right: 0;
737
- }
738
- }
739
- /*--------------------------------------------------------------
740
- * Misc.
741
- --------------------------------------------------------------*/
742
- /* line 5, sass/partials/_misc.scss */
743
- #poststuff .cmb-repeatable-group h2 {
744
- margin: 0;
745
- }
746
-
747
- /* line 12, sass/partials/_misc.scss */
748
- .edit-tags-php .cmb2-metabox-title,
749
- .profile-php .cmb2-metabox-title,
750
- .user-edit-php .cmb2-metabox-title {
751
- font-size: 1.4em;
752
- }
753
-
754
- /* line 18, sass/partials/_misc.scss */
755
- .cmb2-postbox .cmb-spinner, .cmb2-no-box-wrap .cmb-spinner {
756
- float: left;
757
- display: none;
758
- }
759
-
760
- /* line 24, sass/partials/_misc.scss */
761
- .cmb-spinner {
762
- display: none;
763
- }
764
- /* line 26, sass/partials/_misc.scss */
765
- .cmb-spinner.is-active {
766
- display: block;
767
- }
768
-
769
- /*--------------------------------------------------------------
770
- * Collapsible UI
771
- --------------------------------------------------------------*/
772
- /* line 6, sass/partials/_collapsible_ui.scss */
773
- .cmb2-metabox .cmbhandle {
774
- color: #757575;
775
- float: right;
776
- width: 27px;
777
- height: 30px;
778
- cursor: pointer;
779
- right: -1em;
780
- position: relative;
781
- }
782
- /* line 14, sass/partials/_collapsible_ui.scss */
783
- .cmb2-metabox .cmbhandle:before {
784
- content: '\f142';
785
- right: 12px;
786
- font: normal 20px/1 'dashicons';
787
- speak: none;
788
- display: inline-block;
789
- padding: 8px 10px;
790
- top: 0;
791
- position: relative;
792
- -webkit-font-smoothing: antialiased;
793
- -moz-osx-font-smoothing: grayscale;
794
- text-decoration: none !important;
795
- }
796
- /* line 31, sass/partials/_collapsible_ui.scss */
797
- .cmb2-metabox .postbox.closed .cmbhandle:before {
798
- content: '\f140';
799
- }
800
- /* line 37, sass/partials/_collapsible_ui.scss */
801
- .cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row {
802
- -webkit-appearance: none !important;
803
- background: none !important;
804
- border: none !important;
805
- position: absolute;
806
- left: 0;
807
- top: .5em;
808
- line-height: 1em;
809
- padding: 2px 6px 3px;
810
- opacity: .5;
811
- }
812
- /* line 47, sass/partials/_collapsible_ui.scss */
813
- .cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]) {
814
- cursor: pointer;
815
- color: #a00;
816
- opacity: 1;
817
- }
818
- /* line 51, sass/partials/_collapsible_ui.scss */
819
- .cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]):hover {
820
- color: #f00;
821
- }
822
-
823
- /*
824
- * jQuery UI CSS Framework 1.8.16
825
- *
826
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
827
- * Dual licensed under the MIT or GPL Version 2 licenses.
828
- * http://jquery.org/license
829
- *
830
- * http://docs.jquery.com/UI/Theming/API
831
- *
832
- * WordPress Styles adopted from "jQuery UI Datepicker CSS for WordPress"
833
- * https://github.com/stuttter/wp-datepicker-styling
834
- *
835
- */
836
- /* line 15, sass/partials/_jquery_ui.scss */
837
- * html .cmb2-element.ui-helper-clearfix {
838
- height: 1%;
839
- }
840
-
841
- /* line 24, sass/partials/_jquery_ui.scss */
842
- .cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
843
- padding: 0;
844
- margin: 0;
845
- -webkit-border-radius: 0;
846
- -moz-border-radius: 0;
847
- border-radius: 0;
848
- background-color: #fff;
849
- border: 1px solid #dfdfdf;
850
- border-top: none;
851
- -webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
852
- box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
853
- min-width: 17em;
854
- width: auto;
855
- /* Default Color Scheme */
856
- }
857
- /* line 38, sass/partials/_jquery_ui.scss */
858
- .cmb2-element.ui-datepicker *, .cmb2-element .ui-datepicker * {
859
- padding: 0;
860
- font-family: "Open Sans", sans-serif;
861
- -webkit-border-radius: 0;
862
- -moz-border-radius: 0;
863
- border-radius: 0;
864
- }
865
- /* line 46, sass/partials/_jquery_ui.scss */
866
- .cmb2-element.ui-datepicker table, .cmb2-element .ui-datepicker table {
867
- font-size: 13px;
868
- margin: 0;
869
- border: none;
870
- border-collapse: collapse;
871
- }
872
- /* line 53, sass/partials/_jquery_ui.scss */
873
- .cmb2-element.ui-datepicker .ui-widget-header,
874
- .cmb2-element.ui-datepicker .ui-datepicker-header, .cmb2-element .ui-datepicker .ui-widget-header,
875
- .cmb2-element .ui-datepicker .ui-datepicker-header {
876
- background-image: none;
877
- border: none;
878
- color: #fff;
879
- font-weight: normal;
880
- }
881
- /* line 61, sass/partials/_jquery_ui.scss */
882
- .cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover, .cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover {
883
- background: transparent;
884
- border-color: transparent;
885
- cursor: pointer;
886
- }
887
- /* line 67, sass/partials/_jquery_ui.scss */
888
- .cmb2-element.ui-datepicker .ui-datepicker-title, .cmb2-element .ui-datepicker .ui-datepicker-title {
889
- margin: 0;
890
- padding: 10px 0;
891
- color: #fff;
892
- font-size: 14px;
893
- line-height: 14px;
894
- text-align: center;
895
- }
896
- /* line 75, sass/partials/_jquery_ui.scss */
897
- .cmb2-element.ui-datepicker .ui-datepicker-title select, .cmb2-element .ui-datepicker .ui-datepicker-title select {
898
- margin-top: -8px;
899
- margin-bottom: -8px;
900
- }
901
- /* line 81, sass/partials/_jquery_ui.scss */
902
- .cmb2-element.ui-datepicker .ui-datepicker-prev,
903
- .cmb2-element.ui-datepicker .ui-datepicker-next, .cmb2-element .ui-datepicker .ui-datepicker-prev,
904
- .cmb2-element .ui-datepicker .ui-datepicker-next {
905
- position: relative;
906
- top: 0;
907
- height: 34px;
908
- width: 34px;
909
- }
910
- /* line 89, sass/partials/_jquery_ui.scss */
911
- .cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-prev,
912
- .cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-next, .cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-prev,
913
- .cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-next {
914
- border: none;
915
- }
916
- /* line 94, sass/partials/_jquery_ui.scss */
917
- .cmb2-element.ui-datepicker .ui-datepicker-prev,
918
- .cmb2-element.ui-datepicker .ui-datepicker-prev-hover, .cmb2-element .ui-datepicker .ui-datepicker-prev,
919
- .cmb2-element .ui-datepicker .ui-datepicker-prev-hover {
920
- left: 0;
921
- }
922
- /* line 99, sass/partials/_jquery_ui.scss */
923
- .cmb2-element.ui-datepicker .ui-datepicker-next,
924
- .cmb2-element.ui-datepicker .ui-datepicker-next-hover, .cmb2-element .ui-datepicker .ui-datepicker-next,
925
- .cmb2-element .ui-datepicker .ui-datepicker-next-hover {
926
- right: 0;
927
- }
928
- /* line 104, sass/partials/_jquery_ui.scss */
929
- .cmb2-element.ui-datepicker .ui-datepicker-next span,
930
- .cmb2-element.ui-datepicker .ui-datepicker-prev span, .cmb2-element .ui-datepicker .ui-datepicker-next span,
931
- .cmb2-element .ui-datepicker .ui-datepicker-prev span {
932
- display: none;
933
- }
934
- /* line 109, sass/partials/_jquery_ui.scss */
935
- .cmb2-element.ui-datepicker .ui-datepicker-prev, .cmb2-element .ui-datepicker .ui-datepicker-prev {
936
- float: left;
937
- }
938
- /* line 113, sass/partials/_jquery_ui.scss */
939
- .cmb2-element.ui-datepicker .ui-datepicker-next, .cmb2-element .ui-datepicker .ui-datepicker-next {
940
- float: right;
941
- }
942
- /* line 117, sass/partials/_jquery_ui.scss */
943
- .cmb2-element.ui-datepicker .ui-datepicker-prev:before,
944
- .cmb2-element.ui-datepicker .ui-datepicker-next:before, .cmb2-element .ui-datepicker .ui-datepicker-prev:before,
945
- .cmb2-element .ui-datepicker .ui-datepicker-next:before {
946
- font: normal 20px/34px 'dashicons';
947
- padding-left: 7px;
948
- color: #fff;
949
- speak: none;
950
- -webkit-font-smoothing: antialiased;
951
- -moz-osx-font-smoothing: grayscale;
952
- width: 34px;
953
- height: 34px;
954
- }
955
- /* line 129, sass/partials/_jquery_ui.scss */
956
- .cmb2-element.ui-datepicker .ui-datepicker-prev:before, .cmb2-element .ui-datepicker .ui-datepicker-prev:before {
957
- content: '\f341';
958
- }
959
- /* line 133, sass/partials/_jquery_ui.scss */
960
- .cmb2-element.ui-datepicker .ui-datepicker-next:before, .cmb2-element .ui-datepicker .ui-datepicker-next:before {
961
- content: '\f345';
962
- }
963
- /* line 137, sass/partials/_jquery_ui.scss */
964
- .cmb2-element.ui-datepicker .ui-datepicker-prev-hover:before,
965
- .cmb2-element.ui-datepicker .ui-datepicker-next-hover:before, .cmb2-element .ui-datepicker .ui-datepicker-prev-hover:before,
966
- .cmb2-element .ui-datepicker .ui-datepicker-next-hover:before {
967
- opacity: 0.7;
968
- }
969
- /* line 142, sass/partials/_jquery_ui.scss */
970
- .cmb2-element.ui-datepicker select.ui-datepicker-month,
971
- .cmb2-element.ui-datepicker select.ui-datepicker-year, .cmb2-element .ui-datepicker select.ui-datepicker-month,
972
- .cmb2-element .ui-datepicker select.ui-datepicker-year {
973
- width: 33%;
974
- background: transparent;
975
- border-color: transparent;
976
- box-shadow: none;
977
- color: #fff;
978
- }
979
- /* line 149, sass/partials/_jquery_ui.scss */
980
- .cmb2-element.ui-datepicker select.ui-datepicker-month option,
981
- .cmb2-element.ui-datepicker select.ui-datepicker-year option, .cmb2-element .ui-datepicker select.ui-datepicker-month option,
982
- .cmb2-element .ui-datepicker select.ui-datepicker-year option {
983
- color: #333;
984
- }
985
- /* line 154, sass/partials/_jquery_ui.scss */
986
- .cmb2-element.ui-datepicker thead, .cmb2-element .ui-datepicker thead {
987
- color: #fff;
988
- font-weight: 600;
989
- }
990
- /* line 157, sass/partials/_jquery_ui.scss */
991
- .cmb2-element.ui-datepicker thead th, .cmb2-element .ui-datepicker thead th {
992
- font-weight: normal;
993
- }
994
- /* line 162, sass/partials/_jquery_ui.scss */
995
- .cmb2-element.ui-datepicker th, .cmb2-element .ui-datepicker th {
996
- padding: 10px;
997
- }
998
- /* line 166, sass/partials/_jquery_ui.scss */
999
- .cmb2-element.ui-datepicker td, .cmb2-element .ui-datepicker td {
1000
- padding: 0;
1001
- border: 1px solid #f4f4f4;
1002
- }
1003
- /* line 171, sass/partials/_jquery_ui.scss */
1004
- .cmb2-element.ui-datepicker td.ui-datepicker-other-month, .cmb2-element .ui-datepicker td.ui-datepicker-other-month {
1005
- border: transparent;
1006
- }
1007
- /* line 175, sass/partials/_jquery_ui.scss */
1008
- .cmb2-element.ui-datepicker td.ui-datepicker-week-end, .cmb2-element .ui-datepicker td.ui-datepicker-week-end {
1009
- background-color: #f4f4f4;
1010
- border: 1px solid #f4f4f4;
1011
- }
1012
- /* line 178, sass/partials/_jquery_ui.scss */
1013
- .cmb2-element.ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today, .cmb2-element .ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today {
1014
- -webkit-box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
1015
- -moz-box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
1016
- box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
1017
- }
1018
- /* line 185, sass/partials/_jquery_ui.scss */
1019
- .cmb2-element.ui-datepicker td.ui-datepicker-today, .cmb2-element .ui-datepicker td.ui-datepicker-today {
1020
- background-color: #f0f0c0;
1021
- }
1022
- /* line 189, sass/partials/_jquery_ui.scss */
1023
- .cmb2-element.ui-datepicker td.ui-datepicker-current-day, .cmb2-element .ui-datepicker td.ui-datepicker-current-day {
1024
- background: #bbdd88;
1025
- }
1026
- /* line 193, sass/partials/_jquery_ui.scss */
1027
- .cmb2-element.ui-datepicker td .ui-state-default, .cmb2-element .ui-datepicker td .ui-state-default {
1028
- background: transparent;
1029
- border: none;
1030
- text-align: center;
1031
- text-decoration: none;
1032
- width: auto;
1033
- display: block;
1034
- padding: 5px 10px;
1035
- font-weight: normal;
1036
- color: #444;
1037
- }
1038
- /* line 205, sass/partials/_jquery_ui.scss */
1039
- .cmb2-element.ui-datepicker td.ui-state-disabled .ui-state-default, .cmb2-element .ui-datepicker td.ui-state-disabled .ui-state-default {
1040
- opacity: 0.5;
1041
- }
1042
- /* line 210, sass/partials/_jquery_ui.scss */
1043
- .cmb2-element.ui-datepicker .ui-widget-header,
1044
- .cmb2-element.ui-datepicker .ui-datepicker-header, .cmb2-element .ui-datepicker .ui-widget-header,
1045
- .cmb2-element .ui-datepicker .ui-datepicker-header {
1046
- background: #00a0d2;
1047
- }
1048
- /* line 215, sass/partials/_jquery_ui.scss */
1049
- .cmb2-element.ui-datepicker thead, .cmb2-element .ui-datepicker thead {
1050
- background: #32373c;
1051
- }
1052
- /* line 219, sass/partials/_jquery_ui.scss */
1053
- .cmb2-element.ui-datepicker td .ui-state-hover, .cmb2-element.ui-datepicker td .ui-state-active, .cmb2-element .ui-datepicker td .ui-state-hover, .cmb2-element .ui-datepicker td .ui-state-active {
1054
- background: #0073aa;
1055
- color: #fff;
1056
- }
1057
- /* line 224, sass/partials/_jquery_ui.scss */
1058
- .cmb2-element.ui-datepicker .ui-timepicker-div, .cmb2-element .ui-datepicker .ui-timepicker-div {
1059
- font-size: 14px;
1060
- }
1061
- /* line 226, sass/partials/_jquery_ui.scss */
1062
- .cmb2-element.ui-datepicker .ui-timepicker-div dl, .cmb2-element .ui-datepicker .ui-timepicker-div dl {
1063
- text-align: left;
1064
- padding: 0 .6em;
1065
- }
1066
- /* line 229, sass/partials/_jquery_ui.scss */
1067
- .cmb2-element.ui-datepicker .ui-timepicker-div dl dt, .cmb2-element .ui-datepicker .ui-timepicker-div dl dt {
1068
- float: left;
1069
- clear: left;
1070
- padding: 0 0 0 5px;
1071
- }
1072
- /* line 234, sass/partials/_jquery_ui.scss */
1073
- .cmb2-element.ui-datepicker .ui-timepicker-div dl dd, .cmb2-element .ui-datepicker .ui-timepicker-div dl dd {
1074
- margin: 0 10px 10px 40%;
1075
- }
1076
- /* line 236, sass/partials/_jquery_ui.scss */
1077
- .cmb2-element.ui-datepicker .ui-timepicker-div dl dd select, .cmb2-element .ui-datepicker .ui-timepicker-div dl dd select {
1078
- width: 100%;
1079
- }
1080
- /* line 242, sass/partials/_jquery_ui.scss */
1081
- .cmb2-element.ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane, .cmb2-element .ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane {
1082
- padding: .6em;
1083
- text-align: left;
1084
- }
1085
- /* line 246, sass/partials/_jquery_ui.scss */
1086
- .cmb2-element.ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-primary, .cmb2-element.ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-secondary, .cmb2-element .ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-primary, .cmb2-element .ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-secondary {
1087
- padding: 0 10px 1px;
1088
- -webkit-border-radius: 3px;
1089
- -moz-border-radius: 3px;
1090
- border-radius: 3px;
1091
- margin: 0 .6em .4em .4em;
1092
- }
1093
-
1094
- /* line 260, sass/partials/_jquery_ui.scss */
1095
- .admin-color-fresh .cmb2-element.ui-datepicker .ui-widget-header,
1096
- .admin-color-fresh .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-fresh .cmb2-element .ui-datepicker .ui-widget-header,
1097
- .admin-color-fresh .cmb2-element .ui-datepicker .ui-datepicker-header {
1098
- background: #00a0d2;
1099
- }
1100
- /* line 265, sass/partials/_jquery_ui.scss */
1101
- .admin-color-fresh .cmb2-element.ui-datepicker thead, .admin-color-fresh .cmb2-element .ui-datepicker thead {
1102
- background: #32373c;
1103
- }
1104
- /* line 269, sass/partials/_jquery_ui.scss */
1105
- .admin-color-fresh .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-fresh .cmb2-element .ui-datepicker td .ui-state-hover {
1106
- background: #0073aa;
1107
- color: #fff;
1108
- }
1109
-
1110
- /* line 277, sass/partials/_jquery_ui.scss */
1111
- .admin-color-blue .cmb2-element.ui-datepicker .ui-widget-header,
1112
- .admin-color-blue .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-blue .cmb2-element .ui-datepicker .ui-widget-header,
1113
- .admin-color-blue .cmb2-element .ui-datepicker .ui-datepicker-header {
1114
- background: #52accc;
1115
- }
1116
- /* line 282, sass/partials/_jquery_ui.scss */
1117
- .admin-color-blue .cmb2-element.ui-datepicker thead, .admin-color-blue .cmb2-element .ui-datepicker thead {
1118
- background: #4796b3;
1119
- }
1120
- /* line 291, sass/partials/_jquery_ui.scss */
1121
- .admin-color-blue .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-blue .cmb2-element.ui-datepicker td .ui-state-active, .admin-color-blue .cmb2-element .ui-datepicker td .ui-state-hover, .admin-color-blue .cmb2-element .ui-datepicker td .ui-state-active {
1122
- background: #096484;
1123
- color: #fff;
1124
- }
1125
- /* line 296, sass/partials/_jquery_ui.scss */
1126
- .admin-color-blue .cmb2-element.ui-datepicker td.ui-datepicker-today, .admin-color-blue .cmb2-element .ui-datepicker td.ui-datepicker-today {
1127
- background: #eee;
1128
- }
1129
-
1130
- /* line 305, sass/partials/_jquery_ui.scss */
1131
- .admin-color-coffee .cmb2-element.ui-datepicker .ui-widget-header,
1132
- .admin-color-coffee .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-coffee .cmb2-element .ui-datepicker .ui-widget-header,
1133
- .admin-color-coffee .cmb2-element .ui-datepicker .ui-datepicker-header {
1134
- background: #59524c;
1135
- }
1136
- /* line 310, sass/partials/_jquery_ui.scss */
1137
- .admin-color-coffee .cmb2-element.ui-datepicker thead, .admin-color-coffee .cmb2-element .ui-datepicker thead {
1138
- background: #46403c;
1139
- }
1140
- /* line 314, sass/partials/_jquery_ui.scss */
1141
- .admin-color-coffee .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-coffee .cmb2-element .ui-datepicker td .ui-state-hover {
1142
- background: #c7a589;
1143
- color: #fff;
1144
- }
1145
-
1146
- /* line 322, sass/partials/_jquery_ui.scss */
1147
- .admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-widget-header,
1148
- .admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-widget-header,
1149
- .admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-datepicker-header {
1150
- background: #523f6d;
1151
- }
1152
- /* line 327, sass/partials/_jquery_ui.scss */
1153
- .admin-color-ectoplasm .cmb2-element.ui-datepicker thead, .admin-color-ectoplasm .cmb2-element .ui-datepicker thead {
1154
- background: #413256;
1155
- }
1156
- /* line 331, sass/partials/_jquery_ui.scss */
1157
- .admin-color-ectoplasm .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-ectoplasm .cmb2-element .ui-datepicker td .ui-state-hover {
1158
- background: #a3b745;
1159
- color: #fff;
1160
- }
1161
-
1162
- /* line 339, sass/partials/_jquery_ui.scss */
1163
- .admin-color-midnight .cmb2-element.ui-datepicker .ui-widget-header,
1164
- .admin-color-midnight .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-midnight .cmb2-element .ui-datepicker .ui-widget-header,
1165
- .admin-color-midnight .cmb2-element .ui-datepicker .ui-datepicker-header {
1166
- background: #363b3f;
1167
- }
1168
- /* line 344, sass/partials/_jquery_ui.scss */
1169
- .admin-color-midnight .cmb2-element.ui-datepicker thead, .admin-color-midnight .cmb2-element .ui-datepicker thead {
1170
- background: #26292c;
1171
- }
1172
- /* line 348, sass/partials/_jquery_ui.scss */
1173
- .admin-color-midnight .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-midnight .cmb2-element .ui-datepicker td .ui-state-hover {
1174
- background: #e14d43;
1175
- color: #fff;
1176
- }
1177
-
1178
- /* line 356, sass/partials/_jquery_ui.scss */
1179
- .admin-color-ocean .cmb2-element.ui-datepicker .ui-widget-header,
1180
- .admin-color-ocean .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-ocean .cmb2-element .ui-datepicker .ui-widget-header,
1181
- .admin-color-ocean .cmb2-element .ui-datepicker .ui-datepicker-header {
1182
- background: #738e96;
1183
- }
1184
- /* line 361, sass/partials/_jquery_ui.scss */
1185
- .admin-color-ocean .cmb2-element.ui-datepicker thead, .admin-color-ocean .cmb2-element .ui-datepicker thead {
1186
- background: #627c83;
1187
- }
1188
- /* line 365, sass/partials/_jquery_ui.scss */
1189
- .admin-color-ocean .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-ocean .cmb2-element .ui-datepicker td .ui-state-hover {
1190
- background: #9ebaa0;
1191
- color: #fff;
1192
- }
1193
-
1194
- /* line 373, sass/partials/_jquery_ui.scss */
1195
- .admin-color-sunrise .cmb2-element.ui-datepicker .ui-widget-header,
1196
- .admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header,
1197
- .admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover, .admin-color-sunrise .cmb2-element .ui-datepicker .ui-widget-header,
1198
- .admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header,
1199
- .admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover {
1200
- background: #cf4944;
1201
- }
1202
- /* line 379, sass/partials/_jquery_ui.scss */
1203
- .admin-color-sunrise .cmb2-element.ui-datepicker th, .admin-color-sunrise .cmb2-element .ui-datepicker th {
1204
- border-color: #be3631;
1205
- background: #be3631;
1206
- }
1207
- /* line 384, sass/partials/_jquery_ui.scss */
1208
- .admin-color-sunrise .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-sunrise .cmb2-element .ui-datepicker td .ui-state-hover {
1209
- background: #dd823b;
1210
- color: #fff;
1211
- }
1212
-
1213
- /* line 392, sass/partials/_jquery_ui.scss */
1214
- .admin-color-light .cmb2-element.ui-datepicker .ui-widget-header,
1215
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-light .cmb2-element .ui-datepicker .ui-widget-header,
1216
- .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-header {
1217
- background: #e5e5e5;
1218
- }
1219
- /* line 397, sass/partials/_jquery_ui.scss */
1220
- .admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-month,
1221
- .admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-year, .admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-month,
1222
- .admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-year {
1223
- color: #555;
1224
- }
1225
- /* line 402, sass/partials/_jquery_ui.scss */
1226
- .admin-color-light .cmb2-element.ui-datepicker thead, .admin-color-light .cmb2-element .ui-datepicker thead {
1227
- background: #888;
1228
- }
1229
- /* line 406, sass/partials/_jquery_ui.scss */
1230
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-title,
1231
- .admin-color-light .cmb2-element.ui-datepicker td .ui-state-default,
1232
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-prev:before,
1233
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-next:before, .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-title,
1234
- .admin-color-light .cmb2-element .ui-datepicker td .ui-state-default,
1235
- .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-prev:before,
1236
- .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-next:before {
1237
- color: #555;
1238
- }
1239
- /* line 414, sass/partials/_jquery_ui.scss */
1240
- .admin-color-light .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-light .cmb2-element.ui-datepicker td .ui-state-active, .admin-color-light .cmb2-element .ui-datepicker td .ui-state-hover, .admin-color-light .cmb2-element .ui-datepicker td .ui-state-active {
1241
- background: #ccc;
1242
- }
1243
- /* line 418, sass/partials/_jquery_ui.scss */
1244
- .admin-color-light .cmb2-element.ui-datepicker td.ui-datepicker-today, .admin-color-light .cmb2-element .ui-datepicker td.ui-datepicker-today {
1245
- background: #eee;
1246
- }
1247
-
1248
- /* line 426, sass/partials/_jquery_ui.scss */
1249
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-widget-header,
1250
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-widget-header,
1251
- .admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-datepicker-header {
1252
- background: #56b274;
1253
- }
1254
- /* line 431, sass/partials/_jquery_ui.scss */
1255
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker thead, .admin-color-bbp-evergreen .cmb2-element .ui-datepicker thead {
1256
- background: #36533f;
1257
- }
1258
- /* line 435, sass/partials/_jquery_ui.scss */
1259
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-bbp-evergreen .cmb2-element .ui-datepicker td .ui-state-hover {
1260
- background: #446950;
1261
- color: #fff;
1262
- }
1263
-
1264
- /* line 443, sass/partials/_jquery_ui.scss */
1265
- .admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-widget-header,
1266
- .admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-widget-header,
1267
- .admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-datepicker-header {
1268
- background: #4ca26a;
1269
- }
1270
- /* line 448, sass/partials/_jquery_ui.scss */
1271
- .admin-color-bbp-mint .cmb2-element.ui-datepicker thead, .admin-color-bbp-mint .cmb2-element .ui-datepicker thead {
1272
- background: #4f6d59;
1273
- }
1274
- /* line 452, sass/partials/_jquery_ui.scss */
1275
- .admin-color-bbp-mint .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-bbp-mint .cmb2-element .ui-datepicker td .ui-state-hover {
1276
- background: #5fb37c;
1277
- color: #fff;
1278
- }
1279
-
1280
- /*--------------------------------------------------------------
1281
- * Character counter
1282
- --------------------------------------------------------------*/
1283
- /* line 5, sass/partials/_char_counter.scss */
1284
- .cmb2-char-counter-wrap {
1285
- margin: .5em 0 1em;
1286
- }
1287
- /* line 8, sass/partials/_char_counter.scss */
1288
- .cmb2-char-counter-wrap input[type="text"] {
1289
- font-size: 12px;
1290
- width: 25px;
1291
- }
1292
- /* line 14, sass/partials/_char_counter.scss */
1293
- .cmb2-char-counter-wrap.cmb2-max-exceeded input[type="text"] {
1294
- border-color: #a00 !important;
1295
- }
1296
- /* line 17, sass/partials/_char_counter.scss */
1297
- .cmb2-char-counter-wrap.cmb2-max-exceeded .cmb2-char-max-msg {
1298
- display: inline-block;
1299
- }
1300
-
1301
- /* line 23, sass/partials/_char_counter.scss */
1302
- .cmb2-char-max-msg {
1303
- color: #a00;
1304
- display: none;
1305
- font-weight: 600;
1306
- margin-left: 1em;
1307
- }
1308
-
1309
- /**
1310
- * CMB2 Frontend
1311
- */
1312
- /*--------------------------------------------------------------
1313
- * CMB2 Frontend
1314
- --------------------------------------------------------------*/
1315
- /* line 5, sass/partials/_front.scss */
1316
- .closed .inside {
1317
- display: none;
1318
- }
1319
-
1320
- /* line 9, sass/partials/_front.scss */
1321
- .cmb-repeatable-grouping {
1322
- position: relative;
1323
- }
1324
- /* line 12, sass/partials/_front.scss */
1325
- .cmb-repeatable-grouping .cmb-group-title {
1326
- margin-left: -1em;
1327
- margin-right: -1em;
1328
- min-height: 1.5em;
1329
- }
1330
- /* line 18, sass/partials/_front.scss */
1331
- .cmb-repeatable-grouping h3 {
1332
- font-size: 14px;
1333
- padding: 8px 12px;
1334
- margin: 0;
1335
- line-height: 1.4;
1336
- }
1337
-
1338
- /* line 29, sass/partials/_front.scss */
1339
- .cmb-repeatable-group.repeatable .cmb-group-title {
1340
- padding-left: 2.2em;
1341
- }
1342
- /* line 33, sass/partials/_front.scss */
1343
- .cmb-repeatable-group.non-repeatable .cmb-group-title {
1344
- padding-left: 12px;
1345
- }
1346
-
1347
- /* line 39, sass/partials/_front.scss */
1348
- .cmb-type-group .cmb-row .cmbhandle {
1349
- right: 0;
1350
- position: absolute;
1351
- }
1352
-
1353
- /* line 44, sass/partials/_front.scss */
1354
- .cmb-spinner {
1355
- background: url(/wp-admin/images/spinner.gif) no-repeat;
1356
- -webkit-background-size: 20px 20px;
1357
- background-size: 20px 20px;
1358
- display: none;
1359
- float: right;
1360
- vertical-align: middle;
1361
- opacity: 0.7;
1362
- filter: alpha(opacity=70);
1363
- width: 20px;
1364
- height: 20px;
1365
- margin: 4px 10px 0;
1366
- }
1367
-
1368
- /* line 58, sass/partials/_front.scss */
1369
- .cmb2-char-max-msg {
1370
- display: none;
1371
- }
1372
-
1373
- /*# sourceMappingURL=cmb2-front.css.map */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/css/cmb2-front.min.css DELETED
@@ -1 +0,0 @@
1
- @charset "UTF-8";.cmb2-wrap{margin:0}.cmb2-wrap input,.cmb2-wrap textarea{max-width:100%}.cmb2-wrap input[type=text].cmb2-oembed{width:100%}.cmb2-wrap textarea{width:500px;padding:8px}.cmb2-wrap textarea.cmb2-textarea-code{font-family:"Courier 10 Pitch",Courier,monospace;line-height:16px}.cmb2-wrap input.cmb2-text-small,.cmb2-wrap input.cmb2-timepicker{width:100px}.cmb2-wrap input.cmb2-text-money{width:90px}.cmb2-wrap input.cmb2-text-medium{width:230px}.cmb2-wrap input.cmb2-upload-file{width:65%}.cmb2-wrap input.ed_button{padding:2px 4px}.cmb2-wrap input:not([type=hidden])+.button-secondary,.cmb2-wrap input:not([type=hidden])+input,.cmb2-wrap input:not([type=hidden])+select{margin-left:20px}.cmb2-wrap ul{margin:0}.cmb2-wrap li{font-size:14px;line-height:16px;margin:1px 0 5px 0}.cmb2-wrap select{font-size:14px;margin-top:3px}.cmb2-wrap input:focus,.cmb2-wrap textarea:focus{background:#fffff8}.cmb2-wrap input[type=radio]{margin:0 5px 0 0;padding:0}.cmb2-wrap input[type=checkbox]{margin:0 5px 0 0;padding:0}.cmb2-wrap .button-secondary,.cmb2-wrap button{white-space:nowrap}.cmb2-wrap .mceLayout{border:1px solid #e9e9e9!important}.cmb2-wrap .mceIframeContainer{background:#fff}.cmb2-wrap .meta_mce{width:97%}.cmb2-wrap .meta_mce textarea{width:100%}.cmb2-wrap .cmb-multicheck-toggle{margin-top:-1em}.cmb2-wrap .wp-picker-clear.button,.cmb2-wrap .wp-picker-default.button{margin-left:6px;padding:2px 8px}.cmb2-wrap .cmb-row{margin:0}.cmb2-wrap .cmb-row:after{content:'';clear:both;display:block;width:100%}.cmb2-wrap .cmb-row.cmb-repeat .cmb2-metabox-description{padding-top:0;padding-bottom:1em}body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type=radio]::before{margin:.1875rem}@media screen and (max-width:782px){body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type=radio]::before{margin:.4375rem}}.cmb2-metabox{clear:both;margin:0}.cmb2-metabox .cmb-field-list>.cmb-row:first-of-type>.cmb-td,.cmb2-metabox .cmb-field-list>.cmb-row:first-of-type>.cmb-th,.cmb2-metabox>.cmb-row:first-of-type>.cmb-td,.cmb2-metabox>.cmb-row:first-of-type>.cmb-th{border:0}.cmb-add-row{margin:1.8em 0 0}.cmb-nested .cmb-td,.cmb-repeatable-group .cmb-th,.cmb-repeatable-group:first-of-type{border:0}.cmb-repeatable-group:last-of-type,.cmb-row:last-of-type,.cmb2-wrap .cmb-row:last-of-type{border-bottom:0}.cmb-repeatable-grouping{border:1px solid #e9e9e9;padding:0 1em}.cmb-repeatable-grouping.cmb-row{margin:0 0 .8em}.cmb-th{color:#222;float:left;font-weight:600;padding:20px 10px 20px 0;vertical-align:top;width:200px}@media (max-width:450px){.cmb-th{font-size:1.2em;display:block;float:none;padding-bottom:1em;text-align:left;width:100%}.cmb-th label{display:block;margin-top:0;margin-bottom:.5em}}.cmb-td{line-height:1.3;max-width:100%;padding:15px 10px;vertical-align:middle}.cmb-type-title .cmb-td{padding:0}.cmb-th label{display:block;padding:5px 0}.cmb-th+.cmb-td{float:left}.cmb-td .cmb-td{padding-bottom:1em}.cmb-remove-row{text-align:right}.empty-row.hidden{display:none}.cmb-repeat-table{background-color:#fafafa;border:1px solid #e1e1e1}.cmb-repeat-table .cmb-row.cmb-repeat-row{position:relative;counter-increment:el;margin:0;padding:10px 10px 10px 50px;border-bottom:none!important}.cmb-repeat-table .cmb-row.cmb-repeat-row+.cmb-repeat-row{border-top:solid 1px #e9e9e9}.cmb-repeat-table .cmb-row.cmb-repeat-row.ui-sortable-helper{outline:dashed 2px #e9e9e9!important}.cmb-repeat-table .cmb-row.cmb-repeat-row:before{content:counter(el);display:block;top:0;left:0;position:absolute;width:35px;height:100%;line-height:35px;cursor:move;color:#757575;text-align:center;border-right:solid 1px #e9e9e9}.cmb-repeat-table .cmb-row.cmb-repeat-row .cmb-td{margin:0;padding:0}.cmb-repeat-table+.cmb-add-row{margin:0}.cmb-repeat-table+.cmb-add-row:before{content:'';width:1px;height:1.6em;display:block;margin-left:17px;background-color:#dcdcdc}.cmb-repeat-table .cmb-remove-row{top:7px;right:7px;position:absolute;width:auto;margin-left:0;padding:0!important;display:none}.cmb-repeat-table .cmb-remove-row>.cmb-remove-row-button{font-size:20px;text-indent:-1000px;overflow:hidden;position:relative;height:auto;line-height:1;padding:0 10px 0}.cmb-repeat-table .cmb-remove-row>.cmb-remove-row-button:before{content:"";font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center}.cmb-repeat-table .cmb-repeat-row:hover .cmb-remove-row{display:block}.cmb-repeatable-group .cmb-th{padding:5px}.cmb-repeatable-group .cmb-group-title{background-color:#e9e9e9;padding:8px 12px 8px 2.2em;margin:0 -1em;min-height:1.5em;font-size:14px;line-height:1.4}.cmb-repeatable-group .cmb-group-title h4{border:0;margin:0;font-size:1.2em;font-weight:500;padding:.5em .75em}.cmb-repeatable-group .cmb-group-title .cmb-th{display:block;width:100%}.cmb-repeatable-group .cmb-group-description .cmb-th{font-size:1.2em;display:block;float:none;padding-bottom:1em;text-align:left;width:100%}.cmb-repeatable-group .cmb-group-description .cmb-th label{display:block;margin-top:0;margin-bottom:.5em}.cmb-repeatable-group .cmb-shift-rows{margin-right:1em}.cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-up-alt2{margin-top:.15em}.cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-down-alt2{margin-top:.2em}.cmb-repeatable-group .cmb2-upload-button{float:right}p.cmb2-metabox-description{color:#666;letter-spacing:.01em;margin:0;padding-top:.5em}span.cmb2-metabox-description{color:#666;letter-spacing:.01em}.cmb2-metabox-title{margin:0 0 5px 0;padding:5px 0 0 0;font-size:14px}.cmb-inline ul{padding:4px 0 0 0}.cmb-inline li{display:inline-block;padding-right:18px}.cmb-type-textarea-code pre{margin:0}.cmb2-media-status .img-status{clear:none;display:inline-block;vertical-align:middle;margin-right:10px;width:auto}.cmb2-media-status .img-status img{max-width:350px;height:auto}.cmb2-media-status .embed-status,.cmb2-media-status .img-status img{background:#eee;border:5px solid #fff;outline:1px solid #e9e9e9;box-shadow:inset 0 0 15px rgba(0,0,0,.3),inset 0 0 0 1px rgba(0,0,0,.05);background-image:linear-gradient(45deg,#d0d0d0 25%,transparent 25%,transparent 75%,#d0d0d0 75%,#d0d0d0),linear-gradient(45deg,#d0d0d0 25%,transparent 25%,transparent 75%,#d0d0d0 75%,#d0d0d0);background-position:0 0,10px 10px;background-size:20px 20px;border-radius:2px;-moz-border-radius:2px;margin:15px 0 0 0}.cmb2-media-status .embed-status{float:left;max-width:800px}.cmb2-media-status .embed-status,.cmb2-media-status .img-status{position:relative}.cmb2-media-status .embed-status .cmb2-remove-file-button,.cmb2-media-status .img-status .cmb2-remove-file-button{background:url(../images/ico-delete.png);height:16px;left:-5px;position:absolute;text-indent:-9999px;top:-5px;width:16px}.cmb2-media-status .img-status .cmb2-remove-file-button{top:10px}.cmb2-media-status .file-status>span,.cmb2-media-status .img-status img{cursor:pointer}.cmb2-media-status.cmb-attach-list .file-status>span,.cmb2-media-status.cmb-attach-list .img-status img{cursor:move}.cmb-type-file-list .cmb2-media-status .img-status{clear:none;vertical-align:middle;width:auto;margin-right:10px;margin-bottom:10px;margin-top:0}.cmb-attach-list li{clear:both;display:inline-block;width:100%;margin-top:5px;margin-bottom:10px}.cmb-attach-list li img{float:left;margin-right:10px}.cmb2-remove-wrapper{margin:0}.child-cmb2 .cmb-th{text-align:left}.cmb2-indented-hierarchy{padding-left:1.5em}@media (max-width:450px){.cmb-td,.cmb-th,.cmb-th+.cmb-td{display:block;float:none;width:100%}}#poststuff .cmb-group-title{margin-left:-1em;margin-right:-1em;min-height:1.5em}#poststuff .repeatable .cmb-group-title{padding-left:2.2em}.cmb-type-group .cmb2-wrap,.cmb2-postbox .cmb2-wrap{margin:0}.cmb-type-group .cmb2-wrap>.cmb-field-list>.cmb-row,.cmb2-postbox .cmb2-wrap>.cmb-field-list>.cmb-row{padding:1.8em 0}.cmb-type-group .cmb2-wrap input[type=text].cmb2-oembed,.cmb2-postbox .cmb2-wrap input[type=text].cmb2-oembed{width:100%}.cmb-type-group .cmb-row,.cmb2-postbox .cmb-row{padding:0 0 1.8em;margin:0 0 .8em}.cmb-type-group .cmb-row .cmbhandle,.cmb2-postbox .cmb-row .cmbhandle{right:-1em;position:relative;color:#222}.cmb-type-group .cmb-repeatable-grouping,.cmb2-postbox .cmb-repeatable-grouping{padding:0 1em;max-width:100%;min-width:1px!important}.cmb-type-group .cmb-repeatable-group>.cmb-row,.cmb2-postbox .cmb-repeatable-group>.cmb-row{padding-bottom:0}.cmb-type-group .cmb-th,.cmb2-postbox .cmb-th{width:18%;padding:0 2% 0 0}.cmb-type-group .cmb-td,.cmb2-postbox .cmb-td{margin-bottom:0;padding:0;line-height:1.3}.cmb-type-group .cmb-th+.cmb-td,.cmb2-postbox .cmb-th+.cmb-td{width:80%;float:right}.cmb-type-group .cmb-repeatable-group:not(:last-of-type),.cmb-type-group .cmb-row:not(:last-of-type),.cmb2-postbox .cmb-repeatable-group:not(:last-of-type),.cmb2-postbox .cmb-row:not(:last-of-type){border-bottom:1px solid #e9e9e9}@media (max-width:450px){.cmb-type-group .cmb-repeatable-group:not(:last-of-type),.cmb-type-group .cmb-row:not(:last-of-type),.cmb2-postbox .cmb-repeatable-group:not(:last-of-type),.cmb2-postbox .cmb-row:not(:last-of-type){border-bottom:0}}.cmb-type-group .cmb-remove-field-row,.cmb-type-group .cmb-repeat-group-field,.cmb2-postbox .cmb-remove-field-row,.cmb2-postbox .cmb-repeat-group-field{padding-top:1.8em}.js .cmb2-postbox.context-box .handlediv{text-align:center}.js .cmb2-postbox.context-box .toggle-indicator:before{content:"\f142";display:inline-block;font:normal 20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.js .cmb2-postbox.context-box.closed .toggle-indicator:before{content:"\f140"}.cmb2-postbox.context-box{margin-bottom:10px}.cmb2-postbox.context-box.context-before_permalink-box{margin-top:10px}.cmb2-postbox.context-box.context-after_title-box{margin-top:10px}.cmb2-postbox.context-box.context-after_editor-box{margin-top:20px;margin-bottom:0}.cmb2-postbox.context-box.context-form_top-box{margin-top:10px}.cmb2-postbox.context-box.context-form_top-box .hndle{font-size:14px;padding:8px 12px;margin:0;line-height:1.4}.cmb2-postbox.context-box .hndle{cursor:auto}.cmb2-context-wrap{margin-top:10px}.cmb2-context-wrap.cmb2-context-wrap-form_top{margin-right:300px;width:auto}.cmb2-context-wrap.cmb2-context-wrap-no-title .cmb2-metabox{padding:10px}.cmb2-context-wrap .cmb-th{padding:0 2% 0 0;width:18%}.cmb2-context-wrap .cmb-td{width:80%;padding:0}.cmb2-context-wrap .cmb-row{margin-bottom:10px}.cmb2-context-wrap .cmb-row:last-of-type{margin-bottom:0}@media only screen and (max-width:850px){.cmb2-context-wrap.cmb2-context-wrap-form_top{margin-right:0}}#poststuff .cmb-repeatable-group h2{margin:0}.edit-tags-php .cmb2-metabox-title,.profile-php .cmb2-metabox-title,.user-edit-php .cmb2-metabox-title{font-size:1.4em}.cmb2-no-box-wrap .cmb-spinner,.cmb2-postbox .cmb-spinner{float:left;display:none}.cmb-spinner{display:none}.cmb-spinner.is-active{display:block}.cmb2-metabox .cmbhandle{color:#757575;float:right;width:27px;height:30px;cursor:pointer;right:-1em;position:relative}.cmb2-metabox .cmbhandle:before{content:'\f142';right:12px;font:normal 20px/1 dashicons;speak:none;display:inline-block;padding:8px 10px;top:0;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.cmb2-metabox .postbox.closed .cmbhandle:before{content:'\f140'}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row{-webkit-appearance:none!important;background:0 0!important;border:none!important;position:absolute;left:0;top:.5em;line-height:1em;padding:2px 6px 3px;opacity:.5}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]){cursor:pointer;color:#a00;opacity:1}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]):hover{color:red}* html .cmb2-element.ui-helper-clearfix{height:1%}.cmb2-element .ui-datepicker,.cmb2-element.ui-datepicker{padding:0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;background-color:#fff;border:1px solid #dfdfdf;border-top:none;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.075);box-shadow:0 3px 6px rgba(0,0,0,.075);min-width:17em;width:auto}.cmb2-element .ui-datepicker *,.cmb2-element.ui-datepicker *{padding:0;font-family:"Open Sans",sans-serif;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.cmb2-element .ui-datepicker table,.cmb2-element.ui-datepicker table{font-size:13px;margin:0;border:none;border-collapse:collapse}.cmb2-element .ui-datepicker .ui-datepicker-header,.cmb2-element .ui-datepicker .ui-widget-header,.cmb2-element.ui-datepicker .ui-datepicker-header,.cmb2-element.ui-datepicker .ui-widget-header{background-image:none;border:none;color:#fff;font-weight:400}.cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover,.cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover{background:0 0;border-color:transparent;cursor:pointer}.cmb2-element .ui-datepicker .ui-datepicker-title,.cmb2-element.ui-datepicker .ui-datepicker-title{margin:0;padding:10px 0;color:#fff;font-size:14px;line-height:14px;text-align:center}.cmb2-element .ui-datepicker .ui-datepicker-title select,.cmb2-element.ui-datepicker .ui-datepicker-title select{margin-top:-8px;margin-bottom:-8px}.cmb2-element .ui-datepicker .ui-datepicker-next,.cmb2-element .ui-datepicker .ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-datepicker-next,.cmb2-element.ui-datepicker .ui-datepicker-prev{position:relative;top:0;height:34px;width:34px}.cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-next,.cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-next,.cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-prev{border:none}.cmb2-element .ui-datepicker .ui-datepicker-prev,.cmb2-element .ui-datepicker .ui-datepicker-prev-hover,.cmb2-element.ui-datepicker .ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-datepicker-prev-hover{left:0}.cmb2-element .ui-datepicker .ui-datepicker-next,.cmb2-element .ui-datepicker .ui-datepicker-next-hover,.cmb2-element.ui-datepicker .ui-datepicker-next,.cmb2-element.ui-datepicker .ui-datepicker-next-hover{right:0}.cmb2-element .ui-datepicker .ui-datepicker-next span,.cmb2-element .ui-datepicker .ui-datepicker-prev span,.cmb2-element.ui-datepicker .ui-datepicker-next span,.cmb2-element.ui-datepicker .ui-datepicker-prev span{display:none}.cmb2-element .ui-datepicker .ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-datepicker-prev{float:left}.cmb2-element .ui-datepicker .ui-datepicker-next,.cmb2-element.ui-datepicker .ui-datepicker-next{float:right}.cmb2-element .ui-datepicker .ui-datepicker-next:before,.cmb2-element .ui-datepicker .ui-datepicker-prev:before,.cmb2-element.ui-datepicker .ui-datepicker-next:before,.cmb2-element.ui-datepicker .ui-datepicker-prev:before{font:normal 20px/34px dashicons;padding-left:7px;color:#fff;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:34px;height:34px}.cmb2-element .ui-datepicker .ui-datepicker-prev:before,.cmb2-element.ui-datepicker .ui-datepicker-prev:before{content:'\f341'}.cmb2-element .ui-datepicker .ui-datepicker-next:before,.cmb2-element.ui-datepicker .ui-datepicker-next:before{content:'\f345'}.cmb2-element .ui-datepicker .ui-datepicker-next-hover:before,.cmb2-element .ui-datepicker .ui-datepicker-prev-hover:before,.cmb2-element.ui-datepicker .ui-datepicker-next-hover:before,.cmb2-element.ui-datepicker .ui-datepicker-prev-hover:before{opacity:.7}.cmb2-element .ui-datepicker select.ui-datepicker-month,.cmb2-element .ui-datepicker select.ui-datepicker-year,.cmb2-element.ui-datepicker select.ui-datepicker-month,.cmb2-element.ui-datepicker select.ui-datepicker-year{width:33%;background:0 0;border-color:transparent;box-shadow:none;color:#fff}.cmb2-element .ui-datepicker select.ui-datepicker-month option,.cmb2-element .ui-datepicker select.ui-datepicker-year option,.cmb2-element.ui-datepicker select.ui-datepicker-month option,.cmb2-element.ui-datepicker select.ui-datepicker-year option{color:#333}.cmb2-element .ui-datepicker thead,.cmb2-element.ui-datepicker thead{color:#fff;font-weight:600}.cmb2-element .ui-datepicker thead th,.cmb2-element.ui-datepicker thead th{font-weight:400}.cmb2-element .ui-datepicker th,.cmb2-element.ui-datepicker th{padding:10px}.cmb2-element .ui-datepicker td,.cmb2-element.ui-datepicker td{padding:0;border:1px solid #f4f4f4}.cmb2-element .ui-datepicker td.ui-datepicker-other-month,.cmb2-element.ui-datepicker td.ui-datepicker-other-month{border:transparent}.cmb2-element .ui-datepicker td.ui-datepicker-week-end,.cmb2-element.ui-datepicker td.ui-datepicker-week-end{background-color:#f4f4f4;border:1px solid #f4f4f4}.cmb2-element .ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today,.cmb2-element.ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today{-webkit-box-shadow:inset 0 0 1px 0 rgba(0,0,0,.1);-moz-box-shadow:inset 0 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 0 1px 0 rgba(0,0,0,.1)}.cmb2-element .ui-datepicker td.ui-datepicker-today,.cmb2-element.ui-datepicker td.ui-datepicker-today{background-color:#f0f0c0}.cmb2-element .ui-datepicker td.ui-datepicker-current-day,.cmb2-element.ui-datepicker td.ui-datepicker-current-day{background:#bd8}.cmb2-element .ui-datepicker td .ui-state-default,.cmb2-element.ui-datepicker td .ui-state-default{background:0 0;border:none;text-align:center;text-decoration:none;width:auto;display:block;padding:5px 10px;font-weight:400;color:#444}.cmb2-element .ui-datepicker td.ui-state-disabled .ui-state-default,.cmb2-element.ui-datepicker td.ui-state-disabled .ui-state-default{opacity:.5}.cmb2-element .ui-datepicker .ui-datepicker-header,.cmb2-element .ui-datepicker .ui-widget-header,.cmb2-element.ui-datepicker .ui-datepicker-header,.cmb2-element.ui-datepicker .ui-widget-header{background:#00a0d2}.cmb2-element .ui-datepicker thead,.cmb2-element.ui-datepicker thead{background:#32373c}.cmb2-element .ui-datepicker td .ui-state-active,.cmb2-element .ui-datepicker td .ui-state-hover,.cmb2-element.ui-datepicker td .ui-state-active,.cmb2-element.ui-datepicker td .ui-state-hover{background:#0073aa;color:#fff}.cmb2-element .ui-datepicker .ui-timepicker-div,.cmb2-element.ui-datepicker .ui-timepicker-div{font-size:14px}.cmb2-element .ui-datepicker .ui-timepicker-div dl,.cmb2-element.ui-datepicker .ui-timepicker-div dl{text-align:left;padding:0 .6em}.cmb2-element .ui-datepicker .ui-timepicker-div dl dt,.cmb2-element.ui-datepicker .ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.cmb2-element .ui-datepicker .ui-timepicker-div dl dd,.cmb2-element.ui-datepicker .ui-timepicker-div dl dd{margin:0 10px 10px 40%}.cmb2-element .ui-datepicker .ui-timepicker-div dl dd select,.cmb2-element.ui-datepicker .ui-timepicker-div dl dd select{width:100%}.cmb2-element .ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane,.cmb2-element.ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane{padding:.6em;text-align:left}.cmb2-element .ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-primary,.cmb2-element .ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-secondary,.cmb2-element.ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-primary,.cmb2-element.ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-secondary{padding:0 10px 1px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;margin:0 .6em .4em .4em}.admin-color-fresh .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-fresh .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-fresh .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-fresh .cmb2-element.ui-datepicker .ui-widget-header{background:#00a0d2}.admin-color-fresh .cmb2-element .ui-datepicker thead,.admin-color-fresh .cmb2-element.ui-datepicker thead{background:#32373c}.admin-color-fresh .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-fresh .cmb2-element.ui-datepicker td .ui-state-hover{background:#0073aa;color:#fff}.admin-color-blue .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-blue .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-blue .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-blue .cmb2-element.ui-datepicker .ui-widget-header{background:#52accc}.admin-color-blue .cmb2-element .ui-datepicker thead,.admin-color-blue .cmb2-element.ui-datepicker thead{background:#4796b3}.admin-color-blue .cmb2-element .ui-datepicker td .ui-state-active,.admin-color-blue .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-blue .cmb2-element.ui-datepicker td .ui-state-active,.admin-color-blue .cmb2-element.ui-datepicker td .ui-state-hover{background:#096484;color:#fff}.admin-color-blue .cmb2-element .ui-datepicker td.ui-datepicker-today,.admin-color-blue .cmb2-element.ui-datepicker td.ui-datepicker-today{background:#eee}.admin-color-coffee .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-coffee .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-coffee .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-coffee .cmb2-element.ui-datepicker .ui-widget-header{background:#59524c}.admin-color-coffee .cmb2-element .ui-datepicker thead,.admin-color-coffee .cmb2-element.ui-datepicker thead{background:#46403c}.admin-color-coffee .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-coffee .cmb2-element.ui-datepicker td .ui-state-hover{background:#c7a589;color:#fff}.admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-widget-header{background:#523f6d}.admin-color-ectoplasm .cmb2-element .ui-datepicker thead,.admin-color-ectoplasm .cmb2-element.ui-datepicker thead{background:#413256}.admin-color-ectoplasm .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-ectoplasm .cmb2-element.ui-datepicker td .ui-state-hover{background:#a3b745;color:#fff}.admin-color-midnight .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-midnight .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-midnight .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-midnight .cmb2-element.ui-datepicker .ui-widget-header{background:#363b3f}.admin-color-midnight .cmb2-element .ui-datepicker thead,.admin-color-midnight .cmb2-element.ui-datepicker thead{background:#26292c}.admin-color-midnight .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-midnight .cmb2-element.ui-datepicker td .ui-state-hover{background:#e14d43;color:#fff}.admin-color-ocean .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-ocean .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-ocean .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-ocean .cmb2-element.ui-datepicker .ui-widget-header{background:#738e96}.admin-color-ocean .cmb2-element .ui-datepicker thead,.admin-color-ocean .cmb2-element.ui-datepicker thead{background:#627c83}.admin-color-ocean .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-ocean .cmb2-element.ui-datepicker td .ui-state-hover{background:#9ebaa0;color:#fff}.admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover,.admin-color-sunrise .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover,.admin-color-sunrise .cmb2-element.ui-datepicker .ui-widget-header{background:#cf4944}.admin-color-sunrise .cmb2-element .ui-datepicker th,.admin-color-sunrise .cmb2-element.ui-datepicker th{border-color:#be3631;background:#be3631}.admin-color-sunrise .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-sunrise .cmb2-element.ui-datepicker td .ui-state-hover{background:#dd823b;color:#fff}.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-light .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-light .cmb2-element.ui-datepicker .ui-widget-header{background:#e5e5e5}.admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-month,.admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-year,.admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-month,.admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-year{color:#555}.admin-color-light .cmb2-element .ui-datepicker thead,.admin-color-light .cmb2-element.ui-datepicker thead{background:#888}.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-next:before,.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-prev:before,.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-title,.admin-color-light .cmb2-element .ui-datepicker td .ui-state-default,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-next:before,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-prev:before,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-title,.admin-color-light .cmb2-element.ui-datepicker td .ui-state-default{color:#555}.admin-color-light .cmb2-element .ui-datepicker td .ui-state-active,.admin-color-light .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-light .cmb2-element.ui-datepicker td .ui-state-active,.admin-color-light .cmb2-element.ui-datepicker td .ui-state-hover{background:#ccc}.admin-color-light .cmb2-element .ui-datepicker td.ui-datepicker-today,.admin-color-light .cmb2-element.ui-datepicker td.ui-datepicker-today{background:#eee}.admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-widget-header{background:#56b274}.admin-color-bbp-evergreen .cmb2-element .ui-datepicker thead,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker thead{background:#36533f}.admin-color-bbp-evergreen .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker td .ui-state-hover{background:#446950;color:#fff}.admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-widget-header{background:#4ca26a}.admin-color-bbp-mint .cmb2-element .ui-datepicker thead,.admin-color-bbp-mint .cmb2-element.ui-datepicker thead{background:#4f6d59}.admin-color-bbp-mint .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-bbp-mint .cmb2-element.ui-datepicker td .ui-state-hover{background:#5fb37c;color:#fff}.cmb2-char-counter-wrap{margin:.5em 0 1em}.cmb2-char-counter-wrap input[type=text]{font-size:12px;width:25px}.cmb2-char-counter-wrap.cmb2-max-exceeded input[type=text]{border-color:#a00!important}.cmb2-char-counter-wrap.cmb2-max-exceeded .cmb2-char-max-msg{display:inline-block}.cmb2-char-max-msg{color:#a00;display:none;font-weight:600;margin-left:1em}.closed .inside{display:none}.cmb-repeatable-grouping{position:relative}.cmb-repeatable-grouping .cmb-group-title{margin-left:-1em;margin-right:-1em;min-height:1.5em}.cmb-repeatable-grouping h3{font-size:14px;padding:8px 12px;margin:0;line-height:1.4}.cmb-repeatable-group.repeatable .cmb-group-title{padding-left:2.2em}.cmb-repeatable-group.non-repeatable .cmb-group-title{padding-left:12px}.cmb-type-group .cmb-row .cmbhandle{right:0;position:absolute}.cmb-spinner{background:url(/wp-admin/images/spinner.gif) no-repeat;-webkit-background-size:20px 20px;background-size:20px 20px;display:none;float:right;vertical-align:middle;opacity:.7;width:20px;height:20px;margin:4px 10px 0}.cmb2-char-max-msg{display:none}
 
includes/lib/cmb2/css/cmb2-rtl.css DELETED
@@ -1,1576 +0,0 @@
1
- /*!
2
- * CMB2 - v2.9.0 - 2021-03-03
3
- * https://cmb2.io
4
- * Copyright (c) 2021
5
- * Licensed GPLv2+
6
- */
7
-
8
- @charset "UTF-8";
9
- /*--------------------------------------------------------------
10
- * Main Wrap
11
- --------------------------------------------------------------*/
12
- /* line 5, sass/partials/_main_wrap.scss */
13
- .cmb2-wrap {
14
- margin: 0;
15
- }
16
- /* line 8, sass/partials/_main_wrap.scss */
17
- .cmb2-wrap input,
18
- .cmb2-wrap textarea {
19
- max-width: 100%;
20
- }
21
- /* line 15, sass/partials/_main_wrap.scss */
22
- .cmb2-wrap input[type="text"].cmb2-oembed {
23
- width: 100%;
24
- }
25
- /* line 20, sass/partials/_main_wrap.scss */
26
- .cmb2-wrap textarea {
27
- width: 500px;
28
- padding: 8px;
29
- }
30
- /* line 24, sass/partials/_main_wrap.scss */
31
- .cmb2-wrap textarea.cmb2-textarea-code {
32
- font-family: "Courier 10 Pitch", Courier, monospace;
33
- line-height: 16px;
34
- }
35
- /* line 32, sass/partials/_main_wrap.scss */
36
- .cmb2-wrap input.cmb2-text-small, .cmb2-wrap input.cmb2-timepicker {
37
- width: 100px;
38
- }
39
- /* line 38, sass/partials/_main_wrap.scss */
40
- .cmb2-wrap input.cmb2-text-money {
41
- width: 90px;
42
- }
43
- /* line 43, sass/partials/_main_wrap.scss */
44
- .cmb2-wrap input.cmb2-text-medium {
45
- width: 230px;
46
- }
47
- /* line 48, sass/partials/_main_wrap.scss */
48
- .cmb2-wrap input.cmb2-upload-file {
49
- width: 65%;
50
- }
51
- /* line 52, sass/partials/_main_wrap.scss */
52
- .cmb2-wrap input.ed_button {
53
- padding: 2px 4px;
54
- }
55
- /* line 57, sass/partials/_main_wrap.scss */
56
- .cmb2-wrap input:not([type="hidden"]) + input,
57
- .cmb2-wrap input:not([type="hidden"]) + .button-secondary,
58
- .cmb2-wrap input:not([type="hidden"]) + select {
59
- margin-right: 20px;
60
- }
61
- /* line 65, sass/partials/_main_wrap.scss */
62
- .cmb2-wrap ul {
63
- margin: 0;
64
- }
65
- /* line 69, sass/partials/_main_wrap.scss */
66
- .cmb2-wrap li {
67
- font-size: 14px;
68
- line-height: 16px;
69
- margin: 1px 0 5px 0;
70
- }
71
- /* line 80, sass/partials/_main_wrap.scss */
72
- .cmb2-wrap select {
73
- font-size: 14px;
74
- margin-top: 3px;
75
- }
76
- /* line 85, sass/partials/_main_wrap.scss */
77
- .cmb2-wrap input:focus,
78
- .cmb2-wrap textarea:focus {
79
- background: #fffff8;
80
- }
81
- /* line 90, sass/partials/_main_wrap.scss */
82
- .cmb2-wrap input[type="radio"] {
83
- margin: 0 0 0 5px;
84
- padding: 0;
85
- }
86
- /* line 95, sass/partials/_main_wrap.scss */
87
- .cmb2-wrap input[type="checkbox"] {
88
- margin: 0 0 0 5px;
89
- padding: 0;
90
- }
91
- /* line 100, sass/partials/_main_wrap.scss */
92
- .cmb2-wrap button,
93
- .cmb2-wrap .button-secondary {
94
- white-space: nowrap;
95
- }
96
- /* line 105, sass/partials/_main_wrap.scss */
97
- .cmb2-wrap .mceLayout {
98
- border: 1px solid #e9e9e9 !important;
99
- }
100
- /* line 109, sass/partials/_main_wrap.scss */
101
- .cmb2-wrap .mceIframeContainer {
102
- background: #ffffff;
103
- }
104
- /* line 113, sass/partials/_main_wrap.scss */
105
- .cmb2-wrap .meta_mce {
106
- width: 97%;
107
- }
108
- /* line 116, sass/partials/_main_wrap.scss */
109
- .cmb2-wrap .meta_mce textarea {
110
- width: 100%;
111
- }
112
- /* line 122, sass/partials/_main_wrap.scss */
113
- .cmb2-wrap .cmb-multicheck-toggle {
114
- margin-top: -1em;
115
- }
116
- /* line 127, sass/partials/_main_wrap.scss */
117
- .cmb2-wrap .wp-picker-clear.button,
118
- .cmb2-wrap .wp-picker-default.button {
119
- margin-right: 6px;
120
- padding: 2px 8px;
121
- }
122
- /* line 133, sass/partials/_main_wrap.scss */
123
- .cmb2-wrap .cmb-row {
124
- margin: 0;
125
- }
126
- /* line 136, sass/partials/_main_wrap.scss */
127
- .cmb2-wrap .cmb-row:after {
128
- content: '';
129
- clear: both;
130
- display: block;
131
- width: 100%;
132
- }
133
- /* line 143, sass/partials/_main_wrap.scss */
134
- .cmb2-wrap .cmb-row.cmb-repeat .cmb2-metabox-description {
135
- padding-top: 0;
136
- padding-bottom: 1em;
137
- }
138
-
139
- /* line 154, sass/partials/_main_wrap.scss */
140
- body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type="radio"]::before {
141
- margin: .1875rem;
142
- }
143
- @media screen and (max-width: 782px) {
144
- /* line 154, sass/partials/_main_wrap.scss */
145
- body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type="radio"]::before {
146
- margin: .4375rem;
147
- }
148
- }
149
-
150
- /* line 162, sass/partials/_main_wrap.scss */
151
- .cmb2-metabox {
152
- clear: both;
153
- margin: 0;
154
- }
155
- /* line 168, sass/partials/_main_wrap.scss */
156
- .cmb2-metabox > .cmb-row:first-of-type > .cmb-td,
157
- .cmb2-metabox > .cmb-row:first-of-type > .cmb-th,
158
- .cmb2-metabox .cmb-field-list > .cmb-row:first-of-type > .cmb-td,
159
- .cmb2-metabox .cmb-field-list > .cmb-row:first-of-type > .cmb-th {
160
- border: 0;
161
- }
162
-
163
- /* line 175, sass/partials/_main_wrap.scss */
164
- .cmb-add-row {
165
- margin: 1.8em 0 0;
166
- }
167
-
168
- /* line 179, sass/partials/_main_wrap.scss */
169
- .cmb-nested .cmb-td,
170
- .cmb-repeatable-group .cmb-th,
171
- .cmb-repeatable-group:first-of-type {
172
- border: 0;
173
- }
174
-
175
- /* line 185, sass/partials/_main_wrap.scss */
176
- .cmb-row:last-of-type,
177
- .cmb2-wrap .cmb-row:last-of-type,
178
- .cmb-repeatable-group:last-of-type {
179
- border-bottom: 0;
180
- }
181
-
182
- /* line 191, sass/partials/_main_wrap.scss */
183
- .cmb-repeatable-grouping {
184
- border: 1px solid #e9e9e9;
185
- padding: 0 1em;
186
- }
187
- /* line 195, sass/partials/_main_wrap.scss */
188
- .cmb-repeatable-grouping.cmb-row {
189
- margin: 0 0 0.8em;
190
- }
191
-
192
- /* line 203, sass/partials/_main_wrap.scss */
193
- .cmb-th {
194
- color: #222222;
195
- float: right;
196
- font-weight: 600;
197
- padding: 20px 0 20px 10px;
198
- vertical-align: top;
199
- width: 200px;
200
- }
201
- @media (max-width: 450px) {
202
- /* line 203, sass/partials/_main_wrap.scss */
203
- .cmb-th {
204
- font-size: 1.2em;
205
- display: block;
206
- float: none;
207
- padding-bottom: 1em;
208
- text-align: right;
209
- width: 100%;
210
- }
211
- /* line 27, sass/partials/_mixins.scss */
212
- .cmb-th label {
213
- display: block;
214
- margin-top: 0;
215
- margin-bottom: 0.5em;
216
- }
217
- }
218
-
219
- /* line 216, sass/partials/_main_wrap.scss */
220
- .cmb-td {
221
- line-height: 1.3;
222
- max-width: 100%;
223
- padding: 15px 10px;
224
- vertical-align: middle;
225
- }
226
-
227
- /* line 225, sass/partials/_main_wrap.scss */
228
- .cmb-type-title .cmb-td {
229
- padding: 0;
230
- }
231
-
232
- /* line 230, sass/partials/_main_wrap.scss */
233
- .cmb-th label {
234
- display: block;
235
- padding: 5px 0;
236
- }
237
-
238
- /* line 235, sass/partials/_main_wrap.scss */
239
- .cmb-th + .cmb-td {
240
- float: right;
241
- }
242
-
243
- /* line 239, sass/partials/_main_wrap.scss */
244
- .cmb-td .cmb-td {
245
- padding-bottom: 1em;
246
- }
247
-
248
- /* line 243, sass/partials/_main_wrap.scss */
249
- .cmb-remove-row {
250
- text-align: left;
251
- }
252
-
253
- /* line 247, sass/partials/_main_wrap.scss */
254
- .empty-row.hidden {
255
- display: none;
256
- }
257
-
258
- /* line 252, sass/partials/_main_wrap.scss */
259
- .cmb-repeat-table {
260
- background-color: #fafafa;
261
- border: 1px solid #e1e1e1;
262
- }
263
- /* line 256, sass/partials/_main_wrap.scss */
264
- .cmb-repeat-table .cmb-row.cmb-repeat-row {
265
- position: relative;
266
- counter-increment: el;
267
- margin: 0;
268
- padding: 10px 50px 10px 10px;
269
- border-bottom: none !important;
270
- }
271
- /* line 264, sass/partials/_main_wrap.scss */
272
- .cmb-repeat-table .cmb-row.cmb-repeat-row + .cmb-repeat-row {
273
- border-top: solid 1px #e9e9e9;
274
- }
275
- /* line 268, sass/partials/_main_wrap.scss */
276
- .cmb-repeat-table .cmb-row.cmb-repeat-row.ui-sortable-helper {
277
- outline: dashed 2px #e9e9e9 !important;
278
- }
279
- /* line 272, sass/partials/_main_wrap.scss */
280
- .cmb-repeat-table .cmb-row.cmb-repeat-row:before {
281
- content: counter(el);
282
- display: block;
283
- top: 0;
284
- right: 0;
285
- position: absolute;
286
- width: 35px;
287
- height: 100%;
288
- line-height: 35px;
289
- cursor: move;
290
- color: #757575;
291
- text-align: center;
292
- border-left: solid 1px #e9e9e9;
293
- }
294
- /* line 289, sass/partials/_main_wrap.scss */
295
- .cmb-repeat-table .cmb-row.cmb-repeat-row .cmb-td {
296
- margin: 0;
297
- padding: 0;
298
- }
299
- /* line 296, sass/partials/_main_wrap.scss */
300
- .cmb-repeat-table + .cmb-add-row {
301
- margin: 0;
302
- }
303
- /* line 299, sass/partials/_main_wrap.scss */
304
- .cmb-repeat-table + .cmb-add-row:before {
305
- content: '';
306
- width: 1px;
307
- height: 1.6em;
308
- display: block;
309
- margin-right: 17px;
310
- background-color: gainsboro;
311
- }
312
- /* line 309, sass/partials/_main_wrap.scss */
313
- .cmb-repeat-table .cmb-remove-row {
314
- top: 7px;
315
- left: 7px;
316
- position: absolute;
317
- width: auto;
318
- margin-right: 0;
319
- padding: 0 !important;
320
- display: none;
321
- }
322
- /* line 320, sass/partials/_main_wrap.scss */
323
- .cmb-repeat-table .cmb-remove-row > .cmb-remove-row-button {
324
- font-size: 20px;
325
- text-indent: -1000px;
326
- overflow: hidden;
327
- position: relative;
328
- height: auto;
329
- line-height: 1;
330
- padding: 0 10px 0;
331
- }
332
- /* line 331, sass/partials/_main_wrap.scss */
333
- .cmb-repeat-table .cmb-remove-row > .cmb-remove-row-button:before {
334
- content: "";
335
- font-family: 'Dashicons';
336
- speak: none;
337
- font-weight: normal;
338
- font-variant: normal;
339
- text-transform: none;
340
- line-height: 1;
341
- -webkit-font-smoothing: antialiased;
342
- margin: 0;
343
- text-indent: 0;
344
- position: absolute;
345
- top: 0;
346
- right: 0;
347
- width: 100%;
348
- height: 100%;
349
- text-align: center;
350
- }
351
- /* line 337, sass/partials/_main_wrap.scss */
352
- .cmb-repeat-table .cmb-repeat-row:hover .cmb-remove-row {
353
- display: block;
354
- }
355
-
356
- /* line 345, sass/partials/_main_wrap.scss */
357
- .cmb-repeatable-group .cmb-th {
358
- padding: 5px;
359
- }
360
- /* line 349, sass/partials/_main_wrap.scss */
361
- .cmb-repeatable-group .cmb-group-title {
362
- background-color: #e9e9e9;
363
- padding: 8px 2.2em 8px 12px;
364
- margin: 0 -1em;
365
- min-height: 1.5em;
366
- font-size: 14px;
367
- line-height: 1.4;
368
- }
369
- /* line 357, sass/partials/_main_wrap.scss */
370
- .cmb-repeatable-group .cmb-group-title h4 {
371
- border: 0;
372
- margin: 0;
373
- font-size: 1.2em;
374
- font-weight: 500;
375
- padding: 0.5em 0.75em;
376
- }
377
- /* line 365, sass/partials/_main_wrap.scss */
378
- .cmb-repeatable-group .cmb-group-title .cmb-th {
379
- display: block;
380
- width: 100%;
381
- }
382
- /* line 371, sass/partials/_main_wrap.scss */
383
- .cmb-repeatable-group .cmb-group-description .cmb-th {
384
- font-size: 1.2em;
385
- display: block;
386
- float: none;
387
- padding-bottom: 1em;
388
- text-align: right;
389
- width: 100%;
390
- }
391
- /* line 27, sass/partials/_mixins.scss */
392
- .cmb-repeatable-group .cmb-group-description .cmb-th label {
393
- display: block;
394
- margin-top: 0;
395
- margin-bottom: 0.5em;
396
- }
397
- /* line 375, sass/partials/_main_wrap.scss */
398
- .cmb-repeatable-group .cmb-shift-rows {
399
- margin-left: 1em;
400
- }
401
- /* line 378, sass/partials/_main_wrap.scss */
402
- .cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-up-alt2 {
403
- margin-top: .15em;
404
- }
405
- /* line 382, sass/partials/_main_wrap.scss */
406
- .cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-down-alt2 {
407
- margin-top: .2em;
408
- }
409
- /* line 387, sass/partials/_main_wrap.scss */
410
- .cmb-repeatable-group .cmb2-upload-button {
411
- float: left;
412
- }
413
-
414
- /* line 393, sass/partials/_main_wrap.scss */
415
- p.cmb2-metabox-description {
416
- color: #666;
417
- letter-spacing: 0.01em;
418
- margin: 0;
419
- padding-top: .5em;
420
- }
421
-
422
- /* line 400, sass/partials/_main_wrap.scss */
423
- span.cmb2-metabox-description {
424
- color: #666;
425
- letter-spacing: 0.01em;
426
- }
427
-
428
- /* line 405, sass/partials/_main_wrap.scss */
429
- .cmb2-metabox-title {
430
- margin: 0 0 5px 0;
431
- padding: 5px 0 0 0;
432
- font-size: 14px;
433
- }
434
-
435
- /* line 411, sass/partials/_main_wrap.scss */
436
- .cmb-inline ul {
437
- padding: 4px 0 0 0;
438
- }
439
-
440
- /* line 415, sass/partials/_main_wrap.scss */
441
- .cmb-inline li {
442
- display: inline-block;
443
- padding-left: 18px;
444
- }
445
-
446
- /* line 420, sass/partials/_main_wrap.scss */
447
- .cmb-type-textarea-code pre {
448
- margin: 0;
449
- }
450
-
451
- /* line 426, sass/partials/_main_wrap.scss */
452
- .cmb2-media-status .img-status {
453
- clear: none;
454
- display: inline-block;
455
- vertical-align: middle;
456
- margin-left: 10px;
457
- width: auto;
458
- }
459
- /* line 433, sass/partials/_main_wrap.scss */
460
- .cmb2-media-status .img-status img {
461
- max-width: 350px;
462
- height: auto;
463
- }
464
- /* line 439, sass/partials/_main_wrap.scss */
465
- .cmb2-media-status .img-status img,
466
- .cmb2-media-status .embed-status {
467
- background: #eee;
468
- border: 5px solid #ffffff;
469
- outline: 1px solid #e9e9e9;
470
- box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
471
- background-image: linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%, #d0d0d0), linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%, #d0d0d0);
472
- background-position: 0 0, 10px 10px;
473
- background-size: 20px 20px;
474
- border-radius: 2px;
475
- -moz-border-radius: 2px;
476
- margin: 15px 0 0 0;
477
- }
478
- /* line 453, sass/partials/_main_wrap.scss */
479
- .cmb2-media-status .embed-status {
480
- float: right;
481
- max-width: 800px;
482
- }
483
- /* line 458, sass/partials/_main_wrap.scss */
484
- .cmb2-media-status .img-status, .cmb2-media-status .embed-status {
485
- position: relative;
486
- }
487
- /* line 461, sass/partials/_main_wrap.scss */
488
- .cmb2-media-status .img-status .cmb2-remove-file-button, .cmb2-media-status .embed-status .cmb2-remove-file-button {
489
- background: url(../images/ico-delete.png);
490
- height: 16px;
491
- right: -5px;
492
- position: absolute;
493
- text-indent: -9999px;
494
- top: -5px;
495
- width: 16px;
496
- }
497
- /* line 475, sass/partials/_main_wrap.scss */
498
- .cmb2-media-status .img-status .cmb2-remove-file-button {
499
- top: 10px;
500
- }
501
- /* line 480, sass/partials/_main_wrap.scss */
502
- .cmb2-media-status .img-status img, .cmb2-media-status .file-status > span {
503
- cursor: pointer;
504
- }
505
- /* line 485, sass/partials/_main_wrap.scss */
506
- .cmb2-media-status.cmb-attach-list .img-status img, .cmb2-media-status.cmb-attach-list .file-status > span {
507
- cursor: move;
508
- }
509
-
510
- /* line 492, sass/partials/_main_wrap.scss */
511
- .cmb-type-file-list .cmb2-media-status .img-status {
512
- clear: none;
513
- vertical-align: middle;
514
- width: auto;
515
- margin-left: 10px;
516
- margin-bottom: 10px;
517
- margin-top: 0;
518
- }
519
-
520
- /* line 501, sass/partials/_main_wrap.scss */
521
- .cmb-attach-list li {
522
- clear: both;
523
- display: inline-block;
524
- width: 100%;
525
- margin-top: 5px;
526
- margin-bottom: 10px;
527
- }
528
- /* line 507, sass/partials/_main_wrap.scss */
529
- .cmb-attach-list li img {
530
- float: right;
531
- margin-left: 10px;
532
- }
533
-
534
- /* line 513, sass/partials/_main_wrap.scss */
535
- .cmb2-remove-wrapper {
536
- margin: 0;
537
- }
538
-
539
- /* line 517, sass/partials/_main_wrap.scss */
540
- .child-cmb2 .cmb-th {
541
- text-align: right;
542
- }
543
-
544
- /* line 521, sass/partials/_main_wrap.scss */
545
- .cmb2-indented-hierarchy {
546
- padding-right: 1.5em;
547
- }
548
-
549
- @media (max-width: 450px) {
550
- /* line 526, sass/partials/_main_wrap.scss */
551
- .cmb-th,
552
- .cmb-td,
553
- .cmb-th + .cmb-td {
554
- display: block;
555
- float: none;
556
- width: 100%;
557
- }
558
- }
559
- /*--------------------------------------------------------------
560
- * Post Metaboxes
561
- --------------------------------------------------------------*/
562
- /* line 5, sass/partials/_post_metaboxes.scss */
563
- #poststuff .cmb-group-title {
564
- margin-right: -1em;
565
- margin-left: -1em;
566
- min-height: 1.5em;
567
- }
568
-
569
- /* line 11, sass/partials/_post_metaboxes.scss */
570
- #poststuff .repeatable .cmb-group-title {
571
- padding-right: 2.2em;
572
- }
573
-
574
- /* line 17, sass/partials/_post_metaboxes.scss */
575
- .cmb2-postbox .cmb2-wrap, .cmb-type-group .cmb2-wrap {
576
- margin: 0;
577
- }
578
- /* line 20, sass/partials/_post_metaboxes.scss */
579
- .cmb2-postbox .cmb2-wrap > .cmb-field-list > .cmb-row, .cmb-type-group .cmb2-wrap > .cmb-field-list > .cmb-row {
580
- padding: 1.8em 0;
581
- }
582
- /* line 26, sass/partials/_post_metaboxes.scss */
583
- .cmb2-postbox .cmb2-wrap input[type=text].cmb2-oembed, .cmb-type-group .cmb2-wrap input[type=text].cmb2-oembed {
584
- width: 100%;
585
- }
586
- /* line 32, sass/partials/_post_metaboxes.scss */
587
- .cmb2-postbox .cmb-row, .cmb-type-group .cmb-row {
588
- padding: 0 0 1.8em;
589
- margin: 0 0 0.8em;
590
- }
591
- /* line 36, sass/partials/_post_metaboxes.scss */
592
- .cmb2-postbox .cmb-row .cmbhandle, .cmb-type-group .cmb-row .cmbhandle {
593
- left: -1em;
594
- position: relative;
595
- color: #222222;
596
- }
597
- /* line 43, sass/partials/_post_metaboxes.scss */
598
- .cmb2-postbox .cmb-repeatable-grouping, .cmb-type-group .cmb-repeatable-grouping {
599
- padding: 0 1em;
600
- max-width: 100%;
601
- min-width: 1px !important;
602
- }
603
- /* line 49, sass/partials/_post_metaboxes.scss */
604
- .cmb2-postbox .cmb-repeatable-group > .cmb-row, .cmb-type-group .cmb-repeatable-group > .cmb-row {
605
- padding-bottom: 0;
606
- }
607
- /* line 53, sass/partials/_post_metaboxes.scss */
608
- .cmb2-postbox .cmb-th, .cmb-type-group .cmb-th {
609
- width: 18%;
610
- padding: 0 0 0 2%;
611
- }
612
- /* line 59, sass/partials/_post_metaboxes.scss */
613
- .cmb2-postbox .cmb-td, .cmb-type-group .cmb-td {
614
- margin-bottom: 0;
615
- padding: 0;
616
- line-height: 1.3;
617
- }
618
- /* line 65, sass/partials/_post_metaboxes.scss */
619
- .cmb2-postbox .cmb-th + .cmb-td, .cmb-type-group .cmb-th + .cmb-td {
620
- width: 80%;
621
- float: left;
622
- }
623
- /* line 70, sass/partials/_post_metaboxes.scss */
624
- .cmb2-postbox .cmb-row:not(:last-of-type),
625
- .cmb2-postbox .cmb-repeatable-group:not(:last-of-type), .cmb-type-group .cmb-row:not(:last-of-type),
626
- .cmb-type-group .cmb-repeatable-group:not(:last-of-type) {
627
- border-bottom: 1px solid #e9e9e9;
628
- }
629
- @media (max-width: 450px) {
630
- /* line 70, sass/partials/_post_metaboxes.scss */
631
- .cmb2-postbox .cmb-row:not(:last-of-type),
632
- .cmb2-postbox .cmb-repeatable-group:not(:last-of-type), .cmb-type-group .cmb-row:not(:last-of-type),
633
- .cmb-type-group .cmb-repeatable-group:not(:last-of-type) {
634
- border-bottom: 0;
635
- }
636
- }
637
- /* line 79, sass/partials/_post_metaboxes.scss */
638
- .cmb2-postbox .cmb-repeat-group-field,
639
- .cmb2-postbox .cmb-remove-field-row, .cmb-type-group .cmb-repeat-group-field,
640
- .cmb-type-group .cmb-remove-field-row {
641
- padding-top: 1.8em;
642
- }
643
-
644
- /*--------------------------------------------------------------
645
- * Context Metaboxes
646
- --------------------------------------------------------------*/
647
- /* Metabox collapse arrow indicators */
648
- /* line 8, sass/partials/_context_metaboxes.scss */
649
- .js .cmb2-postbox.context-box .handlediv {
650
- text-align: center;
651
- }
652
- /* line 13, sass/partials/_context_metaboxes.scss */
653
- .js .cmb2-postbox.context-box .toggle-indicator:before {
654
- content: "\f142";
655
- display: inline-block;
656
- font: normal 20px/1 dashicons;
657
- speak: none;
658
- -webkit-font-smoothing: antialiased;
659
- -moz-osx-font-smoothing: grayscale;
660
- text-decoration: none !important;
661
- }
662
- /* line 26, sass/partials/_context_metaboxes.scss */
663
- .js .cmb2-postbox.context-box.closed .toggle-indicator:before {
664
- content: "\f140";
665
- }
666
-
667
- /* line 34, sass/partials/_context_metaboxes.scss */
668
- .cmb2-postbox.context-box {
669
- margin-bottom: 10px;
670
- }
671
- /* line 38, sass/partials/_context_metaboxes.scss */
672
- .cmb2-postbox.context-box.context-before_permalink-box {
673
- margin-top: 10px;
674
- }
675
- /* line 42, sass/partials/_context_metaboxes.scss */
676
- .cmb2-postbox.context-box.context-after_title-box {
677
- margin-top: 10px;
678
- }
679
- /* line 46, sass/partials/_context_metaboxes.scss */
680
- .cmb2-postbox.context-box.context-after_editor-box {
681
- margin-top: 20px;
682
- margin-bottom: 0;
683
- }
684
- /* line 51, sass/partials/_context_metaboxes.scss */
685
- .cmb2-postbox.context-box.context-form_top-box {
686
- margin-top: 10px;
687
- }
688
- /* line 55, sass/partials/_context_metaboxes.scss */
689
- .cmb2-postbox.context-box.context-form_top-box .hndle {
690
- font-size: 14px;
691
- padding: 8px 12px;
692
- margin: 0;
693
- line-height: 1.4;
694
- }
695
- /* line 63, sass/partials/_context_metaboxes.scss */
696
- .cmb2-postbox.context-box .hndle {
697
- cursor: auto;
698
- }
699
-
700
- /* line 68, sass/partials/_context_metaboxes.scss */
701
- .cmb2-context-wrap {
702
- margin-top: 10px;
703
- }
704
- /* line 72, sass/partials/_context_metaboxes.scss */
705
- .cmb2-context-wrap.cmb2-context-wrap-form_top {
706
- margin-left: 300px;
707
- width: auto;
708
- }
709
- /* line 79, sass/partials/_context_metaboxes.scss */
710
- .cmb2-context-wrap.cmb2-context-wrap-no-title .cmb2-metabox {
711
- padding: 10px;
712
- }
713
- /* line 84, sass/partials/_context_metaboxes.scss */
714
- .cmb2-context-wrap .cmb-th {
715
- padding: 0 0 0 2%;
716
- width: 18%;
717
- }
718
- /* line 89, sass/partials/_context_metaboxes.scss */
719
- .cmb2-context-wrap .cmb-td {
720
- width: 80%;
721
- padding: 0;
722
- }
723
- /* line 94, sass/partials/_context_metaboxes.scss */
724
- .cmb2-context-wrap .cmb-row {
725
- margin-bottom: 10px;
726
- }
727
- /* line 97, sass/partials/_context_metaboxes.scss */
728
- .cmb2-context-wrap .cmb-row:last-of-type {
729
- margin-bottom: 0;
730
- }
731
-
732
- /* one column on the post write/edit screen */
733
- @media only screen and (max-width: 850px) {
734
- /* line 107, sass/partials/_context_metaboxes.scss */
735
- .cmb2-context-wrap.cmb2-context-wrap-form_top {
736
- margin-left: 0;
737
- }
738
- }
739
- /*--------------------------------------------------------------
740
- * Options page
741
- --------------------------------------------------------------*/
742
- /* line 5, sass/partials/_options-page.scss */
743
- .cmb2-options-page {
744
- max-width: 1200px;
745
- }
746
- /* line 8, sass/partials/_options-page.scss */
747
- .cmb2-options-page.wrap > h2 {
748
- margin-bottom: 1em;
749
- }
750
- /* line 12, sass/partials/_options-page.scss */
751
- .cmb2-options-page .cmb2-metabox > .cmb-row {
752
- padding: 1em;
753
- margin-top: -1px;
754
- background: #ffffff;
755
- border: 1px solid #e9e9e9;
756
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
757
- }
758
- /* line 19, sass/partials/_options-page.scss */
759
- .cmb2-options-page .cmb2-metabox > .cmb-row > .cmb-th {
760
- padding: 0;
761
- font-weight: initial;
762
- }
763
- /* line 24, sass/partials/_options-page.scss */
764
- .cmb2-options-page .cmb2-metabox > .cmb-row > .cmb-th + .cmb-td {
765
- float: none;
766
- padding: 0 1em 0 0;
767
- margin-right: 200px;
768
- }
769
- @media (max-width: 450px) {
770
- /* line 24, sass/partials/_options-page.scss */
771
- .cmb2-options-page .cmb2-metabox > .cmb-row > .cmb-th + .cmb-td {
772
- padding: 0;
773
- margin-right: 0;
774
- }
775
- }
776
- /* line 37, sass/partials/_options-page.scss */
777
- .cmb2-options-page .cmb2-wrap .cmb-type-title {
778
- margin-top: 1em;
779
- padding: 0.6em 1em;
780
- background-color: #fafafa;
781
- }
782
- /* line 42, sass/partials/_options-page.scss */
783
- .cmb2-options-page .cmb2-wrap .cmb-type-title .cmb2-metabox-title {
784
- font-size: 12px;
785
- margin-top: 0;
786
- margin-bottom: 0;
787
- text-transform: uppercase;
788
- }
789
- /* line 49, sass/partials/_options-page.scss */
790
- .cmb2-options-page .cmb2-wrap .cmb-type-title .cmb2-metabox-description {
791
- padding-top: 0.25em;
792
- }
793
- /* line 55, sass/partials/_options-page.scss */
794
- .cmb2-options-page .cmb-repeatable-group .cmb-group-description .cmb-th {
795
- padding: 0 0 0.8em 0;
796
- }
797
- /* line 59, sass/partials/_options-page.scss */
798
- .cmb2-options-page .cmb-repeatable-group .cmb-group-name {
799
- font-size: 16px;
800
- margin-top: 0;
801
- margin-bottom: 0;
802
- }
803
- /* line 65, sass/partials/_options-page.scss */
804
- .cmb2-options-page .cmb-repeatable-group .cmb-th > .cmb2-metabox-description {
805
- font-weight: 400;
806
- padding-bottom: 0 !important;
807
- }
808
-
809
- /*--------------------------------------------------------------
810
- * New-Term Page
811
- --------------------------------------------------------------*/
812
- /* line 6, sass/partials/_new_term.scss */
813
- #addtag .cmb-th {
814
- float: none;
815
- width: auto;
816
- padding: 20px 0 0;
817
- }
818
- /* line 12, sass/partials/_new_term.scss */
819
- #addtag .cmb-td {
820
- padding: 0;
821
- }
822
- /* line 16, sass/partials/_new_term.scss */
823
- #addtag .cmb-th + .cmb-td {
824
- float: none;
825
- }
826
- /* line 20, sass/partials/_new_term.scss */
827
- #addtag select {
828
- max-width: 100%;
829
- }
830
- /* line 24, sass/partials/_new_term.scss */
831
- #addtag .cmb2-metabox {
832
- padding-bottom: 20px;
833
- }
834
- /* line 28, sass/partials/_new_term.scss */
835
- #addtag .cmb-row li label {
836
- display: inline;
837
- }
838
-
839
- /*--------------------------------------------------------------
840
- * Misc.
841
- --------------------------------------------------------------*/
842
- /* line 5, sass/partials/_misc.scss */
843
- #poststuff .cmb-repeatable-group h2 {
844
- margin: 0;
845
- }
846
-
847
- /* line 12, sass/partials/_misc.scss */
848
- .edit-tags-php .cmb2-metabox-title,
849
- .profile-php .cmb2-metabox-title,
850
- .user-edit-php .cmb2-metabox-title {
851
- font-size: 1.4em;
852
- }
853
-
854
- /* line 18, sass/partials/_misc.scss */
855
- .cmb2-postbox .cmb-spinner, .cmb2-no-box-wrap .cmb-spinner {
856
- float: right;
857
- display: none;
858
- }
859
-
860
- /* line 24, sass/partials/_misc.scss */
861
- .cmb-spinner {
862
- display: none;
863
- }
864
- /* line 26, sass/partials/_misc.scss */
865
- .cmb-spinner.is-active {
866
- display: block;
867
- }
868
-
869
- /*--------------------------------------------------------------
870
- * Sidebar Placement Adjustments
871
- --------------------------------------------------------------*/
872
- /* line 10, sass/partials/_sidebar_placements.scss */
873
- .inner-sidebar .cmb2-wrap > .cmb-field-list > .cmb-row,
874
- #side-sortables .cmb2-wrap > .cmb-field-list > .cmb-row {
875
- padding: 1.4em 0;
876
- }
877
- /* line 16, sass/partials/_sidebar_placements.scss */
878
- .inner-sidebar .cmb2-wrap input[type=text]:not(.wp-color-picker),
879
- #side-sortables .cmb2-wrap input[type=text]:not(.wp-color-picker) {
880
- width: 100%;
881
- }
882
- /* line 20, sass/partials/_sidebar_placements.scss */
883
- .inner-sidebar .cmb2-wrap input + input:not(.wp-picker-clear), .inner-sidebar .cmb2-wrap input + select,
884
- #side-sortables .cmb2-wrap input + input:not(.wp-picker-clear),
885
- #side-sortables .cmb2-wrap input + select {
886
- margin-right: 0;
887
- margin-top: 1em;
888
- display: block;
889
- }
890
- /* line 26, sass/partials/_sidebar_placements.scss */
891
- .inner-sidebar .cmb2-wrap input.cmb2-text-money,
892
- #side-sortables .cmb2-wrap input.cmb2-text-money {
893
- max-width: 70%;
894
- }
895
- /* line 28, sass/partials/_sidebar_placements.scss */
896
- .inner-sidebar .cmb2-wrap input.cmb2-text-money + .cmb2-metabox-description,
897
- #side-sortables .cmb2-wrap input.cmb2-text-money + .cmb2-metabox-description {
898
- display: block;
899
- }
900
- /* line 34, sass/partials/_sidebar_placements.scss */
901
- .inner-sidebar .cmb2-wrap label,
902
- #side-sortables .cmb2-wrap label {
903
- display: block;
904
- font-weight: 700;
905
- padding: 0 0 5px;
906
- }
907
- /* line 42, sass/partials/_sidebar_placements.scss */
908
- .inner-sidebar textarea,
909
- #side-sortables textarea {
910
- max-width: 99%;
911
- }
912
- /* line 46, sass/partials/_sidebar_placements.scss */
913
- .inner-sidebar .cmb-repeatable-group,
914
- #side-sortables .cmb-repeatable-group {
915
- border-bottom: 1px solid #e9e9e9;
916
- }
917
- /* line 50, sass/partials/_sidebar_placements.scss */
918
- .inner-sidebar .cmb-type-group > .cmb-td > .cmb-repeatable-group,
919
- #side-sortables .cmb-type-group > .cmb-td > .cmb-repeatable-group {
920
- border-bottom: 0;
921
- margin-bottom: -1.4em;
922
- }
923
- /* line 55, sass/partials/_sidebar_placements.scss */
924
- .inner-sidebar .cmb-th,
925
- .inner-sidebar .cmb-td:not(.cmb-remove-row),
926
- .inner-sidebar .cmb-th + .cmb-td,
927
- #side-sortables .cmb-th,
928
- #side-sortables .cmb-td:not(.cmb-remove-row),
929
- #side-sortables .cmb-th + .cmb-td {
930
- width: 100%;
931
- display: block;
932
- float: none;
933
- }
934
- /* line 63, sass/partials/_sidebar_placements.scss */
935
- .inner-sidebar .closed .inside,
936
- #side-sortables .closed .inside {
937
- display: none;
938
- }
939
- /* line 67, sass/partials/_sidebar_placements.scss */
940
- .inner-sidebar .cmb-th,
941
- #side-sortables .cmb-th {
942
- display: block;
943
- float: none;
944
- padding-bottom: 1em;
945
- text-align: right;
946
- width: 100%;
947
- padding-right: 0;
948
- padding-left: 0;
949
- }
950
- /* line 27, sass/partials/_mixins.scss */
951
- .inner-sidebar .cmb-th label,
952
- #side-sortables .cmb-th label {
953
- display: block;
954
- margin-top: 0;
955
- margin-bottom: 0.5em;
956
- }
957
- /* line 14, sass/partials/_mixins.scss */
958
- .inner-sidebar .cmb-th label,
959
- #side-sortables .cmb-th label {
960
- font-size: 14px;
961
- line-height: 1.4em;
962
- }
963
- /* line 74, sass/partials/_sidebar_placements.scss */
964
- .inner-sidebar .cmb-group-description .cmb-th,
965
- #side-sortables .cmb-group-description .cmb-th {
966
- padding-top: 0;
967
- }
968
- /* line 77, sass/partials/_sidebar_placements.scss */
969
- .inner-sidebar .cmb-group-description .cmb2-metabox-description,
970
- #side-sortables .cmb-group-description .cmb2-metabox-description {
971
- padding: 0;
972
- }
973
- /* line 84, sass/partials/_sidebar_placements.scss */
974
- .inner-sidebar .cmb-group-title .cmb-th,
975
- #side-sortables .cmb-group-title .cmb-th {
976
- padding: 0;
977
- }
978
- /* line 90, sass/partials/_sidebar_placements.scss */
979
- .inner-sidebar .cmb-repeatable-grouping + .cmb-repeatable-grouping,
980
- #side-sortables .cmb-repeatable-grouping + .cmb-repeatable-grouping {
981
- margin-top: 1em;
982
- }
983
- /* line 99, sass/partials/_sidebar_placements.scss */
984
- .inner-sidebar .cmb2-media-status .img-status img,
985
- .inner-sidebar .cmb2-media-status .embed-status img,
986
- #side-sortables .cmb2-media-status .img-status img,
987
- #side-sortables .cmb2-media-status .embed-status img {
988
- max-width: 90%;
989
- height: auto;
990
- }
991
- /* line 107, sass/partials/_sidebar_placements.scss */
992
- .inner-sidebar .cmb2-list label,
993
- #side-sortables .cmb2-list label {
994
- display: inline;
995
- font-weight: normal;
996
- }
997
- /* line 112, sass/partials/_sidebar_placements.scss */
998
- .inner-sidebar .cmb2-metabox-description,
999
- #side-sortables .cmb2-metabox-description {
1000
- display: block;
1001
- padding: 7px 0 0;
1002
- }
1003
- /* line 119, sass/partials/_sidebar_placements.scss */
1004
- .inner-sidebar .cmb-type-checkbox .cmb-td label,
1005
- .inner-sidebar .cmb-type-checkbox .cmb2-metabox-description,
1006
- #side-sortables .cmb-type-checkbox .cmb-td label,
1007
- #side-sortables .cmb-type-checkbox .cmb2-metabox-description {
1008
- font-weight: normal;
1009
- display: inline;
1010
- }
1011
- /* line 126, sass/partials/_sidebar_placements.scss */
1012
- .inner-sidebar .cmb-row .cmb2-metabox-description,
1013
- #side-sortables .cmb-row .cmb2-metabox-description {
1014
- padding-bottom: 1.8em;
1015
- }
1016
- /* line 130, sass/partials/_sidebar_placements.scss */
1017
- .inner-sidebar .cmb2-metabox-title,
1018
- #side-sortables .cmb2-metabox-title {
1019
- font-size: 1.2em;
1020
- font-style: italic;
1021
- }
1022
- /* line 135, sass/partials/_sidebar_placements.scss */
1023
- .inner-sidebar .cmb-remove-row,
1024
- #side-sortables .cmb-remove-row {
1025
- clear: both;
1026
- padding-top: 12px;
1027
- padding-bottom: 0;
1028
- }
1029
- /* line 141, sass/partials/_sidebar_placements.scss */
1030
- .inner-sidebar .cmb2-upload-button,
1031
- #side-sortables .cmb2-upload-button {
1032
- clear: both;
1033
- margin-top: 12px;
1034
- }
1035
-
1036
- /*--------------------------------------------------------------
1037
- * Collapsible UI
1038
- --------------------------------------------------------------*/
1039
- /* line 6, sass/partials/_collapsible_ui.scss */
1040
- .cmb2-metabox .cmbhandle {
1041
- color: #757575;
1042
- float: left;
1043
- width: 27px;
1044
- height: 30px;
1045
- cursor: pointer;
1046
- left: -1em;
1047
- position: relative;
1048
- }
1049
- /* line 14, sass/partials/_collapsible_ui.scss */
1050
- .cmb2-metabox .cmbhandle:before {
1051
- content: '\f142';
1052
- left: 12px;
1053
- font: normal 20px/1 'dashicons';
1054
- speak: none;
1055
- display: inline-block;
1056
- padding: 8px 10px;
1057
- top: 0;
1058
- position: relative;
1059
- -webkit-font-smoothing: antialiased;
1060
- -moz-osx-font-smoothing: grayscale;
1061
- text-decoration: none !important;
1062
- }
1063
- /* line 31, sass/partials/_collapsible_ui.scss */
1064
- .cmb2-metabox .postbox.closed .cmbhandle:before {
1065
- content: '\f140';
1066
- }
1067
- /* line 37, sass/partials/_collapsible_ui.scss */
1068
- .cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row {
1069
- -webkit-appearance: none !important;
1070
- background: none !important;
1071
- border: none !important;
1072
- position: absolute;
1073
- right: 0;
1074
- top: .5em;
1075
- line-height: 1em;
1076
- padding: 2px 6px 3px;
1077
- opacity: .5;
1078
- }
1079
- /* line 47, sass/partials/_collapsible_ui.scss */
1080
- .cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]) {
1081
- cursor: pointer;
1082
- color: #a00;
1083
- opacity: 1;
1084
- }
1085
- /* line 51, sass/partials/_collapsible_ui.scss */
1086
- .cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]):hover {
1087
- color: #f00;
1088
- }
1089
-
1090
- /*
1091
- * jQuery UI CSS Framework 1.8.16
1092
- *
1093
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1094
- * Dual licensed under the MIT or GPL Version 2 licenses.
1095
- * http://jquery.org/license
1096
- *
1097
- * http://docs.jquery.com/UI/Theming/API
1098
- *
1099
- * WordPress Styles adopted from "jQuery UI Datepicker CSS for WordPress"
1100
- * https://github.com/stuttter/wp-datepicker-styling
1101
- *
1102
- */
1103
- /* line 15, sass/partials/_jquery_ui.scss */
1104
- * html .cmb2-element.ui-helper-clearfix {
1105
- height: 1%;
1106
- }
1107
-
1108
- /* line 24, sass/partials/_jquery_ui.scss */
1109
- .cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
1110
- padding: 0;
1111
- margin: 0;
1112
- -webkit-border-radius: 0;
1113
- -moz-border-radius: 0;
1114
- border-radius: 0;
1115
- background-color: #fff;
1116
- border: 1px solid #dfdfdf;
1117
- border-top: none;
1118
- -webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
1119
- box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
1120
- min-width: 17em;
1121
- width: auto;
1122
- /* Default Color Scheme */
1123
- }
1124
- /* line 38, sass/partials/_jquery_ui.scss */
1125
- .cmb2-element.ui-datepicker *, .cmb2-element .ui-datepicker * {
1126
- padding: 0;
1127
- font-family: "Open Sans", sans-serif;
1128
- -webkit-border-radius: 0;
1129
- -moz-border-radius: 0;
1130
- border-radius: 0;
1131
- }
1132
- /* line 46, sass/partials/_jquery_ui.scss */
1133
- .cmb2-element.ui-datepicker table, .cmb2-element .ui-datepicker table {
1134
- font-size: 13px;
1135
- margin: 0;
1136
- border: none;
1137
- border-collapse: collapse;
1138
- }
1139
- /* line 53, sass/partials/_jquery_ui.scss */
1140
- .cmb2-element.ui-datepicker .ui-widget-header,
1141
- .cmb2-element.ui-datepicker .ui-datepicker-header, .cmb2-element .ui-datepicker .ui-widget-header,
1142
- .cmb2-element .ui-datepicker .ui-datepicker-header {
1143
- background-image: none;
1144
- border: none;
1145
- color: #fff;
1146
- font-weight: normal;
1147
- }
1148
- /* line 61, sass/partials/_jquery_ui.scss */
1149
- .cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover, .cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover {
1150
- background: transparent;
1151
- border-color: transparent;
1152
- cursor: pointer;
1153
- }
1154
- /* line 67, sass/partials/_jquery_ui.scss */
1155
- .cmb2-element.ui-datepicker .ui-datepicker-title, .cmb2-element .ui-datepicker .ui-datepicker-title {
1156
- margin: 0;
1157
- padding: 10px 0;
1158
- color: #fff;
1159
- font-size: 14px;
1160
- line-height: 14px;
1161
- text-align: center;
1162
- }
1163
- /* line 75, sass/partials/_jquery_ui.scss */
1164
- .cmb2-element.ui-datepicker .ui-datepicker-title select, .cmb2-element .ui-datepicker .ui-datepicker-title select {
1165
- margin-top: -8px;
1166
- margin-bottom: -8px;
1167
- }
1168
- /* line 81, sass/partials/_jquery_ui.scss */
1169
- .cmb2-element.ui-datepicker .ui-datepicker-prev,
1170
- .cmb2-element.ui-datepicker .ui-datepicker-next, .cmb2-element .ui-datepicker .ui-datepicker-prev,
1171
- .cmb2-element .ui-datepicker .ui-datepicker-next {
1172
- position: relative;
1173
- top: 0;
1174
- height: 34px;
1175
- width: 34px;
1176
- }
1177
- /* line 89, sass/partials/_jquery_ui.scss */
1178
- .cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-prev,
1179
- .cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-next, .cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-prev,
1180
- .cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-next {
1181
- border: none;
1182
- }
1183
- /* line 94, sass/partials/_jquery_ui.scss */
1184
- .cmb2-element.ui-datepicker .ui-datepicker-prev,
1185
- .cmb2-element.ui-datepicker .ui-datepicker-prev-hover, .cmb2-element .ui-datepicker .ui-datepicker-prev,
1186
- .cmb2-element .ui-datepicker .ui-datepicker-prev-hover {
1187
- right: 0;
1188
- }
1189
- /* line 99, sass/partials/_jquery_ui.scss */
1190
- .cmb2-element.ui-datepicker .ui-datepicker-next,
1191
- .cmb2-element.ui-datepicker .ui-datepicker-next-hover, .cmb2-element .ui-datepicker .ui-datepicker-next,
1192
- .cmb2-element .ui-datepicker .ui-datepicker-next-hover {
1193
- left: 0;
1194
- }
1195
- /* line 104, sass/partials/_jquery_ui.scss */
1196
- .cmb2-element.ui-datepicker .ui-datepicker-next span,
1197
- .cmb2-element.ui-datepicker .ui-datepicker-prev span, .cmb2-element .ui-datepicker .ui-datepicker-next span,
1198
- .cmb2-element .ui-datepicker .ui-datepicker-prev span {
1199
- display: none;
1200
- }
1201
- /* line 109, sass/partials/_jquery_ui.scss */
1202
- .cmb2-element.ui-datepicker .ui-datepicker-prev, .cmb2-element .ui-datepicker .ui-datepicker-prev {
1203
- float: right;
1204
- }
1205
- /* line 113, sass/partials/_jquery_ui.scss */
1206
- .cmb2-element.ui-datepicker .ui-datepicker-next, .cmb2-element .ui-datepicker .ui-datepicker-next {
1207
- float: left;
1208
- }
1209
- /* line 117, sass/partials/_jquery_ui.scss */
1210
- .cmb2-element.ui-datepicker .ui-datepicker-prev:before,
1211
- .cmb2-element.ui-datepicker .ui-datepicker-next:before, .cmb2-element .ui-datepicker .ui-datepicker-prev:before,
1212
- .cmb2-element .ui-datepicker .ui-datepicker-next:before {
1213
- font: normal 20px/34px 'dashicons';
1214
- padding-right: 7px;
1215
- color: #fff;
1216
- speak: none;
1217
- -webkit-font-smoothing: antialiased;
1218
- -moz-osx-font-smoothing: grayscale;
1219
- width: 34px;
1220
- height: 34px;
1221
- }
1222
- /* line 129, sass/partials/_jquery_ui.scss */
1223
- .cmb2-element.ui-datepicker .ui-datepicker-prev:before, .cmb2-element .ui-datepicker .ui-datepicker-prev:before {
1224
- content: '\f341';
1225
- }
1226
- /* line 133, sass/partials/_jquery_ui.scss */
1227
- .cmb2-element.ui-datepicker .ui-datepicker-next:before, .cmb2-element .ui-datepicker .ui-datepicker-next:before {
1228
- content: '\f345';
1229
- }
1230
- /* line 137, sass/partials/_jquery_ui.scss */
1231
- .cmb2-element.ui-datepicker .ui-datepicker-prev-hover:before,
1232
- .cmb2-element.ui-datepicker .ui-datepicker-next-hover:before, .cmb2-element .ui-datepicker .ui-datepicker-prev-hover:before,
1233
- .cmb2-element .ui-datepicker .ui-datepicker-next-hover:before {
1234
- opacity: 0.7;
1235
- }
1236
- /* line 142, sass/partials/_jquery_ui.scss */
1237
- .cmb2-element.ui-datepicker select.ui-datepicker-month,
1238
- .cmb2-element.ui-datepicker select.ui-datepicker-year, .cmb2-element .ui-datepicker select.ui-datepicker-month,
1239
- .cmb2-element .ui-datepicker select.ui-datepicker-year {
1240
- width: 33%;
1241
- background: transparent;
1242
- border-color: transparent;
1243
- box-shadow: none;
1244
- color: #fff;
1245
- }
1246
- /* line 149, sass/partials/_jquery_ui.scss */
1247
- .cmb2-element.ui-datepicker select.ui-datepicker-month option,
1248
- .cmb2-element.ui-datepicker select.ui-datepicker-year option, .cmb2-element .ui-datepicker select.ui-datepicker-month option,
1249
- .cmb2-element .ui-datepicker select.ui-datepicker-year option {
1250
- color: #333;
1251
- }
1252
- /* line 154, sass/partials/_jquery_ui.scss */
1253
- .cmb2-element.ui-datepicker thead, .cmb2-element .ui-datepicker thead {
1254
- color: #fff;
1255
- font-weight: 600;
1256
- }
1257
- /* line 157, sass/partials/_jquery_ui.scss */
1258
- .cmb2-element.ui-datepicker thead th, .cmb2-element .ui-datepicker thead th {
1259
- font-weight: normal;
1260
- }
1261
- /* line 162, sass/partials/_jquery_ui.scss */
1262
- .cmb2-element.ui-datepicker th, .cmb2-element .ui-datepicker th {
1263
- padding: 10px;
1264
- }
1265
- /* line 166, sass/partials/_jquery_ui.scss */
1266
- .cmb2-element.ui-datepicker td, .cmb2-element .ui-datepicker td {
1267
- padding: 0;
1268
- border: 1px solid #f4f4f4;
1269
- }
1270
- /* line 171, sass/partials/_jquery_ui.scss */
1271
- .cmb2-element.ui-datepicker td.ui-datepicker-other-month, .cmb2-element .ui-datepicker td.ui-datepicker-other-month {
1272
- border: transparent;
1273
- }
1274
- /* line 175, sass/partials/_jquery_ui.scss */
1275
- .cmb2-element.ui-datepicker td.ui-datepicker-week-end, .cmb2-element .ui-datepicker td.ui-datepicker-week-end {
1276
- background-color: #f4f4f4;
1277
- border: 1px solid #f4f4f4;
1278
- }
1279
- /* line 178, sass/partials/_jquery_ui.scss */
1280
- .cmb2-element.ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today, .cmb2-element .ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today {
1281
- -webkit-box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
1282
- -moz-box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
1283
- box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
1284
- }
1285
- /* line 185, sass/partials/_jquery_ui.scss */
1286
- .cmb2-element.ui-datepicker td.ui-datepicker-today, .cmb2-element .ui-datepicker td.ui-datepicker-today {
1287
- background-color: #f0f0c0;
1288
- }
1289
- /* line 189, sass/partials/_jquery_ui.scss */
1290
- .cmb2-element.ui-datepicker td.ui-datepicker-current-day, .cmb2-element .ui-datepicker td.ui-datepicker-current-day {
1291
- background: #bbdd88;
1292
- }
1293
- /* line 193, sass/partials/_jquery_ui.scss */
1294
- .cmb2-element.ui-datepicker td .ui-state-default, .cmb2-element .ui-datepicker td .ui-state-default {
1295
- background: transparent;
1296
- border: none;
1297
- text-align: center;
1298
- text-decoration: none;
1299
- width: auto;
1300
- display: block;
1301
- padding: 5px 10px;
1302
- font-weight: normal;
1303
- color: #444;
1304
- }
1305
- /* line 205, sass/partials/_jquery_ui.scss */
1306
- .cmb2-element.ui-datepicker td.ui-state-disabled .ui-state-default, .cmb2-element .ui-datepicker td.ui-state-disabled .ui-state-default {
1307
- opacity: 0.5;
1308
- }
1309
- /* line 210, sass/partials/_jquery_ui.scss */
1310
- .cmb2-element.ui-datepicker .ui-widget-header,
1311
- .cmb2-element.ui-datepicker .ui-datepicker-header, .cmb2-element .ui-datepicker .ui-widget-header,
1312
- .cmb2-element .ui-datepicker .ui-datepicker-header {
1313
- background: #00a0d2;
1314
- }
1315
- /* line 215, sass/partials/_jquery_ui.scss */
1316
- .cmb2-element.ui-datepicker thead, .cmb2-element .ui-datepicker thead {
1317
- background: #32373c;
1318
- }
1319
- /* line 219, sass/partials/_jquery_ui.scss */
1320
- .cmb2-element.ui-datepicker td .ui-state-hover, .cmb2-element.ui-datepicker td .ui-state-active, .cmb2-element .ui-datepicker td .ui-state-hover, .cmb2-element .ui-datepicker td .ui-state-active {
1321
- background: #0073aa;
1322
- color: #fff;
1323
- }
1324
- /* line 224, sass/partials/_jquery_ui.scss */
1325
- .cmb2-element.ui-datepicker .ui-timepicker-div, .cmb2-element .ui-datepicker .ui-timepicker-div {
1326
- font-size: 14px;
1327
- }
1328
- /* line 226, sass/partials/_jquery_ui.scss */
1329
- .cmb2-element.ui-datepicker .ui-timepicker-div dl, .cmb2-element .ui-datepicker .ui-timepicker-div dl {
1330
- text-align: right;
1331
- padding: 0 .6em;
1332
- }
1333
- /* line 229, sass/partials/_jquery_ui.scss */
1334
- .cmb2-element.ui-datepicker .ui-timepicker-div dl dt, .cmb2-element .ui-datepicker .ui-timepicker-div dl dt {
1335
- float: right;
1336
- clear: right;
1337
- padding: 0 5px 0 0;
1338
- }
1339
- /* line 234, sass/partials/_jquery_ui.scss */
1340
- .cmb2-element.ui-datepicker .ui-timepicker-div dl dd, .cmb2-element .ui-datepicker .ui-timepicker-div dl dd {
1341
- margin: 0 40% 10px 10px;
1342
- }
1343
- /* line 236, sass/partials/_jquery_ui.scss */
1344
- .cmb2-element.ui-datepicker .ui-timepicker-div dl dd select, .cmb2-element .ui-datepicker .ui-timepicker-div dl dd select {
1345
- width: 100%;
1346
- }
1347
- /* line 242, sass/partials/_jquery_ui.scss */
1348
- .cmb2-element.ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane, .cmb2-element .ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane {
1349
- padding: .6em;
1350
- text-align: right;
1351
- }
1352
- /* line 246, sass/partials/_jquery_ui.scss */
1353
- .cmb2-element.ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-primary, .cmb2-element.ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-secondary, .cmb2-element .ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-primary, .cmb2-element .ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-secondary {
1354
- padding: 0 10px 1px;
1355
- -webkit-border-radius: 3px;
1356
- -moz-border-radius: 3px;
1357
- border-radius: 3px;
1358
- margin: 0 .4em .4em .6em;
1359
- }
1360
-
1361
- /* line 260, sass/partials/_jquery_ui.scss */
1362
- .admin-color-fresh .cmb2-element.ui-datepicker .ui-widget-header,
1363
- .admin-color-fresh .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-fresh .cmb2-element .ui-datepicker .ui-widget-header,
1364
- .admin-color-fresh .cmb2-element .ui-datepicker .ui-datepicker-header {
1365
- background: #00a0d2;
1366
- }
1367
- /* line 265, sass/partials/_jquery_ui.scss */
1368
- .admin-color-fresh .cmb2-element.ui-datepicker thead, .admin-color-fresh .cmb2-element .ui-datepicker thead {
1369
- background: #32373c;
1370
- }
1371
- /* line 269, sass/partials/_jquery_ui.scss */
1372
- .admin-color-fresh .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-fresh .cmb2-element .ui-datepicker td .ui-state-hover {
1373
- background: #0073aa;
1374
- color: #fff;
1375
- }
1376
-
1377
- /* line 277, sass/partials/_jquery_ui.scss */
1378
- .admin-color-blue .cmb2-element.ui-datepicker .ui-widget-header,
1379
- .admin-color-blue .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-blue .cmb2-element .ui-datepicker .ui-widget-header,
1380
- .admin-color-blue .cmb2-element .ui-datepicker .ui-datepicker-header {
1381
- background: #52accc;
1382
- }
1383
- /* line 282, sass/partials/_jquery_ui.scss */
1384
- .admin-color-blue .cmb2-element.ui-datepicker thead, .admin-color-blue .cmb2-element .ui-datepicker thead {
1385
- background: #4796b3;
1386
- }
1387
- /* line 291, sass/partials/_jquery_ui.scss */
1388
- .admin-color-blue .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-blue .cmb2-element.ui-datepicker td .ui-state-active, .admin-color-blue .cmb2-element .ui-datepicker td .ui-state-hover, .admin-color-blue .cmb2-element .ui-datepicker td .ui-state-active {
1389
- background: #096484;
1390
- color: #fff;
1391
- }
1392
- /* line 296, sass/partials/_jquery_ui.scss */
1393
- .admin-color-blue .cmb2-element.ui-datepicker td.ui-datepicker-today, .admin-color-blue .cmb2-element .ui-datepicker td.ui-datepicker-today {
1394
- background: #eee;
1395
- }
1396
-
1397
- /* line 305, sass/partials/_jquery_ui.scss */
1398
- .admin-color-coffee .cmb2-element.ui-datepicker .ui-widget-header,
1399
- .admin-color-coffee .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-coffee .cmb2-element .ui-datepicker .ui-widget-header,
1400
- .admin-color-coffee .cmb2-element .ui-datepicker .ui-datepicker-header {
1401
- background: #59524c;
1402
- }
1403
- /* line 310, sass/partials/_jquery_ui.scss */
1404
- .admin-color-coffee .cmb2-element.ui-datepicker thead, .admin-color-coffee .cmb2-element .ui-datepicker thead {
1405
- background: #46403c;
1406
- }
1407
- /* line 314, sass/partials/_jquery_ui.scss */
1408
- .admin-color-coffee .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-coffee .cmb2-element .ui-datepicker td .ui-state-hover {
1409
- background: #c7a589;
1410
- color: #fff;
1411
- }
1412
-
1413
- /* line 322, sass/partials/_jquery_ui.scss */
1414
- .admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-widget-header,
1415
- .admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-widget-header,
1416
- .admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-datepicker-header {
1417
- background: #523f6d;
1418
- }
1419
- /* line 327, sass/partials/_jquery_ui.scss */
1420
- .admin-color-ectoplasm .cmb2-element.ui-datepicker thead, .admin-color-ectoplasm .cmb2-element .ui-datepicker thead {
1421
- background: #413256;
1422
- }
1423
- /* line 331, sass/partials/_jquery_ui.scss */
1424
- .admin-color-ectoplasm .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-ectoplasm .cmb2-element .ui-datepicker td .ui-state-hover {
1425
- background: #a3b745;
1426
- color: #fff;
1427
- }
1428
-
1429
- /* line 339, sass/partials/_jquery_ui.scss */
1430
- .admin-color-midnight .cmb2-element.ui-datepicker .ui-widget-header,
1431
- .admin-color-midnight .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-midnight .cmb2-element .ui-datepicker .ui-widget-header,
1432
- .admin-color-midnight .cmb2-element .ui-datepicker .ui-datepicker-header {
1433
- background: #363b3f;
1434
- }
1435
- /* line 344, sass/partials/_jquery_ui.scss */
1436
- .admin-color-midnight .cmb2-element.ui-datepicker thead, .admin-color-midnight .cmb2-element .ui-datepicker thead {
1437
- background: #26292c;
1438
- }
1439
- /* line 348, sass/partials/_jquery_ui.scss */
1440
- .admin-color-midnight .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-midnight .cmb2-element .ui-datepicker td .ui-state-hover {
1441
- background: #e14d43;
1442
- color: #fff;
1443
- }
1444
-
1445
- /* line 356, sass/partials/_jquery_ui.scss */
1446
- .admin-color-ocean .cmb2-element.ui-datepicker .ui-widget-header,
1447
- .admin-color-ocean .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-ocean .cmb2-element .ui-datepicker .ui-widget-header,
1448
- .admin-color-ocean .cmb2-element .ui-datepicker .ui-datepicker-header {
1449
- background: #738e96;
1450
- }
1451
- /* line 361, sass/partials/_jquery_ui.scss */
1452
- .admin-color-ocean .cmb2-element.ui-datepicker thead, .admin-color-ocean .cmb2-element .ui-datepicker thead {
1453
- background: #627c83;
1454
- }
1455
- /* line 365, sass/partials/_jquery_ui.scss */
1456
- .admin-color-ocean .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-ocean .cmb2-element .ui-datepicker td .ui-state-hover {
1457
- background: #9ebaa0;
1458
- color: #fff;
1459
- }
1460
-
1461
- /* line 373, sass/partials/_jquery_ui.scss */
1462
- .admin-color-sunrise .cmb2-element.ui-datepicker .ui-widget-header,
1463
- .admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header,
1464
- .admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover, .admin-color-sunrise .cmb2-element .ui-datepicker .ui-widget-header,
1465
- .admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header,
1466
- .admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover {
1467
- background: #cf4944;
1468
- }
1469
- /* line 379, sass/partials/_jquery_ui.scss */
1470
- .admin-color-sunrise .cmb2-element.ui-datepicker th, .admin-color-sunrise .cmb2-element .ui-datepicker th {
1471
- border-color: #be3631;
1472
- background: #be3631;
1473
- }
1474
- /* line 384, sass/partials/_jquery_ui.scss */
1475
- .admin-color-sunrise .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-sunrise .cmb2-element .ui-datepicker td .ui-state-hover {
1476
- background: #dd823b;
1477
- color: #fff;
1478
- }
1479
-
1480
- /* line 392, sass/partials/_jquery_ui.scss */
1481
- .admin-color-light .cmb2-element.ui-datepicker .ui-widget-header,
1482
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-light .cmb2-element .ui-datepicker .ui-widget-header,
1483
- .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-header {
1484
- background: #e5e5e5;
1485
- }
1486
- /* line 397, sass/partials/_jquery_ui.scss */
1487
- .admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-month,
1488
- .admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-year, .admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-month,
1489
- .admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-year {
1490
- color: #555;
1491
- }
1492
- /* line 402, sass/partials/_jquery_ui.scss */
1493
- .admin-color-light .cmb2-element.ui-datepicker thead, .admin-color-light .cmb2-element .ui-datepicker thead {
1494
- background: #888;
1495
- }
1496
- /* line 406, sass/partials/_jquery_ui.scss */
1497
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-title,
1498
- .admin-color-light .cmb2-element.ui-datepicker td .ui-state-default,
1499
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-prev:before,
1500
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-next:before, .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-title,
1501
- .admin-color-light .cmb2-element .ui-datepicker td .ui-state-default,
1502
- .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-prev:before,
1503
- .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-next:before {
1504
- color: #555;
1505
- }
1506
- /* line 414, sass/partials/_jquery_ui.scss */
1507
- .admin-color-light .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-light .cmb2-element.ui-datepicker td .ui-state-active, .admin-color-light .cmb2-element .ui-datepicker td .ui-state-hover, .admin-color-light .cmb2-element .ui-datepicker td .ui-state-active {
1508
- background: #ccc;
1509
- }
1510
- /* line 418, sass/partials/_jquery_ui.scss */
1511
- .admin-color-light .cmb2-element.ui-datepicker td.ui-datepicker-today, .admin-color-light .cmb2-element .ui-datepicker td.ui-datepicker-today {
1512
- background: #eee;
1513
- }
1514
-
1515
- /* line 426, sass/partials/_jquery_ui.scss */
1516
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-widget-header,
1517
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-widget-header,
1518
- .admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-datepicker-header {
1519
- background: #56b274;
1520
- }
1521
- /* line 431, sass/partials/_jquery_ui.scss */
1522
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker thead, .admin-color-bbp-evergreen .cmb2-element .ui-datepicker thead {
1523
- background: #36533f;
1524
- }
1525
- /* line 435, sass/partials/_jquery_ui.scss */
1526
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-bbp-evergreen .cmb2-element .ui-datepicker td .ui-state-hover {
1527
- background: #446950;
1528
- color: #fff;
1529
- }
1530
-
1531
- /* line 443, sass/partials/_jquery_ui.scss */
1532
- .admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-widget-header,
1533
- .admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-widget-header,
1534
- .admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-datepicker-header {
1535
- background: #4ca26a;
1536
- }
1537
- /* line 448, sass/partials/_jquery_ui.scss */
1538
- .admin-color-bbp-mint .cmb2-element.ui-datepicker thead, .admin-color-bbp-mint .cmb2-element .ui-datepicker thead {
1539
- background: #4f6d59;
1540
- }
1541
- /* line 452, sass/partials/_jquery_ui.scss */
1542
- .admin-color-bbp-mint .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-bbp-mint .cmb2-element .ui-datepicker td .ui-state-hover {
1543
- background: #5fb37c;
1544
- color: #fff;
1545
- }
1546
-
1547
- /*--------------------------------------------------------------
1548
- * Character counter
1549
- --------------------------------------------------------------*/
1550
- /* line 5, sass/partials/_char_counter.scss */
1551
- .cmb2-char-counter-wrap {
1552
- margin: .5em 0 1em;
1553
- }
1554
- /* line 8, sass/partials/_char_counter.scss */
1555
- .cmb2-char-counter-wrap input[type="text"] {
1556
- font-size: 12px;
1557
- width: 25px;
1558
- }
1559
- /* line 14, sass/partials/_char_counter.scss */
1560
- .cmb2-char-counter-wrap.cmb2-max-exceeded input[type="text"] {
1561
- border-color: #a00 !important;
1562
- }
1563
- /* line 17, sass/partials/_char_counter.scss */
1564
- .cmb2-char-counter-wrap.cmb2-max-exceeded .cmb2-char-max-msg {
1565
- display: inline-block;
1566
- }
1567
-
1568
- /* line 23, sass/partials/_char_counter.scss */
1569
- .cmb2-char-max-msg {
1570
- color: #a00;
1571
- display: none;
1572
- font-weight: 600;
1573
- margin-right: 1em;
1574
- }
1575
-
1576
- /*# sourceMappingURL=cmb2.css.map */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/css/cmb2-rtl.min.css DELETED
@@ -1 +0,0 @@
1
- @charset "UTF-8";.cmb2-wrap{margin:0}.cmb2-wrap input,.cmb2-wrap textarea{max-width:100%}.cmb2-wrap input[type=text].cmb2-oembed{width:100%}.cmb2-wrap textarea{width:500px;padding:8px}.cmb2-wrap textarea.cmb2-textarea-code{font-family:"Courier 10 Pitch",Courier,monospace;line-height:16px}.cmb2-wrap input.cmb2-text-small,.cmb2-wrap input.cmb2-timepicker{width:100px}.cmb2-wrap input.cmb2-text-money{width:90px}.cmb2-wrap input.cmb2-text-medium{width:230px}.cmb2-wrap input.cmb2-upload-file{width:65%}.cmb2-wrap input.ed_button{padding:2px 4px}.cmb2-wrap input:not([type=hidden])+.button-secondary,.cmb2-wrap input:not([type=hidden])+input,.cmb2-wrap input:not([type=hidden])+select{margin-right:20px}.cmb2-wrap ul{margin:0}.cmb2-wrap li{font-size:14px;line-height:16px;margin:1px 0 5px 0}.cmb2-wrap select{font-size:14px;margin-top:3px}.cmb2-wrap input:focus,.cmb2-wrap textarea:focus{background:#fffff8}.cmb2-wrap input[type=radio]{margin:0 0 0 5px;padding:0}.cmb2-wrap input[type=checkbox]{margin:0 0 0 5px;padding:0}.cmb2-wrap .button-secondary,.cmb2-wrap button{white-space:nowrap}.cmb2-wrap .mceLayout{border:1px solid #e9e9e9!important}.cmb2-wrap .mceIframeContainer{background:#fff}.cmb2-wrap .meta_mce{width:97%}.cmb2-wrap .meta_mce textarea{width:100%}.cmb2-wrap .cmb-multicheck-toggle{margin-top:-1em}.cmb2-wrap .wp-picker-clear.button,.cmb2-wrap .wp-picker-default.button{margin-right:6px;padding:2px 8px}.cmb2-wrap .cmb-row{margin:0}.cmb2-wrap .cmb-row:after{content:'';clear:both;display:block;width:100%}.cmb2-wrap .cmb-row.cmb-repeat .cmb2-metabox-description{padding-top:0;padding-bottom:1em}body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type=radio]::before{margin:.1875rem}@media screen and (max-width:782px){body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type=radio]::before{margin:.4375rem}}.cmb2-metabox{clear:both;margin:0}.cmb2-metabox .cmb-field-list>.cmb-row:first-of-type>.cmb-td,.cmb2-metabox .cmb-field-list>.cmb-row:first-of-type>.cmb-th,.cmb2-metabox>.cmb-row:first-of-type>.cmb-td,.cmb2-metabox>.cmb-row:first-of-type>.cmb-th{border:0}.cmb-add-row{margin:1.8em 0 0}.cmb-nested .cmb-td,.cmb-repeatable-group .cmb-th,.cmb-repeatable-group:first-of-type{border:0}.cmb-repeatable-group:last-of-type,.cmb-row:last-of-type,.cmb2-wrap .cmb-row:last-of-type{border-bottom:0}.cmb-repeatable-grouping{border:1px solid #e9e9e9;padding:0 1em}.cmb-repeatable-grouping.cmb-row{margin:0 0 .8em}.cmb-th{color:#222;float:right;font-weight:600;padding:20px 0 20px 10px;vertical-align:top;width:200px}@media (max-width:450px){.cmb-th{font-size:1.2em;display:block;float:none;padding-bottom:1em;text-align:right;width:100%}.cmb-th label{display:block;margin-top:0;margin-bottom:.5em}}.cmb-td{line-height:1.3;max-width:100%;padding:15px 10px;vertical-align:middle}.cmb-type-title .cmb-td{padding:0}.cmb-th label{display:block;padding:5px 0}.cmb-th+.cmb-td{float:right}.cmb-td .cmb-td{padding-bottom:1em}.cmb-remove-row{text-align:left}.empty-row.hidden{display:none}.cmb-repeat-table{background-color:#fafafa;border:1px solid #e1e1e1}.cmb-repeat-table .cmb-row.cmb-repeat-row{position:relative;counter-increment:el;margin:0;padding:10px 50px 10px 10px;border-bottom:none!important}.cmb-repeat-table .cmb-row.cmb-repeat-row+.cmb-repeat-row{border-top:solid 1px #e9e9e9}.cmb-repeat-table .cmb-row.cmb-repeat-row.ui-sortable-helper{outline:dashed 2px #e9e9e9!important}.cmb-repeat-table .cmb-row.cmb-repeat-row:before{content:counter(el);display:block;top:0;right:0;position:absolute;width:35px;height:100%;line-height:35px;cursor:move;color:#757575;text-align:center;border-left:solid 1px #e9e9e9}.cmb-repeat-table .cmb-row.cmb-repeat-row .cmb-td{margin:0;padding:0}.cmb-repeat-table+.cmb-add-row{margin:0}.cmb-repeat-table+.cmb-add-row:before{content:'';width:1px;height:1.6em;display:block;margin-right:17px;background-color:#dcdcdc}.cmb-repeat-table .cmb-remove-row{top:7px;left:7px;position:absolute;width:auto;margin-right:0;padding:0!important;display:none}.cmb-repeat-table .cmb-remove-row>.cmb-remove-row-button{font-size:20px;text-indent:-1000px;overflow:hidden;position:relative;height:auto;line-height:1;padding:0 10px 0}.cmb-repeat-table .cmb-remove-row>.cmb-remove-row-button:before{content:"";font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;right:0;width:100%;height:100%;text-align:center}.cmb-repeat-table .cmb-repeat-row:hover .cmb-remove-row{display:block}.cmb-repeatable-group .cmb-th{padding:5px}.cmb-repeatable-group .cmb-group-title{background-color:#e9e9e9;padding:8px 2.2em 8px 12px;margin:0 -1em;min-height:1.5em;font-size:14px;line-height:1.4}.cmb-repeatable-group .cmb-group-title h4{border:0;margin:0;font-size:1.2em;font-weight:500;padding:.5em .75em}.cmb-repeatable-group .cmb-group-title .cmb-th{display:block;width:100%}.cmb-repeatable-group .cmb-group-description .cmb-th{font-size:1.2em;display:block;float:none;padding-bottom:1em;text-align:right;width:100%}.cmb-repeatable-group .cmb-group-description .cmb-th label{display:block;margin-top:0;margin-bottom:.5em}.cmb-repeatable-group .cmb-shift-rows{margin-left:1em}.cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-up-alt2{margin-top:.15em}.cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-down-alt2{margin-top:.2em}.cmb-repeatable-group .cmb2-upload-button{float:left}p.cmb2-metabox-description{color:#666;letter-spacing:.01em;margin:0;padding-top:.5em}span.cmb2-metabox-description{color:#666;letter-spacing:.01em}.cmb2-metabox-title{margin:0 0 5px 0;padding:5px 0 0 0;font-size:14px}.cmb-inline ul{padding:4px 0 0 0}.cmb-inline li{display:inline-block;padding-left:18px}.cmb-type-textarea-code pre{margin:0}.cmb2-media-status .img-status{clear:none;display:inline-block;vertical-align:middle;margin-left:10px;width:auto}.cmb2-media-status .img-status img{max-width:350px;height:auto}.cmb2-media-status .embed-status,.cmb2-media-status .img-status img{background:#eee;border:5px solid #fff;outline:1px solid #e9e9e9;box-shadow:inset 0 0 15px rgba(0,0,0,.3),inset 0 0 0 1px rgba(0,0,0,.05);background-image:linear-gradient(45deg,#d0d0d0 25%,transparent 25%,transparent 75%,#d0d0d0 75%,#d0d0d0),linear-gradient(45deg,#d0d0d0 25%,transparent 25%,transparent 75%,#d0d0d0 75%,#d0d0d0);background-position:0 0,10px 10px;background-size:20px 20px;border-radius:2px;-moz-border-radius:2px;margin:15px 0 0 0}.cmb2-media-status .embed-status{float:right;max-width:800px}.cmb2-media-status .embed-status,.cmb2-media-status .img-status{position:relative}.cmb2-media-status .embed-status .cmb2-remove-file-button,.cmb2-media-status .img-status .cmb2-remove-file-button{background:url(../images/ico-delete.png);height:16px;right:-5px;position:absolute;text-indent:-9999px;top:-5px;width:16px}.cmb2-media-status .img-status .cmb2-remove-file-button{top:10px}.cmb2-media-status .file-status>span,.cmb2-media-status .img-status img{cursor:pointer}.cmb2-media-status.cmb-attach-list .file-status>span,.cmb2-media-status.cmb-attach-list .img-status img{cursor:move}.cmb-type-file-list .cmb2-media-status .img-status{clear:none;vertical-align:middle;width:auto;margin-left:10px;margin-bottom:10px;margin-top:0}.cmb-attach-list li{clear:both;display:inline-block;width:100%;margin-top:5px;margin-bottom:10px}.cmb-attach-list li img{float:right;margin-left:10px}.cmb2-remove-wrapper{margin:0}.child-cmb2 .cmb-th{text-align:right}.cmb2-indented-hierarchy{padding-right:1.5em}@media (max-width:450px){.cmb-td,.cmb-th,.cmb-th+.cmb-td{display:block;float:none;width:100%}}#poststuff .cmb-group-title{margin-right:-1em;margin-left:-1em;min-height:1.5em}#poststuff .repeatable .cmb-group-title{padding-right:2.2em}.cmb-type-group .cmb2-wrap,.cmb2-postbox .cmb2-wrap{margin:0}.cmb-type-group .cmb2-wrap>.cmb-field-list>.cmb-row,.cmb2-postbox .cmb2-wrap>.cmb-field-list>.cmb-row{padding:1.8em 0}.cmb-type-group .cmb2-wrap input[type=text].cmb2-oembed,.cmb2-postbox .cmb2-wrap input[type=text].cmb2-oembed{width:100%}.cmb-type-group .cmb-row,.cmb2-postbox .cmb-row{padding:0 0 1.8em;margin:0 0 .8em}.cmb-type-group .cmb-row .cmbhandle,.cmb2-postbox .cmb-row .cmbhandle{left:-1em;position:relative;color:#222}.cmb-type-group .cmb-repeatable-grouping,.cmb2-postbox .cmb-repeatable-grouping{padding:0 1em;max-width:100%;min-width:1px!important}.cmb-type-group .cmb-repeatable-group>.cmb-row,.cmb2-postbox .cmb-repeatable-group>.cmb-row{padding-bottom:0}.cmb-type-group .cmb-th,.cmb2-postbox .cmb-th{width:18%;padding:0 0 0 2%}.cmb-type-group .cmb-td,.cmb2-postbox .cmb-td{margin-bottom:0;padding:0;line-height:1.3}.cmb-type-group .cmb-th+.cmb-td,.cmb2-postbox .cmb-th+.cmb-td{width:80%;float:left}.cmb-type-group .cmb-repeatable-group:not(:last-of-type),.cmb-type-group .cmb-row:not(:last-of-type),.cmb2-postbox .cmb-repeatable-group:not(:last-of-type),.cmb2-postbox .cmb-row:not(:last-of-type){border-bottom:1px solid #e9e9e9}@media (max-width:450px){.cmb-type-group .cmb-repeatable-group:not(:last-of-type),.cmb-type-group .cmb-row:not(:last-of-type),.cmb2-postbox .cmb-repeatable-group:not(:last-of-type),.cmb2-postbox .cmb-row:not(:last-of-type){border-bottom:0}}.cmb-type-group .cmb-remove-field-row,.cmb-type-group .cmb-repeat-group-field,.cmb2-postbox .cmb-remove-field-row,.cmb2-postbox .cmb-repeat-group-field{padding-top:1.8em}.js .cmb2-postbox.context-box .handlediv{text-align:center}.js .cmb2-postbox.context-box .toggle-indicator:before{content:"\f142";display:inline-block;font:normal 20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.js .cmb2-postbox.context-box.closed .toggle-indicator:before{content:"\f140"}.cmb2-postbox.context-box{margin-bottom:10px}.cmb2-postbox.context-box.context-before_permalink-box{margin-top:10px}.cmb2-postbox.context-box.context-after_title-box{margin-top:10px}.cmb2-postbox.context-box.context-after_editor-box{margin-top:20px;margin-bottom:0}.cmb2-postbox.context-box.context-form_top-box{margin-top:10px}.cmb2-postbox.context-box.context-form_top-box .hndle{font-size:14px;padding:8px 12px;margin:0;line-height:1.4}.cmb2-postbox.context-box .hndle{cursor:auto}.cmb2-context-wrap{margin-top:10px}.cmb2-context-wrap.cmb2-context-wrap-form_top{margin-left:300px;width:auto}.cmb2-context-wrap.cmb2-context-wrap-no-title .cmb2-metabox{padding:10px}.cmb2-context-wrap .cmb-th{padding:0 0 0 2%;width:18%}.cmb2-context-wrap .cmb-td{width:80%;padding:0}.cmb2-context-wrap .cmb-row{margin-bottom:10px}.cmb2-context-wrap .cmb-row:last-of-type{margin-bottom:0}@media only screen and (max-width:850px){.cmb2-context-wrap.cmb2-context-wrap-form_top{margin-left:0}}.cmb2-options-page{max-width:1200px}.cmb2-options-page.wrap>h2{margin-bottom:1em}.cmb2-options-page .cmb2-metabox>.cmb-row{padding:1em;margin-top:-1px;background:#fff;border:1px solid #e9e9e9;box-shadow:0 1px 1px rgba(0,0,0,.05)}.cmb2-options-page .cmb2-metabox>.cmb-row>.cmb-th{padding:0;font-weight:initial}.cmb2-options-page .cmb2-metabox>.cmb-row>.cmb-th+.cmb-td{float:none;padding:0 1em 0 0;margin-right:200px}@media (max-width:450px){.cmb2-options-page .cmb2-metabox>.cmb-row>.cmb-th+.cmb-td{padding:0;margin-right:0}}.cmb2-options-page .cmb2-wrap .cmb-type-title{margin-top:1em;padding:.6em 1em;background-color:#fafafa}.cmb2-options-page .cmb2-wrap .cmb-type-title .cmb2-metabox-title{font-size:12px;margin-top:0;margin-bottom:0;text-transform:uppercase}.cmb2-options-page .cmb2-wrap .cmb-type-title .cmb2-metabox-description{padding-top:.25em}.cmb2-options-page .cmb-repeatable-group .cmb-group-description .cmb-th{padding:0 0 .8em 0}.cmb2-options-page .cmb-repeatable-group .cmb-group-name{font-size:16px;margin-top:0;margin-bottom:0}.cmb2-options-page .cmb-repeatable-group .cmb-th>.cmb2-metabox-description{font-weight:400;padding-bottom:0!important}#addtag .cmb-th{float:none;width:auto;padding:20px 0 0}#addtag .cmb-td{padding:0}#addtag .cmb-th+.cmb-td{float:none}#addtag select{max-width:100%}#addtag .cmb2-metabox{padding-bottom:20px}#addtag .cmb-row li label{display:inline}#poststuff .cmb-repeatable-group h2{margin:0}.edit-tags-php .cmb2-metabox-title,.profile-php .cmb2-metabox-title,.user-edit-php .cmb2-metabox-title{font-size:1.4em}.cmb2-no-box-wrap .cmb-spinner,.cmb2-postbox .cmb-spinner{float:right;display:none}.cmb-spinner{display:none}.cmb-spinner.is-active{display:block}#side-sortables .cmb2-wrap>.cmb-field-list>.cmb-row,.inner-sidebar .cmb2-wrap>.cmb-field-list>.cmb-row{padding:1.4em 0}#side-sortables .cmb2-wrap input[type=text]:not(.wp-color-picker),.inner-sidebar .cmb2-wrap input[type=text]:not(.wp-color-picker){width:100%}#side-sortables .cmb2-wrap input+input:not(.wp-picker-clear),#side-sortables .cmb2-wrap input+select,.inner-sidebar .cmb2-wrap input+input:not(.wp-picker-clear),.inner-sidebar .cmb2-wrap input+select{margin-right:0;margin-top:1em;display:block}#side-sortables .cmb2-wrap input.cmb2-text-money,.inner-sidebar .cmb2-wrap input.cmb2-text-money{max-width:70%}#side-sortables .cmb2-wrap input.cmb2-text-money+.cmb2-metabox-description,.inner-sidebar .cmb2-wrap input.cmb2-text-money+.cmb2-metabox-description{display:block}#side-sortables .cmb2-wrap label,.inner-sidebar .cmb2-wrap label{display:block;font-weight:700;padding:0 0 5px}#side-sortables textarea,.inner-sidebar textarea{max-width:99%}#side-sortables .cmb-repeatable-group,.inner-sidebar .cmb-repeatable-group{border-bottom:1px solid #e9e9e9}#side-sortables .cmb-type-group>.cmb-td>.cmb-repeatable-group,.inner-sidebar .cmb-type-group>.cmb-td>.cmb-repeatable-group{border-bottom:0;margin-bottom:-1.4em}#side-sortables .cmb-td:not(.cmb-remove-row),#side-sortables .cmb-th,#side-sortables .cmb-th+.cmb-td,.inner-sidebar .cmb-td:not(.cmb-remove-row),.inner-sidebar .cmb-th,.inner-sidebar .cmb-th+.cmb-td{width:100%;display:block;float:none}#side-sortables .closed .inside,.inner-sidebar .closed .inside{display:none}#side-sortables .cmb-th,.inner-sidebar .cmb-th{display:block;float:none;padding-bottom:1em;text-align:right;width:100%;padding-right:0;padding-left:0}#side-sortables .cmb-th label,.inner-sidebar .cmb-th label{display:block;margin-top:0;margin-bottom:.5em}#side-sortables .cmb-th label,.inner-sidebar .cmb-th label{font-size:14px;line-height:1.4em}#side-sortables .cmb-group-description .cmb-th,.inner-sidebar .cmb-group-description .cmb-th{padding-top:0}#side-sortables .cmb-group-description .cmb2-metabox-description,.inner-sidebar .cmb-group-description .cmb2-metabox-description{padding:0}#side-sortables .cmb-group-title .cmb-th,.inner-sidebar .cmb-group-title .cmb-th{padding:0}#side-sortables .cmb-repeatable-grouping+.cmb-repeatable-grouping,.inner-sidebar .cmb-repeatable-grouping+.cmb-repeatable-grouping{margin-top:1em}#side-sortables .cmb2-media-status .embed-status img,#side-sortables .cmb2-media-status .img-status img,.inner-sidebar .cmb2-media-status .embed-status img,.inner-sidebar .cmb2-media-status .img-status img{max-width:90%;height:auto}#side-sortables .cmb2-list label,.inner-sidebar .cmb2-list label{display:inline;font-weight:400}#side-sortables .cmb2-metabox-description,.inner-sidebar .cmb2-metabox-description{display:block;padding:7px 0 0}#side-sortables .cmb-type-checkbox .cmb-td label,#side-sortables .cmb-type-checkbox .cmb2-metabox-description,.inner-sidebar .cmb-type-checkbox .cmb-td label,.inner-sidebar .cmb-type-checkbox .cmb2-metabox-description{font-weight:400;display:inline}#side-sortables .cmb-row .cmb2-metabox-description,.inner-sidebar .cmb-row .cmb2-metabox-description{padding-bottom:1.8em}#side-sortables .cmb2-metabox-title,.inner-sidebar .cmb2-metabox-title{font-size:1.2em;font-style:italic}#side-sortables .cmb-remove-row,.inner-sidebar .cmb-remove-row{clear:both;padding-top:12px;padding-bottom:0}#side-sortables .cmb2-upload-button,.inner-sidebar .cmb2-upload-button{clear:both;margin-top:12px}.cmb2-metabox .cmbhandle{color:#757575;float:left;width:27px;height:30px;cursor:pointer;left:-1em;position:relative}.cmb2-metabox .cmbhandle:before{content:'\f142';left:12px;font:normal 20px/1 dashicons;speak:none;display:inline-block;padding:8px 10px;top:0;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.cmb2-metabox .postbox.closed .cmbhandle:before{content:'\f140'}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row{-webkit-appearance:none!important;background:0 0!important;border:none!important;position:absolute;right:0;top:.5em;line-height:1em;padding:2px 6px 3px;opacity:.5}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]){cursor:pointer;color:#a00;opacity:1}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]):hover{color:red}* html .cmb2-element.ui-helper-clearfix{height:1%}.cmb2-element .ui-datepicker,.cmb2-element.ui-datepicker{padding:0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;background-color:#fff;border:1px solid #dfdfdf;border-top:none;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.075);box-shadow:0 3px 6px rgba(0,0,0,.075);min-width:17em;width:auto}.cmb2-element .ui-datepicker *,.cmb2-element.ui-datepicker *{padding:0;font-family:"Open Sans",sans-serif;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.cmb2-element .ui-datepicker table,.cmb2-element.ui-datepicker table{font-size:13px;margin:0;border:none;border-collapse:collapse}.cmb2-element .ui-datepicker .ui-datepicker-header,.cmb2-element .ui-datepicker .ui-widget-header,.cmb2-element.ui-datepicker .ui-datepicker-header,.cmb2-element.ui-datepicker .ui-widget-header{background-image:none;border:none;color:#fff;font-weight:400}.cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover,.cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover{background:0 0;border-color:transparent;cursor:pointer}.cmb2-element .ui-datepicker .ui-datepicker-title,.cmb2-element.ui-datepicker .ui-datepicker-title{margin:0;padding:10px 0;color:#fff;font-size:14px;line-height:14px;text-align:center}.cmb2-element .ui-datepicker .ui-datepicker-title select,.cmb2-element.ui-datepicker .ui-datepicker-title select{margin-top:-8px;margin-bottom:-8px}.cmb2-element .ui-datepicker .ui-datepicker-next,.cmb2-element .ui-datepicker .ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-datepicker-next,.cmb2-element.ui-datepicker .ui-datepicker-prev{position:relative;top:0;height:34px;width:34px}.cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-next,.cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-next,.cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-prev{border:none}.cmb2-element .ui-datepicker .ui-datepicker-prev,.cmb2-element .ui-datepicker .ui-datepicker-prev-hover,.cmb2-element.ui-datepicker .ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-datepicker-prev-hover{right:0}.cmb2-element .ui-datepicker .ui-datepicker-next,.cmb2-element .ui-datepicker .ui-datepicker-next-hover,.cmb2-element.ui-datepicker .ui-datepicker-next,.cmb2-element.ui-datepicker .ui-datepicker-next-hover{left:0}.cmb2-element .ui-datepicker .ui-datepicker-next span,.cmb2-element .ui-datepicker .ui-datepicker-prev span,.cmb2-element.ui-datepicker .ui-datepicker-next span,.cmb2-element.ui-datepicker .ui-datepicker-prev span{display:none}.cmb2-element .ui-datepicker .ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-datepicker-prev{float:right}.cmb2-element .ui-datepicker .ui-datepicker-next,.cmb2-element.ui-datepicker .ui-datepicker-next{float:left}.cmb2-element .ui-datepicker .ui-datepicker-next:before,.cmb2-element .ui-datepicker .ui-datepicker-prev:before,.cmb2-element.ui-datepicker .ui-datepicker-next:before,.cmb2-element.ui-datepicker .ui-datepicker-prev:before{font:normal 20px/34px dashicons;padding-right:7px;color:#fff;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:34px;height:34px}.cmb2-element .ui-datepicker .ui-datepicker-prev:before,.cmb2-element.ui-datepicker .ui-datepicker-prev:before{content:'\f341'}.cmb2-element .ui-datepicker .ui-datepicker-next:before,.cmb2-element.ui-datepicker .ui-datepicker-next:before{content:'\f345'}.cmb2-element .ui-datepicker .ui-datepicker-next-hover:before,.cmb2-element .ui-datepicker .ui-datepicker-prev-hover:before,.cmb2-element.ui-datepicker .ui-datepicker-next-hover:before,.cmb2-element.ui-datepicker .ui-datepicker-prev-hover:before{opacity:.7}.cmb2-element .ui-datepicker select.ui-datepicker-month,.cmb2-element .ui-datepicker select.ui-datepicker-year,.cmb2-element.ui-datepicker select.ui-datepicker-month,.cmb2-element.ui-datepicker select.ui-datepicker-year{width:33%;background:0 0;border-color:transparent;box-shadow:none;color:#fff}.cmb2-element .ui-datepicker select.ui-datepicker-month option,.cmb2-element .ui-datepicker select.ui-datepicker-year option,.cmb2-element.ui-datepicker select.ui-datepicker-month option,.cmb2-element.ui-datepicker select.ui-datepicker-year option{color:#333}.cmb2-element .ui-datepicker thead,.cmb2-element.ui-datepicker thead{color:#fff;font-weight:600}.cmb2-element .ui-datepicker thead th,.cmb2-element.ui-datepicker thead th{font-weight:400}.cmb2-element .ui-datepicker th,.cmb2-element.ui-datepicker th{padding:10px}.cmb2-element .ui-datepicker td,.cmb2-element.ui-datepicker td{padding:0;border:1px solid #f4f4f4}.cmb2-element .ui-datepicker td.ui-datepicker-other-month,.cmb2-element.ui-datepicker td.ui-datepicker-other-month{border:transparent}.cmb2-element .ui-datepicker td.ui-datepicker-week-end,.cmb2-element.ui-datepicker td.ui-datepicker-week-end{background-color:#f4f4f4;border:1px solid #f4f4f4}.cmb2-element .ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today,.cmb2-element.ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today{-webkit-box-shadow:inset 0 0 1px 0 rgba(0,0,0,.1);-moz-box-shadow:inset 0 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 0 1px 0 rgba(0,0,0,.1)}.cmb2-element .ui-datepicker td.ui-datepicker-today,.cmb2-element.ui-datepicker td.ui-datepicker-today{background-color:#f0f0c0}.cmb2-element .ui-datepicker td.ui-datepicker-current-day,.cmb2-element.ui-datepicker td.ui-datepicker-current-day{background:#bd8}.cmb2-element .ui-datepicker td .ui-state-default,.cmb2-element.ui-datepicker td .ui-state-default{background:0 0;border:none;text-align:center;text-decoration:none;width:auto;display:block;padding:5px 10px;font-weight:400;color:#444}.cmb2-element .ui-datepicker td.ui-state-disabled .ui-state-default,.cmb2-element.ui-datepicker td.ui-state-disabled .ui-state-default{opacity:.5}.cmb2-element .ui-datepicker .ui-datepicker-header,.cmb2-element .ui-datepicker .ui-widget-header,.cmb2-element.ui-datepicker .ui-datepicker-header,.cmb2-element.ui-datepicker .ui-widget-header{background:#00a0d2}.cmb2-element .ui-datepicker thead,.cmb2-element.ui-datepicker thead{background:#32373c}.cmb2-element .ui-datepicker td .ui-state-active,.cmb2-element .ui-datepicker td .ui-state-hover,.cmb2-element.ui-datepicker td .ui-state-active,.cmb2-element.ui-datepicker td .ui-state-hover{background:#0073aa;color:#fff}.cmb2-element .ui-datepicker .ui-timepicker-div,.cmb2-element.ui-datepicker .ui-timepicker-div{font-size:14px}.cmb2-element .ui-datepicker .ui-timepicker-div dl,.cmb2-element.ui-datepicker .ui-timepicker-div dl{text-align:right;padding:0 .6em}.cmb2-element .ui-datepicker .ui-timepicker-div dl dt,.cmb2-element.ui-datepicker .ui-timepicker-div dl dt{float:right;clear:right;padding:0 5px 0 0}.cmb2-element .ui-datepicker .ui-timepicker-div dl dd,.cmb2-element.ui-datepicker .ui-timepicker-div dl dd{margin:0 40% 10px 10px}.cmb2-element .ui-datepicker .ui-timepicker-div dl dd select,.cmb2-element.ui-datepicker .ui-timepicker-div dl dd select{width:100%}.cmb2-element .ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane,.cmb2-element.ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane{padding:.6em;text-align:right}.cmb2-element .ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-primary,.cmb2-element .ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-secondary,.cmb2-element.ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-primary,.cmb2-element.ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-secondary{padding:0 10px 1px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;margin:0 .4em .4em .6em}.admin-color-fresh .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-fresh .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-fresh .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-fresh .cmb2-element.ui-datepicker .ui-widget-header{background:#00a0d2}.admin-color-fresh .cmb2-element .ui-datepicker thead,.admin-color-fresh .cmb2-element.ui-datepicker thead{background:#32373c}.admin-color-fresh .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-fresh .cmb2-element.ui-datepicker td .ui-state-hover{background:#0073aa;color:#fff}.admin-color-blue .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-blue .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-blue .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-blue .cmb2-element.ui-datepicker .ui-widget-header{background:#52accc}.admin-color-blue .cmb2-element .ui-datepicker thead,.admin-color-blue .cmb2-element.ui-datepicker thead{background:#4796b3}.admin-color-blue .cmb2-element .ui-datepicker td .ui-state-active,.admin-color-blue .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-blue .cmb2-element.ui-datepicker td .ui-state-active,.admin-color-blue .cmb2-element.ui-datepicker td .ui-state-hover{background:#096484;color:#fff}.admin-color-blue .cmb2-element .ui-datepicker td.ui-datepicker-today,.admin-color-blue .cmb2-element.ui-datepicker td.ui-datepicker-today{background:#eee}.admin-color-coffee .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-coffee .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-coffee .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-coffee .cmb2-element.ui-datepicker .ui-widget-header{background:#59524c}.admin-color-coffee .cmb2-element .ui-datepicker thead,.admin-color-coffee .cmb2-element.ui-datepicker thead{background:#46403c}.admin-color-coffee .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-coffee .cmb2-element.ui-datepicker td .ui-state-hover{background:#c7a589;color:#fff}.admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-widget-header{background:#523f6d}.admin-color-ectoplasm .cmb2-element .ui-datepicker thead,.admin-color-ectoplasm .cmb2-element.ui-datepicker thead{background:#413256}.admin-color-ectoplasm .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-ectoplasm .cmb2-element.ui-datepicker td .ui-state-hover{background:#a3b745;color:#fff}.admin-color-midnight .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-midnight .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-midnight .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-midnight .cmb2-element.ui-datepicker .ui-widget-header{background:#363b3f}.admin-color-midnight .cmb2-element .ui-datepicker thead,.admin-color-midnight .cmb2-element.ui-datepicker thead{background:#26292c}.admin-color-midnight .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-midnight .cmb2-element.ui-datepicker td .ui-state-hover{background:#e14d43;color:#fff}.admin-color-ocean .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-ocean .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-ocean .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-ocean .cmb2-element.ui-datepicker .ui-widget-header{background:#738e96}.admin-color-ocean .cmb2-element .ui-datepicker thead,.admin-color-ocean .cmb2-element.ui-datepicker thead{background:#627c83}.admin-color-ocean .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-ocean .cmb2-element.ui-datepicker td .ui-state-hover{background:#9ebaa0;color:#fff}.admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover,.admin-color-sunrise .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover,.admin-color-sunrise .cmb2-element.ui-datepicker .ui-widget-header{background:#cf4944}.admin-color-sunrise .cmb2-element .ui-datepicker th,.admin-color-sunrise .cmb2-element.ui-datepicker th{border-color:#be3631;background:#be3631}.admin-color-sunrise .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-sunrise .cmb2-element.ui-datepicker td .ui-state-hover{background:#dd823b;color:#fff}.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-light .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-light .cmb2-element.ui-datepicker .ui-widget-header{background:#e5e5e5}.admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-month,.admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-year,.admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-month,.admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-year{color:#555}.admin-color-light .cmb2-element .ui-datepicker thead,.admin-color-light .cmb2-element.ui-datepicker thead{background:#888}.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-next:before,.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-prev:before,.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-title,.admin-color-light .cmb2-element .ui-datepicker td .ui-state-default,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-next:before,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-prev:before,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-title,.admin-color-light .cmb2-element.ui-datepicker td .ui-state-default{color:#555}.admin-color-light .cmb2-element .ui-datepicker td .ui-state-active,.admin-color-light .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-light .cmb2-element.ui-datepicker td .ui-state-active,.admin-color-light .cmb2-element.ui-datepicker td .ui-state-hover{background:#ccc}.admin-color-light .cmb2-element .ui-datepicker td.ui-datepicker-today,.admin-color-light .cmb2-element.ui-datepicker td.ui-datepicker-today{background:#eee}.admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-widget-header{background:#56b274}.admin-color-bbp-evergreen .cmb2-element .ui-datepicker thead,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker thead{background:#36533f}.admin-color-bbp-evergreen .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker td .ui-state-hover{background:#446950;color:#fff}.admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-widget-header{background:#4ca26a}.admin-color-bbp-mint .cmb2-element .ui-datepicker thead,.admin-color-bbp-mint .cmb2-element.ui-datepicker thead{background:#4f6d59}.admin-color-bbp-mint .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-bbp-mint .cmb2-element.ui-datepicker td .ui-state-hover{background:#5fb37c;color:#fff}.cmb2-char-counter-wrap{margin:.5em 0 1em}.cmb2-char-counter-wrap input[type=text]{font-size:12px;width:25px}.cmb2-char-counter-wrap.cmb2-max-exceeded input[type=text]{border-color:#a00!important}.cmb2-char-counter-wrap.cmb2-max-exceeded .cmb2-char-max-msg{display:inline-block}.cmb2-char-max-msg{color:#a00;display:none;font-weight:600;margin-right:1em}
 
includes/lib/cmb2/css/cmb2.css DELETED
@@ -1,1576 +0,0 @@
1
- /*!
2
- * CMB2 - v2.9.0 - 2021-03-03
3
- * https://cmb2.io
4
- * Copyright (c) 2021
5
- * Licensed GPLv2+
6
- */
7
-
8
- @charset "UTF-8";
9
- /*--------------------------------------------------------------
10
- * Main Wrap
11
- --------------------------------------------------------------*/
12
- /* line 5, sass/partials/_main_wrap.scss */
13
- .cmb2-wrap {
14
- margin: 0;
15
- }
16
- /* line 8, sass/partials/_main_wrap.scss */
17
- .cmb2-wrap input,
18
- .cmb2-wrap textarea {
19
- max-width: 100%;
20
- }
21
- /* line 15, sass/partials/_main_wrap.scss */
22
- .cmb2-wrap input[type="text"].cmb2-oembed {
23
- width: 100%;
24
- }
25
- /* line 20, sass/partials/_main_wrap.scss */
26
- .cmb2-wrap textarea {
27
- width: 500px;
28
- padding: 8px;
29
- }
30
- /* line 24, sass/partials/_main_wrap.scss */
31
- .cmb2-wrap textarea.cmb2-textarea-code {
32
- font-family: "Courier 10 Pitch", Courier, monospace;
33
- line-height: 16px;
34
- }
35
- /* line 32, sass/partials/_main_wrap.scss */
36
- .cmb2-wrap input.cmb2-text-small, .cmb2-wrap input.cmb2-timepicker {
37
- width: 100px;
38
- }
39
- /* line 38, sass/partials/_main_wrap.scss */
40
- .cmb2-wrap input.cmb2-text-money {
41
- width: 90px;
42
- }
43
- /* line 43, sass/partials/_main_wrap.scss */
44
- .cmb2-wrap input.cmb2-text-medium {
45
- width: 230px;
46
- }
47
- /* line 48, sass/partials/_main_wrap.scss */
48
- .cmb2-wrap input.cmb2-upload-file {
49
- width: 65%;
50
- }
51
- /* line 52, sass/partials/_main_wrap.scss */
52
- .cmb2-wrap input.ed_button {
53
- padding: 2px 4px;
54
- }
55
- /* line 57, sass/partials/_main_wrap.scss */
56
- .cmb2-wrap input:not([type="hidden"]) + input,
57
- .cmb2-wrap input:not([type="hidden"]) + .button-secondary,
58
- .cmb2-wrap input:not([type="hidden"]) + select {
59
- margin-left: 20px;
60
- }
61
- /* line 65, sass/partials/_main_wrap.scss */
62
- .cmb2-wrap ul {
63
- margin: 0;
64
- }
65
- /* line 69, sass/partials/_main_wrap.scss */
66
- .cmb2-wrap li {
67
- font-size: 14px;
68
- line-height: 16px;
69
- margin: 1px 0 5px 0;
70
- }
71
- /* line 80, sass/partials/_main_wrap.scss */
72
- .cmb2-wrap select {
73
- font-size: 14px;
74
- margin-top: 3px;
75
- }
76
- /* line 85, sass/partials/_main_wrap.scss */
77
- .cmb2-wrap input:focus,
78
- .cmb2-wrap textarea:focus {
79
- background: #fffff8;
80
- }
81
- /* line 90, sass/partials/_main_wrap.scss */
82
- .cmb2-wrap input[type="radio"] {
83
- margin: 0 5px 0 0;
84
- padding: 0;
85
- }
86
- /* line 95, sass/partials/_main_wrap.scss */
87
- .cmb2-wrap input[type="checkbox"] {
88
- margin: 0 5px 0 0;
89
- padding: 0;
90
- }
91
- /* line 100, sass/partials/_main_wrap.scss */
92
- .cmb2-wrap button,
93
- .cmb2-wrap .button-secondary {
94
- white-space: nowrap;
95
- }
96
- /* line 105, sass/partials/_main_wrap.scss */
97
- .cmb2-wrap .mceLayout {
98
- border: 1px solid #e9e9e9 !important;
99
- }
100
- /* line 109, sass/partials/_main_wrap.scss */
101
- .cmb2-wrap .mceIframeContainer {
102
- background: #ffffff;
103
- }
104
- /* line 113, sass/partials/_main_wrap.scss */
105
- .cmb2-wrap .meta_mce {
106
- width: 97%;
107
- }
108
- /* line 116, sass/partials/_main_wrap.scss */
109
- .cmb2-wrap .meta_mce textarea {
110
- width: 100%;
111
- }
112
- /* line 122, sass/partials/_main_wrap.scss */
113
- .cmb2-wrap .cmb-multicheck-toggle {
114
- margin-top: -1em;
115
- }
116
- /* line 127, sass/partials/_main_wrap.scss */
117
- .cmb2-wrap .wp-picker-clear.button,
118
- .cmb2-wrap .wp-picker-default.button {
119
- margin-left: 6px;
120
- padding: 2px 8px;
121
- }
122
- /* line 133, sass/partials/_main_wrap.scss */
123
- .cmb2-wrap .cmb-row {
124
- margin: 0;
125
- }
126
- /* line 136, sass/partials/_main_wrap.scss */
127
- .cmb2-wrap .cmb-row:after {
128
- content: '';
129
- clear: both;
130
- display: block;
131
- width: 100%;
132
- }
133
- /* line 143, sass/partials/_main_wrap.scss */
134
- .cmb2-wrap .cmb-row.cmb-repeat .cmb2-metabox-description {
135
- padding-top: 0;
136
- padding-bottom: 1em;
137
- }
138
-
139
- /* line 154, sass/partials/_main_wrap.scss */
140
- body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type="radio"]::before {
141
- margin: .1875rem;
142
- }
143
- @media screen and (max-width: 782px) {
144
- /* line 154, sass/partials/_main_wrap.scss */
145
- body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type="radio"]::before {
146
- margin: .4375rem;
147
- }
148
- }
149
-
150
- /* line 162, sass/partials/_main_wrap.scss */
151
- .cmb2-metabox {
152
- clear: both;
153
- margin: 0;
154
- }
155
- /* line 168, sass/partials/_main_wrap.scss */
156
- .cmb2-metabox > .cmb-row:first-of-type > .cmb-td,
157
- .cmb2-metabox > .cmb-row:first-of-type > .cmb-th,
158
- .cmb2-metabox .cmb-field-list > .cmb-row:first-of-type > .cmb-td,
159
- .cmb2-metabox .cmb-field-list > .cmb-row:first-of-type > .cmb-th {
160
- border: 0;
161
- }
162
-
163
- /* line 175, sass/partials/_main_wrap.scss */
164
- .cmb-add-row {
165
- margin: 1.8em 0 0;
166
- }
167
-
168
- /* line 179, sass/partials/_main_wrap.scss */
169
- .cmb-nested .cmb-td,
170
- .cmb-repeatable-group .cmb-th,
171
- .cmb-repeatable-group:first-of-type {
172
- border: 0;
173
- }
174
-
175
- /* line 185, sass/partials/_main_wrap.scss */
176
- .cmb-row:last-of-type,
177
- .cmb2-wrap .cmb-row:last-of-type,
178
- .cmb-repeatable-group:last-of-type {
179
- border-bottom: 0;
180
- }
181
-
182
- /* line 191, sass/partials/_main_wrap.scss */
183
- .cmb-repeatable-grouping {
184
- border: 1px solid #e9e9e9;
185
- padding: 0 1em;
186
- }
187
- /* line 195, sass/partials/_main_wrap.scss */
188
- .cmb-repeatable-grouping.cmb-row {
189
- margin: 0 0 0.8em;
190
- }
191
-
192
- /* line 203, sass/partials/_main_wrap.scss */
193
- .cmb-th {
194
- color: #222222;
195
- float: left;
196
- font-weight: 600;
197
- padding: 20px 10px 20px 0;
198
- vertical-align: top;
199
- width: 200px;
200
- }
201
- @media (max-width: 450px) {
202
- /* line 203, sass/partials/_main_wrap.scss */
203
- .cmb-th {
204
- font-size: 1.2em;
205
- display: block;
206
- float: none;
207
- padding-bottom: 1em;
208
- text-align: left;
209
- width: 100%;
210
- }
211
- /* line 27, sass/partials/_mixins.scss */
212
- .cmb-th label {
213
- display: block;
214
- margin-top: 0;
215
- margin-bottom: 0.5em;
216
- }
217
- }
218
-
219
- /* line 216, sass/partials/_main_wrap.scss */
220
- .cmb-td {
221
- line-height: 1.3;
222
- max-width: 100%;
223
- padding: 15px 10px;
224
- vertical-align: middle;
225
- }
226
-
227
- /* line 225, sass/partials/_main_wrap.scss */
228
- .cmb-type-title .cmb-td {
229
- padding: 0;
230
- }
231
-
232
- /* line 230, sass/partials/_main_wrap.scss */
233
- .cmb-th label {
234
- display: block;
235
- padding: 5px 0;
236
- }
237
-
238
- /* line 235, sass/partials/_main_wrap.scss */
239
- .cmb-th + .cmb-td {
240
- float: left;
241
- }
242
-
243
- /* line 239, sass/partials/_main_wrap.scss */
244
- .cmb-td .cmb-td {
245
- padding-bottom: 1em;
246
- }
247
-
248
- /* line 243, sass/partials/_main_wrap.scss */
249
- .cmb-remove-row {
250
- text-align: right;
251
- }
252
-
253
- /* line 247, sass/partials/_main_wrap.scss */
254
- .empty-row.hidden {
255
- display: none;
256
- }
257
-
258
- /* line 252, sass/partials/_main_wrap.scss */
259
- .cmb-repeat-table {
260
- background-color: #fafafa;
261
- border: 1px solid #e1e1e1;
262
- }
263
- /* line 256, sass/partials/_main_wrap.scss */
264
- .cmb-repeat-table .cmb-row.cmb-repeat-row {
265
- position: relative;
266
- counter-increment: el;
267
- margin: 0;
268
- padding: 10px 10px 10px 50px;
269
- border-bottom: none !important;
270
- }
271
- /* line 264, sass/partials/_main_wrap.scss */
272
- .cmb-repeat-table .cmb-row.cmb-repeat-row + .cmb-repeat-row {
273
- border-top: solid 1px #e9e9e9;
274
- }
275
- /* line 268, sass/partials/_main_wrap.scss */
276
- .cmb-repeat-table .cmb-row.cmb-repeat-row.ui-sortable-helper {
277
- outline: dashed 2px #e9e9e9 !important;
278
- }
279
- /* line 272, sass/partials/_main_wrap.scss */
280
- .cmb-repeat-table .cmb-row.cmb-repeat-row:before {
281
- content: counter(el);
282
- display: block;
283
- top: 0;
284
- left: 0;
285
- position: absolute;
286
- width: 35px;
287
- height: 100%;
288
- line-height: 35px;
289
- cursor: move;
290
- color: #757575;
291
- text-align: center;
292
- border-right: solid 1px #e9e9e9;
293
- }
294
- /* line 289, sass/partials/_main_wrap.scss */
295
- .cmb-repeat-table .cmb-row.cmb-repeat-row .cmb-td {
296
- margin: 0;
297
- padding: 0;
298
- }
299
- /* line 296, sass/partials/_main_wrap.scss */
300
- .cmb-repeat-table + .cmb-add-row {
301
- margin: 0;
302
- }
303
- /* line 299, sass/partials/_main_wrap.scss */
304
- .cmb-repeat-table + .cmb-add-row:before {
305
- content: '';
306
- width: 1px;
307
- height: 1.6em;
308
- display: block;
309
- margin-left: 17px;
310
- background-color: gainsboro;
311
- }
312
- /* line 309, sass/partials/_main_wrap.scss */
313
- .cmb-repeat-table .cmb-remove-row {
314
- top: 7px;
315
- right: 7px;
316
- position: absolute;
317
- width: auto;
318
- margin-left: 0;
319
- padding: 0 !important;
320
- display: none;
321
- }
322
- /* line 320, sass/partials/_main_wrap.scss */
323
- .cmb-repeat-table .cmb-remove-row > .cmb-remove-row-button {
324
- font-size: 20px;
325
- text-indent: -1000px;
326
- overflow: hidden;
327
- position: relative;
328
- height: auto;
329
- line-height: 1;
330
- padding: 0 10px 0;
331
- }
332
- /* line 331, sass/partials/_main_wrap.scss */
333
- .cmb-repeat-table .cmb-remove-row > .cmb-remove-row-button:before {
334
- content: "";
335
- font-family: 'Dashicons';
336
- speak: none;
337
- font-weight: normal;
338
- font-variant: normal;
339
- text-transform: none;
340
- line-height: 1;
341
- -webkit-font-smoothing: antialiased;
342
- margin: 0;
343
- text-indent: 0;
344
- position: absolute;
345
- top: 0;
346
- left: 0;
347
- width: 100%;
348
- height: 100%;
349
- text-align: center;
350
- }
351
- /* line 337, sass/partials/_main_wrap.scss */
352
- .cmb-repeat-table .cmb-repeat-row:hover .cmb-remove-row {
353
- display: block;
354
- }
355
-
356
- /* line 345, sass/partials/_main_wrap.scss */
357
- .cmb-repeatable-group .cmb-th {
358
- padding: 5px;
359
- }
360
- /* line 349, sass/partials/_main_wrap.scss */
361
- .cmb-repeatable-group .cmb-group-title {
362
- background-color: #e9e9e9;
363
- padding: 8px 12px 8px 2.2em;
364
- margin: 0 -1em;
365
- min-height: 1.5em;
366
- font-size: 14px;
367
- line-height: 1.4;
368
- }
369
- /* line 357, sass/partials/_main_wrap.scss */
370
- .cmb-repeatable-group .cmb-group-title h4 {
371
- border: 0;
372
- margin: 0;
373
- font-size: 1.2em;
374
- font-weight: 500;
375
- padding: 0.5em 0.75em;
376
- }
377
- /* line 365, sass/partials/_main_wrap.scss */
378
- .cmb-repeatable-group .cmb-group-title .cmb-th {
379
- display: block;
380
- width: 100%;
381
- }
382
- /* line 371, sass/partials/_main_wrap.scss */
383
- .cmb-repeatable-group .cmb-group-description .cmb-th {
384
- font-size: 1.2em;
385
- display: block;
386
- float: none;
387
- padding-bottom: 1em;
388
- text-align: left;
389
- width: 100%;
390
- }
391
- /* line 27, sass/partials/_mixins.scss */
392
- .cmb-repeatable-group .cmb-group-description .cmb-th label {
393
- display: block;
394
- margin-top: 0;
395
- margin-bottom: 0.5em;
396
- }
397
- /* line 375, sass/partials/_main_wrap.scss */
398
- .cmb-repeatable-group .cmb-shift-rows {
399
- margin-right: 1em;
400
- }
401
- /* line 378, sass/partials/_main_wrap.scss */
402
- .cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-up-alt2 {
403
- margin-top: .15em;
404
- }
405
- /* line 382, sass/partials/_main_wrap.scss */
406
- .cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-down-alt2 {
407
- margin-top: .2em;
408
- }
409
- /* line 387, sass/partials/_main_wrap.scss */
410
- .cmb-repeatable-group .cmb2-upload-button {
411
- float: right;
412
- }
413
-
414
- /* line 393, sass/partials/_main_wrap.scss */
415
- p.cmb2-metabox-description {
416
- color: #666;
417
- letter-spacing: 0.01em;
418
- margin: 0;
419
- padding-top: .5em;
420
- }
421
-
422
- /* line 400, sass/partials/_main_wrap.scss */
423
- span.cmb2-metabox-description {
424
- color: #666;
425
- letter-spacing: 0.01em;
426
- }
427
-
428
- /* line 405, sass/partials/_main_wrap.scss */
429
- .cmb2-metabox-title {
430
- margin: 0 0 5px 0;
431
- padding: 5px 0 0 0;
432
- font-size: 14px;
433
- }
434
-
435
- /* line 411, sass/partials/_main_wrap.scss */
436
- .cmb-inline ul {
437
- padding: 4px 0 0 0;
438
- }
439
-
440
- /* line 415, sass/partials/_main_wrap.scss */
441
- .cmb-inline li {
442
- display: inline-block;
443
- padding-right: 18px;
444
- }
445
-
446
- /* line 420, sass/partials/_main_wrap.scss */
447
- .cmb-type-textarea-code pre {
448
- margin: 0;
449
- }
450
-
451
- /* line 426, sass/partials/_main_wrap.scss */
452
- .cmb2-media-status .img-status {
453
- clear: none;
454
- display: inline-block;
455
- vertical-align: middle;
456
- margin-right: 10px;
457
- width: auto;
458
- }
459
- /* line 433, sass/partials/_main_wrap.scss */
460
- .cmb2-media-status .img-status img {
461
- max-width: 350px;
462
- height: auto;
463
- }
464
- /* line 439, sass/partials/_main_wrap.scss */
465
- .cmb2-media-status .img-status img,
466
- .cmb2-media-status .embed-status {
467
- background: #eee;
468
- border: 5px solid #ffffff;
469
- outline: 1px solid #e9e9e9;
470
- box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
471
- background-image: linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%, #d0d0d0), linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%, #d0d0d0);
472
- background-position: 0 0, 10px 10px;
473
- background-size: 20px 20px;
474
- border-radius: 2px;
475
- -moz-border-radius: 2px;
476
- margin: 15px 0 0 0;
477
- }
478
- /* line 453, sass/partials/_main_wrap.scss */
479
- .cmb2-media-status .embed-status {
480
- float: left;
481
- max-width: 800px;
482
- }
483
- /* line 458, sass/partials/_main_wrap.scss */
484
- .cmb2-media-status .img-status, .cmb2-media-status .embed-status {
485
- position: relative;
486
- }
487
- /* line 461, sass/partials/_main_wrap.scss */
488
- .cmb2-media-status .img-status .cmb2-remove-file-button, .cmb2-media-status .embed-status .cmb2-remove-file-button {
489
- background: url(../images/ico-delete.png);
490
- height: 16px;
491
- left: -5px;
492
- position: absolute;
493
- text-indent: -9999px;
494
- top: -5px;
495
- width: 16px;
496
- }
497
- /* line 475, sass/partials/_main_wrap.scss */
498
- .cmb2-media-status .img-status .cmb2-remove-file-button {
499
- top: 10px;
500
- }
501
- /* line 480, sass/partials/_main_wrap.scss */
502
- .cmb2-media-status .img-status img, .cmb2-media-status .file-status > span {
503
- cursor: pointer;
504
- }
505
- /* line 485, sass/partials/_main_wrap.scss */
506
- .cmb2-media-status.cmb-attach-list .img-status img, .cmb2-media-status.cmb-attach-list .file-status > span {
507
- cursor: move;
508
- }
509
-
510
- /* line 492, sass/partials/_main_wrap.scss */
511
- .cmb-type-file-list .cmb2-media-status .img-status {
512
- clear: none;
513
- vertical-align: middle;
514
- width: auto;
515
- margin-right: 10px;
516
- margin-bottom: 10px;
517
- margin-top: 0;
518
- }
519
-
520
- /* line 501, sass/partials/_main_wrap.scss */
521
- .cmb-attach-list li {
522
- clear: both;
523
- display: inline-block;
524
- width: 100%;
525
- margin-top: 5px;
526
- margin-bottom: 10px;
527
- }
528
- /* line 507, sass/partials/_main_wrap.scss */
529
- .cmb-attach-list li img {
530
- float: left;
531
- margin-right: 10px;
532
- }
533
-
534
- /* line 513, sass/partials/_main_wrap.scss */
535
- .cmb2-remove-wrapper {
536
- margin: 0;
537
- }
538
-
539
- /* line 517, sass/partials/_main_wrap.scss */
540
- .child-cmb2 .cmb-th {
541
- text-align: left;
542
- }
543
-
544
- /* line 521, sass/partials/_main_wrap.scss */
545
- .cmb2-indented-hierarchy {
546
- padding-left: 1.5em;
547
- }
548
-
549
- @media (max-width: 450px) {
550
- /* line 526, sass/partials/_main_wrap.scss */
551
- .cmb-th,
552
- .cmb-td,
553
- .cmb-th + .cmb-td {
554
- display: block;
555
- float: none;
556
- width: 100%;
557
- }
558
- }
559
- /*--------------------------------------------------------------
560
- * Post Metaboxes
561
- --------------------------------------------------------------*/
562
- /* line 5, sass/partials/_post_metaboxes.scss */
563
- #poststuff .cmb-group-title {
564
- margin-left: -1em;
565
- margin-right: -1em;
566
- min-height: 1.5em;
567
- }
568
-
569
- /* line 11, sass/partials/_post_metaboxes.scss */
570
- #poststuff .repeatable .cmb-group-title {
571
- padding-left: 2.2em;
572
- }
573
-
574
- /* line 17, sass/partials/_post_metaboxes.scss */
575
- .cmb2-postbox .cmb2-wrap, .cmb-type-group .cmb2-wrap {
576
- margin: 0;
577
- }
578
- /* line 20, sass/partials/_post_metaboxes.scss */
579
- .cmb2-postbox .cmb2-wrap > .cmb-field-list > .cmb-row, .cmb-type-group .cmb2-wrap > .cmb-field-list > .cmb-row {
580
- padding: 1.8em 0;
581
- }
582
- /* line 26, sass/partials/_post_metaboxes.scss */
583
- .cmb2-postbox .cmb2-wrap input[type=text].cmb2-oembed, .cmb-type-group .cmb2-wrap input[type=text].cmb2-oembed {
584
- width: 100%;
585
- }
586
- /* line 32, sass/partials/_post_metaboxes.scss */
587
- .cmb2-postbox .cmb-row, .cmb-type-group .cmb-row {
588
- padding: 0 0 1.8em;
589
- margin: 0 0 0.8em;
590
- }
591
- /* line 36, sass/partials/_post_metaboxes.scss */
592
- .cmb2-postbox .cmb-row .cmbhandle, .cmb-type-group .cmb-row .cmbhandle {
593
- right: -1em;
594
- position: relative;
595
- color: #222222;
596
- }
597
- /* line 43, sass/partials/_post_metaboxes.scss */
598
- .cmb2-postbox .cmb-repeatable-grouping, .cmb-type-group .cmb-repeatable-grouping {
599
- padding: 0 1em;
600
- max-width: 100%;
601
- min-width: 1px !important;
602
- }
603
- /* line 49, sass/partials/_post_metaboxes.scss */
604
- .cmb2-postbox .cmb-repeatable-group > .cmb-row, .cmb-type-group .cmb-repeatable-group > .cmb-row {
605
- padding-bottom: 0;
606
- }
607
- /* line 53, sass/partials/_post_metaboxes.scss */
608
- .cmb2-postbox .cmb-th, .cmb-type-group .cmb-th {
609
- width: 18%;
610
- padding: 0 2% 0 0;
611
- }
612
- /* line 59, sass/partials/_post_metaboxes.scss */
613
- .cmb2-postbox .cmb-td, .cmb-type-group .cmb-td {
614
- margin-bottom: 0;
615
- padding: 0;
616
- line-height: 1.3;
617
- }
618
- /* line 65, sass/partials/_post_metaboxes.scss */
619
- .cmb2-postbox .cmb-th + .cmb-td, .cmb-type-group .cmb-th + .cmb-td {
620
- width: 80%;
621
- float: right;
622
- }
623
- /* line 70, sass/partials/_post_metaboxes.scss */
624
- .cmb2-postbox .cmb-row:not(:last-of-type),
625
- .cmb2-postbox .cmb-repeatable-group:not(:last-of-type), .cmb-type-group .cmb-row:not(:last-of-type),
626
- .cmb-type-group .cmb-repeatable-group:not(:last-of-type) {
627
- border-bottom: 1px solid #e9e9e9;
628
- }
629
- @media (max-width: 450px) {
630
- /* line 70, sass/partials/_post_metaboxes.scss */
631
- .cmb2-postbox .cmb-row:not(:last-of-type),
632
- .cmb2-postbox .cmb-repeatable-group:not(:last-of-type), .cmb-type-group .cmb-row:not(:last-of-type),
633
- .cmb-type-group .cmb-repeatable-group:not(:last-of-type) {
634
- border-bottom: 0;
635
- }
636
- }
637
- /* line 79, sass/partials/_post_metaboxes.scss */
638
- .cmb2-postbox .cmb-repeat-group-field,
639
- .cmb2-postbox .cmb-remove-field-row, .cmb-type-group .cmb-repeat-group-field,
640
- .cmb-type-group .cmb-remove-field-row {
641
- padding-top: 1.8em;
642
- }
643
-
644
- /*--------------------------------------------------------------
645
- * Context Metaboxes
646
- --------------------------------------------------------------*/
647
- /* Metabox collapse arrow indicators */
648
- /* line 8, sass/partials/_context_metaboxes.scss */
649
- .js .cmb2-postbox.context-box .handlediv {
650
- text-align: center;
651
- }
652
- /* line 13, sass/partials/_context_metaboxes.scss */
653
- .js .cmb2-postbox.context-box .toggle-indicator:before {
654
- content: "\f142";
655
- display: inline-block;
656
- font: normal 20px/1 dashicons;
657
- speak: none;
658
- -webkit-font-smoothing: antialiased;
659
- -moz-osx-font-smoothing: grayscale;
660
- text-decoration: none !important;
661
- }
662
- /* line 26, sass/partials/_context_metaboxes.scss */
663
- .js .cmb2-postbox.context-box.closed .toggle-indicator:before {
664
- content: "\f140";
665
- }
666
-
667
- /* line 34, sass/partials/_context_metaboxes.scss */
668
- .cmb2-postbox.context-box {
669
- margin-bottom: 10px;
670
- }
671
- /* line 38, sass/partials/_context_metaboxes.scss */
672
- .cmb2-postbox.context-box.context-before_permalink-box {
673
- margin-top: 10px;
674
- }
675
- /* line 42, sass/partials/_context_metaboxes.scss */
676
- .cmb2-postbox.context-box.context-after_title-box {
677
- margin-top: 10px;
678
- }
679
- /* line 46, sass/partials/_context_metaboxes.scss */
680
- .cmb2-postbox.context-box.context-after_editor-box {
681
- margin-top: 20px;
682
- margin-bottom: 0;
683
- }
684
- /* line 51, sass/partials/_context_metaboxes.scss */
685
- .cmb2-postbox.context-box.context-form_top-box {
686
- margin-top: 10px;
687
- }
688
- /* line 55, sass/partials/_context_metaboxes.scss */
689
- .cmb2-postbox.context-box.context-form_top-box .hndle {
690
- font-size: 14px;
691
- padding: 8px 12px;
692
- margin: 0;
693
- line-height: 1.4;
694
- }
695
- /* line 63, sass/partials/_context_metaboxes.scss */
696
- .cmb2-postbox.context-box .hndle {
697
- cursor: auto;
698
- }
699
-
700
- /* line 68, sass/partials/_context_metaboxes.scss */
701
- .cmb2-context-wrap {
702
- margin-top: 10px;
703
- }
704
- /* line 72, sass/partials/_context_metaboxes.scss */
705
- .cmb2-context-wrap.cmb2-context-wrap-form_top {
706
- margin-right: 300px;
707
- width: auto;
708
- }
709
- /* line 79, sass/partials/_context_metaboxes.scss */
710
- .cmb2-context-wrap.cmb2-context-wrap-no-title .cmb2-metabox {
711
- padding: 10px;
712
- }
713
- /* line 84, sass/partials/_context_metaboxes.scss */
714
- .cmb2-context-wrap .cmb-th {
715
- padding: 0 2% 0 0;
716
- width: 18%;
717
- }
718
- /* line 89, sass/partials/_context_metaboxes.scss */
719
- .cmb2-context-wrap .cmb-td {
720
- width: 80%;
721
- padding: 0;
722
- }
723
- /* line 94, sass/partials/_context_metaboxes.scss */
724
- .cmb2-context-wrap .cmb-row {
725
- margin-bottom: 10px;
726
- }
727
- /* line 97, sass/partials/_context_metaboxes.scss */
728
- .cmb2-context-wrap .cmb-row:last-of-type {
729
- margin-bottom: 0;
730
- }
731
-
732
- /* one column on the post write/edit screen */
733
- @media only screen and (max-width: 850px) {
734
- /* line 107, sass/partials/_context_metaboxes.scss */
735
- .cmb2-context-wrap.cmb2-context-wrap-form_top {
736
- margin-right: 0;
737
- }
738
- }
739
- /*--------------------------------------------------------------
740
- * Options page
741
- --------------------------------------------------------------*/
742
- /* line 5, sass/partials/_options-page.scss */
743
- .cmb2-options-page {
744
- max-width: 1200px;
745
- }
746
- /* line 8, sass/partials/_options-page.scss */
747
- .cmb2-options-page.wrap > h2 {
748
- margin-bottom: 1em;
749
- }
750
- /* line 12, sass/partials/_options-page.scss */
751
- .cmb2-options-page .cmb2-metabox > .cmb-row {
752
- padding: 1em;
753
- margin-top: -1px;
754
- background: #ffffff;
755
- border: 1px solid #e9e9e9;
756
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
757
- }
758
- /* line 19, sass/partials/_options-page.scss */
759
- .cmb2-options-page .cmb2-metabox > .cmb-row > .cmb-th {
760
- padding: 0;
761
- font-weight: initial;
762
- }
763
- /* line 24, sass/partials/_options-page.scss */
764
- .cmb2-options-page .cmb2-metabox > .cmb-row > .cmb-th + .cmb-td {
765
- float: none;
766
- padding: 0 0 0 1em;
767
- margin-left: 200px;
768
- }
769
- @media (max-width: 450px) {
770
- /* line 24, sass/partials/_options-page.scss */
771
- .cmb2-options-page .cmb2-metabox > .cmb-row > .cmb-th + .cmb-td {
772
- padding: 0;
773
- margin-left: 0;
774
- }
775
- }
776
- /* line 37, sass/partials/_options-page.scss */
777
- .cmb2-options-page .cmb2-wrap .cmb-type-title {
778
- margin-top: 1em;
779
- padding: 0.6em 1em;
780
- background-color: #fafafa;
781
- }
782
- /* line 42, sass/partials/_options-page.scss */
783
- .cmb2-options-page .cmb2-wrap .cmb-type-title .cmb2-metabox-title {
784
- font-size: 12px;
785
- margin-top: 0;
786
- margin-bottom: 0;
787
- text-transform: uppercase;
788
- }
789
- /* line 49, sass/partials/_options-page.scss */
790
- .cmb2-options-page .cmb2-wrap .cmb-type-title .cmb2-metabox-description {
791
- padding-top: 0.25em;
792
- }
793
- /* line 55, sass/partials/_options-page.scss */
794
- .cmb2-options-page .cmb-repeatable-group .cmb-group-description .cmb-th {
795
- padding: 0 0 0.8em 0;
796
- }
797
- /* line 59, sass/partials/_options-page.scss */
798
- .cmb2-options-page .cmb-repeatable-group .cmb-group-name {
799
- font-size: 16px;
800
- margin-top: 0;
801
- margin-bottom: 0;
802
- }
803
- /* line 65, sass/partials/_options-page.scss */
804
- .cmb2-options-page .cmb-repeatable-group .cmb-th > .cmb2-metabox-description {
805
- font-weight: 400;
806
- padding-bottom: 0 !important;
807
- }
808
-
809
- /*--------------------------------------------------------------
810
- * New-Term Page
811
- --------------------------------------------------------------*/
812
- /* line 6, sass/partials/_new_term.scss */
813
- #addtag .cmb-th {
814
- float: none;
815
- width: auto;
816
- padding: 20px 0 0;
817
- }
818
- /* line 12, sass/partials/_new_term.scss */
819
- #addtag .cmb-td {
820
- padding: 0;
821
- }
822
- /* line 16, sass/partials/_new_term.scss */
823
- #addtag .cmb-th + .cmb-td {
824
- float: none;
825
- }
826
- /* line 20, sass/partials/_new_term.scss */
827
- #addtag select {
828
- max-width: 100%;
829
- }
830
- /* line 24, sass/partials/_new_term.scss */
831
- #addtag .cmb2-metabox {
832
- padding-bottom: 20px;
833
- }
834
- /* line 28, sass/partials/_new_term.scss */
835
- #addtag .cmb-row li label {
836
- display: inline;
837
- }
838
-
839
- /*--------------------------------------------------------------
840
- * Misc.
841
- --------------------------------------------------------------*/
842
- /* line 5, sass/partials/_misc.scss */
843
- #poststuff .cmb-repeatable-group h2 {
844
- margin: 0;
845
- }
846
-
847
- /* line 12, sass/partials/_misc.scss */
848
- .edit-tags-php .cmb2-metabox-title,
849
- .profile-php .cmb2-metabox-title,
850
- .user-edit-php .cmb2-metabox-title {
851
- font-size: 1.4em;
852
- }
853
-
854
- /* line 18, sass/partials/_misc.scss */
855
- .cmb2-postbox .cmb-spinner, .cmb2-no-box-wrap .cmb-spinner {
856
- float: left;
857
- display: none;
858
- }
859
-
860
- /* line 24, sass/partials/_misc.scss */
861
- .cmb-spinner {
862
- display: none;
863
- }
864
- /* line 26, sass/partials/_misc.scss */
865
- .cmb-spinner.is-active {
866
- display: block;
867
- }
868
-
869
- /*--------------------------------------------------------------
870
- * Sidebar Placement Adjustments
871
- --------------------------------------------------------------*/
872
- /* line 10, sass/partials/_sidebar_placements.scss */
873
- .inner-sidebar .cmb2-wrap > .cmb-field-list > .cmb-row,
874
- #side-sortables .cmb2-wrap > .cmb-field-list > .cmb-row {
875
- padding: 1.4em 0;
876
- }
877
- /* line 16, sass/partials/_sidebar_placements.scss */
878
- .inner-sidebar .cmb2-wrap input[type=text]:not(.wp-color-picker),
879
- #side-sortables .cmb2-wrap input[type=text]:not(.wp-color-picker) {
880
- width: 100%;
881
- }
882
- /* line 20, sass/partials/_sidebar_placements.scss */
883
- .inner-sidebar .cmb2-wrap input + input:not(.wp-picker-clear), .inner-sidebar .cmb2-wrap input + select,
884
- #side-sortables .cmb2-wrap input + input:not(.wp-picker-clear),
885
- #side-sortables .cmb2-wrap input + select {
886
- margin-left: 0;
887
- margin-top: 1em;
888
- display: block;
889
- }
890
- /* line 26, sass/partials/_sidebar_placements.scss */
891
- .inner-sidebar .cmb2-wrap input.cmb2-text-money,
892
- #side-sortables .cmb2-wrap input.cmb2-text-money {
893
- max-width: 70%;
894
- }
895
- /* line 28, sass/partials/_sidebar_placements.scss */
896
- .inner-sidebar .cmb2-wrap input.cmb2-text-money + .cmb2-metabox-description,
897
- #side-sortables .cmb2-wrap input.cmb2-text-money + .cmb2-metabox-description {
898
- display: block;
899
- }
900
- /* line 34, sass/partials/_sidebar_placements.scss */
901
- .inner-sidebar .cmb2-wrap label,
902
- #side-sortables .cmb2-wrap label {
903
- display: block;
904
- font-weight: 700;
905
- padding: 0 0 5px;
906
- }
907
- /* line 42, sass/partials/_sidebar_placements.scss */
908
- .inner-sidebar textarea,
909
- #side-sortables textarea {
910
- max-width: 99%;
911
- }
912
- /* line 46, sass/partials/_sidebar_placements.scss */
913
- .inner-sidebar .cmb-repeatable-group,
914
- #side-sortables .cmb-repeatable-group {
915
- border-bottom: 1px solid #e9e9e9;
916
- }
917
- /* line 50, sass/partials/_sidebar_placements.scss */
918
- .inner-sidebar .cmb-type-group > .cmb-td > .cmb-repeatable-group,
919
- #side-sortables .cmb-type-group > .cmb-td > .cmb-repeatable-group {
920
- border-bottom: 0;
921
- margin-bottom: -1.4em;
922
- }
923
- /* line 55, sass/partials/_sidebar_placements.scss */
924
- .inner-sidebar .cmb-th,
925
- .inner-sidebar .cmb-td:not(.cmb-remove-row),
926
- .inner-sidebar .cmb-th + .cmb-td,
927
- #side-sortables .cmb-th,
928
- #side-sortables .cmb-td:not(.cmb-remove-row),
929
- #side-sortables .cmb-th + .cmb-td {
930
- width: 100%;
931
- display: block;
932
- float: none;
933
- }
934
- /* line 63, sass/partials/_sidebar_placements.scss */
935
- .inner-sidebar .closed .inside,
936
- #side-sortables .closed .inside {
937
- display: none;
938
- }
939
- /* line 67, sass/partials/_sidebar_placements.scss */
940
- .inner-sidebar .cmb-th,
941
- #side-sortables .cmb-th {
942
- display: block;
943
- float: none;
944
- padding-bottom: 1em;
945
- text-align: left;
946
- width: 100%;
947
- padding-left: 0;
948
- padding-right: 0;
949
- }
950
- /* line 27, sass/partials/_mixins.scss */
951
- .inner-sidebar .cmb-th label,
952
- #side-sortables .cmb-th label {
953
- display: block;
954
- margin-top: 0;
955
- margin-bottom: 0.5em;
956
- }
957
- /* line 14, sass/partials/_mixins.scss */
958
- .inner-sidebar .cmb-th label,
959
- #side-sortables .cmb-th label {
960
- font-size: 14px;
961
- line-height: 1.4em;
962
- }
963
- /* line 74, sass/partials/_sidebar_placements.scss */
964
- .inner-sidebar .cmb-group-description .cmb-th,
965
- #side-sortables .cmb-group-description .cmb-th {
966
- padding-top: 0;
967
- }
968
- /* line 77, sass/partials/_sidebar_placements.scss */
969
- .inner-sidebar .cmb-group-description .cmb2-metabox-description,
970
- #side-sortables .cmb-group-description .cmb2-metabox-description {
971
- padding: 0;
972
- }
973
- /* line 84, sass/partials/_sidebar_placements.scss */
974
- .inner-sidebar .cmb-group-title .cmb-th,
975
- #side-sortables .cmb-group-title .cmb-th {
976
- padding: 0;
977
- }
978
- /* line 90, sass/partials/_sidebar_placements.scss */
979
- .inner-sidebar .cmb-repeatable-grouping + .cmb-repeatable-grouping,
980
- #side-sortables .cmb-repeatable-grouping + .cmb-repeatable-grouping {
981
- margin-top: 1em;
982
- }
983
- /* line 99, sass/partials/_sidebar_placements.scss */
984
- .inner-sidebar .cmb2-media-status .img-status img,
985
- .inner-sidebar .cmb2-media-status .embed-status img,
986
- #side-sortables .cmb2-media-status .img-status img,
987
- #side-sortables .cmb2-media-status .embed-status img {
988
- max-width: 90%;
989
- height: auto;
990
- }
991
- /* line 107, sass/partials/_sidebar_placements.scss */
992
- .inner-sidebar .cmb2-list label,
993
- #side-sortables .cmb2-list label {
994
- display: inline;
995
- font-weight: normal;
996
- }
997
- /* line 112, sass/partials/_sidebar_placements.scss */
998
- .inner-sidebar .cmb2-metabox-description,
999
- #side-sortables .cmb2-metabox-description {
1000
- display: block;
1001
- padding: 7px 0 0;
1002
- }
1003
- /* line 119, sass/partials/_sidebar_placements.scss */
1004
- .inner-sidebar .cmb-type-checkbox .cmb-td label,
1005
- .inner-sidebar .cmb-type-checkbox .cmb2-metabox-description,
1006
- #side-sortables .cmb-type-checkbox .cmb-td label,
1007
- #side-sortables .cmb-type-checkbox .cmb2-metabox-description {
1008
- font-weight: normal;
1009
- display: inline;
1010
- }
1011
- /* line 126, sass/partials/_sidebar_placements.scss */
1012
- .inner-sidebar .cmb-row .cmb2-metabox-description,
1013
- #side-sortables .cmb-row .cmb2-metabox-description {
1014
- padding-bottom: 1.8em;
1015
- }
1016
- /* line 130, sass/partials/_sidebar_placements.scss */
1017
- .inner-sidebar .cmb2-metabox-title,
1018
- #side-sortables .cmb2-metabox-title {
1019
- font-size: 1.2em;
1020
- font-style: italic;
1021
- }
1022
- /* line 135, sass/partials/_sidebar_placements.scss */
1023
- .inner-sidebar .cmb-remove-row,
1024
- #side-sortables .cmb-remove-row {
1025
- clear: both;
1026
- padding-top: 12px;
1027
- padding-bottom: 0;
1028
- }
1029
- /* line 141, sass/partials/_sidebar_placements.scss */
1030
- .inner-sidebar .cmb2-upload-button,
1031
- #side-sortables .cmb2-upload-button {
1032
- clear: both;
1033
- margin-top: 12px;
1034
- }
1035
-
1036
- /*--------------------------------------------------------------
1037
- * Collapsible UI
1038
- --------------------------------------------------------------*/
1039
- /* line 6, sass/partials/_collapsible_ui.scss */
1040
- .cmb2-metabox .cmbhandle {
1041
- color: #757575;
1042
- float: right;
1043
- width: 27px;
1044
- height: 30px;
1045
- cursor: pointer;
1046
- right: -1em;
1047
- position: relative;
1048
- }
1049
- /* line 14, sass/partials/_collapsible_ui.scss */
1050
- .cmb2-metabox .cmbhandle:before {
1051
- content: '\f142';
1052
- right: 12px;
1053
- font: normal 20px/1 'dashicons';
1054
- speak: none;
1055
- display: inline-block;
1056
- padding: 8px 10px;
1057
- top: 0;
1058
- position: relative;
1059
- -webkit-font-smoothing: antialiased;
1060
- -moz-osx-font-smoothing: grayscale;
1061
- text-decoration: none !important;
1062
- }
1063
- /* line 31, sass/partials/_collapsible_ui.scss */
1064
- .cmb2-metabox .postbox.closed .cmbhandle:before {
1065
- content: '\f140';
1066
- }
1067
- /* line 37, sass/partials/_collapsible_ui.scss */
1068
- .cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row {
1069
- -webkit-appearance: none !important;
1070
- background: none !important;
1071
- border: none !important;
1072
- position: absolute;
1073
- left: 0;
1074
- top: .5em;
1075
- line-height: 1em;
1076
- padding: 2px 6px 3px;
1077
- opacity: .5;
1078
- }
1079
- /* line 47, sass/partials/_collapsible_ui.scss */
1080
- .cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]) {
1081
- cursor: pointer;
1082
- color: #a00;
1083
- opacity: 1;
1084
- }
1085
- /* line 51, sass/partials/_collapsible_ui.scss */
1086
- .cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]):hover {
1087
- color: #f00;
1088
- }
1089
-
1090
- /*
1091
- * jQuery UI CSS Framework 1.8.16
1092
- *
1093
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1094
- * Dual licensed under the MIT or GPL Version 2 licenses.
1095
- * http://jquery.org/license
1096
- *
1097
- * http://docs.jquery.com/UI/Theming/API
1098
- *
1099
- * WordPress Styles adopted from "jQuery UI Datepicker CSS for WordPress"
1100
- * https://github.com/stuttter/wp-datepicker-styling
1101
- *
1102
- */
1103
- /* line 15, sass/partials/_jquery_ui.scss */
1104
- * html .cmb2-element.ui-helper-clearfix {
1105
- height: 1%;
1106
- }
1107
-
1108
- /* line 24, sass/partials/_jquery_ui.scss */
1109
- .cmb2-element.ui-datepicker, .cmb2-element .ui-datepicker {
1110
- padding: 0;
1111
- margin: 0;
1112
- -webkit-border-radius: 0;
1113
- -moz-border-radius: 0;
1114
- border-radius: 0;
1115
- background-color: #fff;
1116
- border: 1px solid #dfdfdf;
1117
- border-top: none;
1118
- -webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
1119
- box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
1120
- min-width: 17em;
1121
- width: auto;
1122
- /* Default Color Scheme */
1123
- }
1124
- /* line 38, sass/partials/_jquery_ui.scss */
1125
- .cmb2-element.ui-datepicker *, .cmb2-element .ui-datepicker * {
1126
- padding: 0;
1127
- font-family: "Open Sans", sans-serif;
1128
- -webkit-border-radius: 0;
1129
- -moz-border-radius: 0;
1130
- border-radius: 0;
1131
- }
1132
- /* line 46, sass/partials/_jquery_ui.scss */
1133
- .cmb2-element.ui-datepicker table, .cmb2-element .ui-datepicker table {
1134
- font-size: 13px;
1135
- margin: 0;
1136
- border: none;
1137
- border-collapse: collapse;
1138
- }
1139
- /* line 53, sass/partials/_jquery_ui.scss */
1140
- .cmb2-element.ui-datepicker .ui-widget-header,
1141
- .cmb2-element.ui-datepicker .ui-datepicker-header, .cmb2-element .ui-datepicker .ui-widget-header,
1142
- .cmb2-element .ui-datepicker .ui-datepicker-header {
1143
- background-image: none;
1144
- border: none;
1145
- color: #fff;
1146
- font-weight: normal;
1147
- }
1148
- /* line 61, sass/partials/_jquery_ui.scss */
1149
- .cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover, .cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover {
1150
- background: transparent;
1151
- border-color: transparent;
1152
- cursor: pointer;
1153
- }
1154
- /* line 67, sass/partials/_jquery_ui.scss */
1155
- .cmb2-element.ui-datepicker .ui-datepicker-title, .cmb2-element .ui-datepicker .ui-datepicker-title {
1156
- margin: 0;
1157
- padding: 10px 0;
1158
- color: #fff;
1159
- font-size: 14px;
1160
- line-height: 14px;
1161
- text-align: center;
1162
- }
1163
- /* line 75, sass/partials/_jquery_ui.scss */
1164
- .cmb2-element.ui-datepicker .ui-datepicker-title select, .cmb2-element .ui-datepicker .ui-datepicker-title select {
1165
- margin-top: -8px;
1166
- margin-bottom: -8px;
1167
- }
1168
- /* line 81, sass/partials/_jquery_ui.scss */
1169
- .cmb2-element.ui-datepicker .ui-datepicker-prev,
1170
- .cmb2-element.ui-datepicker .ui-datepicker-next, .cmb2-element .ui-datepicker .ui-datepicker-prev,
1171
- .cmb2-element .ui-datepicker .ui-datepicker-next {
1172
- position: relative;
1173
- top: 0;
1174
- height: 34px;
1175
- width: 34px;
1176
- }
1177
- /* line 89, sass/partials/_jquery_ui.scss */
1178
- .cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-prev,
1179
- .cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-next, .cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-prev,
1180
- .cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-next {
1181
- border: none;
1182
- }
1183
- /* line 94, sass/partials/_jquery_ui.scss */
1184
- .cmb2-element.ui-datepicker .ui-datepicker-prev,
1185
- .cmb2-element.ui-datepicker .ui-datepicker-prev-hover, .cmb2-element .ui-datepicker .ui-datepicker-prev,
1186
- .cmb2-element .ui-datepicker .ui-datepicker-prev-hover {
1187
- left: 0;
1188
- }
1189
- /* line 99, sass/partials/_jquery_ui.scss */
1190
- .cmb2-element.ui-datepicker .ui-datepicker-next,
1191
- .cmb2-element.ui-datepicker .ui-datepicker-next-hover, .cmb2-element .ui-datepicker .ui-datepicker-next,
1192
- .cmb2-element .ui-datepicker .ui-datepicker-next-hover {
1193
- right: 0;
1194
- }
1195
- /* line 104, sass/partials/_jquery_ui.scss */
1196
- .cmb2-element.ui-datepicker .ui-datepicker-next span,
1197
- .cmb2-element.ui-datepicker .ui-datepicker-prev span, .cmb2-element .ui-datepicker .ui-datepicker-next span,
1198
- .cmb2-element .ui-datepicker .ui-datepicker-prev span {
1199
- display: none;
1200
- }
1201
- /* line 109, sass/partials/_jquery_ui.scss */
1202
- .cmb2-element.ui-datepicker .ui-datepicker-prev, .cmb2-element .ui-datepicker .ui-datepicker-prev {
1203
- float: left;
1204
- }
1205
- /* line 113, sass/partials/_jquery_ui.scss */
1206
- .cmb2-element.ui-datepicker .ui-datepicker-next, .cmb2-element .ui-datepicker .ui-datepicker-next {
1207
- float: right;
1208
- }
1209
- /* line 117, sass/partials/_jquery_ui.scss */
1210
- .cmb2-element.ui-datepicker .ui-datepicker-prev:before,
1211
- .cmb2-element.ui-datepicker .ui-datepicker-next:before, .cmb2-element .ui-datepicker .ui-datepicker-prev:before,
1212
- .cmb2-element .ui-datepicker .ui-datepicker-next:before {
1213
- font: normal 20px/34px 'dashicons';
1214
- padding-left: 7px;
1215
- color: #fff;
1216
- speak: none;
1217
- -webkit-font-smoothing: antialiased;
1218
- -moz-osx-font-smoothing: grayscale;
1219
- width: 34px;
1220
- height: 34px;
1221
- }
1222
- /* line 129, sass/partials/_jquery_ui.scss */
1223
- .cmb2-element.ui-datepicker .ui-datepicker-prev:before, .cmb2-element .ui-datepicker .ui-datepicker-prev:before {
1224
- content: '\f341';
1225
- }
1226
- /* line 133, sass/partials/_jquery_ui.scss */
1227
- .cmb2-element.ui-datepicker .ui-datepicker-next:before, .cmb2-element .ui-datepicker .ui-datepicker-next:before {
1228
- content: '\f345';
1229
- }
1230
- /* line 137, sass/partials/_jquery_ui.scss */
1231
- .cmb2-element.ui-datepicker .ui-datepicker-prev-hover:before,
1232
- .cmb2-element.ui-datepicker .ui-datepicker-next-hover:before, .cmb2-element .ui-datepicker .ui-datepicker-prev-hover:before,
1233
- .cmb2-element .ui-datepicker .ui-datepicker-next-hover:before {
1234
- opacity: 0.7;
1235
- }
1236
- /* line 142, sass/partials/_jquery_ui.scss */
1237
- .cmb2-element.ui-datepicker select.ui-datepicker-month,
1238
- .cmb2-element.ui-datepicker select.ui-datepicker-year, .cmb2-element .ui-datepicker select.ui-datepicker-month,
1239
- .cmb2-element .ui-datepicker select.ui-datepicker-year {
1240
- width: 33%;
1241
- background: transparent;
1242
- border-color: transparent;
1243
- box-shadow: none;
1244
- color: #fff;
1245
- }
1246
- /* line 149, sass/partials/_jquery_ui.scss */
1247
- .cmb2-element.ui-datepicker select.ui-datepicker-month option,
1248
- .cmb2-element.ui-datepicker select.ui-datepicker-year option, .cmb2-element .ui-datepicker select.ui-datepicker-month option,
1249
- .cmb2-element .ui-datepicker select.ui-datepicker-year option {
1250
- color: #333;
1251
- }
1252
- /* line 154, sass/partials/_jquery_ui.scss */
1253
- .cmb2-element.ui-datepicker thead, .cmb2-element .ui-datepicker thead {
1254
- color: #fff;
1255
- font-weight: 600;
1256
- }
1257
- /* line 157, sass/partials/_jquery_ui.scss */
1258
- .cmb2-element.ui-datepicker thead th, .cmb2-element .ui-datepicker thead th {
1259
- font-weight: normal;
1260
- }
1261
- /* line 162, sass/partials/_jquery_ui.scss */
1262
- .cmb2-element.ui-datepicker th, .cmb2-element .ui-datepicker th {
1263
- padding: 10px;
1264
- }
1265
- /* line 166, sass/partials/_jquery_ui.scss */
1266
- .cmb2-element.ui-datepicker td, .cmb2-element .ui-datepicker td {
1267
- padding: 0;
1268
- border: 1px solid #f4f4f4;
1269
- }
1270
- /* line 171, sass/partials/_jquery_ui.scss */
1271
- .cmb2-element.ui-datepicker td.ui-datepicker-other-month, .cmb2-element .ui-datepicker td.ui-datepicker-other-month {
1272
- border: transparent;
1273
- }
1274
- /* line 175, sass/partials/_jquery_ui.scss */
1275
- .cmb2-element.ui-datepicker td.ui-datepicker-week-end, .cmb2-element .ui-datepicker td.ui-datepicker-week-end {
1276
- background-color: #f4f4f4;
1277
- border: 1px solid #f4f4f4;
1278
- }
1279
- /* line 178, sass/partials/_jquery_ui.scss */
1280
- .cmb2-element.ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today, .cmb2-element .ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today {
1281
- -webkit-box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
1282
- -moz-box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
1283
- box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.1);
1284
- }
1285
- /* line 185, sass/partials/_jquery_ui.scss */
1286
- .cmb2-element.ui-datepicker td.ui-datepicker-today, .cmb2-element .ui-datepicker td.ui-datepicker-today {
1287
- background-color: #f0f0c0;
1288
- }
1289
- /* line 189, sass/partials/_jquery_ui.scss */
1290
- .cmb2-element.ui-datepicker td.ui-datepicker-current-day, .cmb2-element .ui-datepicker td.ui-datepicker-current-day {
1291
- background: #bbdd88;
1292
- }
1293
- /* line 193, sass/partials/_jquery_ui.scss */
1294
- .cmb2-element.ui-datepicker td .ui-state-default, .cmb2-element .ui-datepicker td .ui-state-default {
1295
- background: transparent;
1296
- border: none;
1297
- text-align: center;
1298
- text-decoration: none;
1299
- width: auto;
1300
- display: block;
1301
- padding: 5px 10px;
1302
- font-weight: normal;
1303
- color: #444;
1304
- }
1305
- /* line 205, sass/partials/_jquery_ui.scss */
1306
- .cmb2-element.ui-datepicker td.ui-state-disabled .ui-state-default, .cmb2-element .ui-datepicker td.ui-state-disabled .ui-state-default {
1307
- opacity: 0.5;
1308
- }
1309
- /* line 210, sass/partials/_jquery_ui.scss */
1310
- .cmb2-element.ui-datepicker .ui-widget-header,
1311
- .cmb2-element.ui-datepicker .ui-datepicker-header, .cmb2-element .ui-datepicker .ui-widget-header,
1312
- .cmb2-element .ui-datepicker .ui-datepicker-header {
1313
- background: #00a0d2;
1314
- }
1315
- /* line 215, sass/partials/_jquery_ui.scss */
1316
- .cmb2-element.ui-datepicker thead, .cmb2-element .ui-datepicker thead {
1317
- background: #32373c;
1318
- }
1319
- /* line 219, sass/partials/_jquery_ui.scss */
1320
- .cmb2-element.ui-datepicker td .ui-state-hover, .cmb2-element.ui-datepicker td .ui-state-active, .cmb2-element .ui-datepicker td .ui-state-hover, .cmb2-element .ui-datepicker td .ui-state-active {
1321
- background: #0073aa;
1322
- color: #fff;
1323
- }
1324
- /* line 224, sass/partials/_jquery_ui.scss */
1325
- .cmb2-element.ui-datepicker .ui-timepicker-div, .cmb2-element .ui-datepicker .ui-timepicker-div {
1326
- font-size: 14px;
1327
- }
1328
- /* line 226, sass/partials/_jquery_ui.scss */
1329
- .cmb2-element.ui-datepicker .ui-timepicker-div dl, .cmb2-element .ui-datepicker .ui-timepicker-div dl {
1330
- text-align: left;
1331
- padding: 0 .6em;
1332
- }
1333
- /* line 229, sass/partials/_jquery_ui.scss */
1334
- .cmb2-element.ui-datepicker .ui-timepicker-div dl dt, .cmb2-element .ui-datepicker .ui-timepicker-div dl dt {
1335
- float: left;
1336
- clear: left;
1337
- padding: 0 0 0 5px;
1338
- }
1339
- /* line 234, sass/partials/_jquery_ui.scss */
1340
- .cmb2-element.ui-datepicker .ui-timepicker-div dl dd, .cmb2-element .ui-datepicker .ui-timepicker-div dl dd {
1341
- margin: 0 10px 10px 40%;
1342
- }
1343
- /* line 236, sass/partials/_jquery_ui.scss */
1344
- .cmb2-element.ui-datepicker .ui-timepicker-div dl dd select, .cmb2-element .ui-datepicker .ui-timepicker-div dl dd select {
1345
- width: 100%;
1346
- }
1347
- /* line 242, sass/partials/_jquery_ui.scss */
1348
- .cmb2-element.ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane, .cmb2-element .ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane {
1349
- padding: .6em;
1350
- text-align: left;
1351
- }
1352
- /* line 246, sass/partials/_jquery_ui.scss */
1353
- .cmb2-element.ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-primary, .cmb2-element.ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-secondary, .cmb2-element .ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-primary, .cmb2-element .ui-datepicker .ui-timepicker-div + .ui-datepicker-buttonpane .button-secondary {
1354
- padding: 0 10px 1px;
1355
- -webkit-border-radius: 3px;
1356
- -moz-border-radius: 3px;
1357
- border-radius: 3px;
1358
- margin: 0 .6em .4em .4em;
1359
- }
1360
-
1361
- /* line 260, sass/partials/_jquery_ui.scss */
1362
- .admin-color-fresh .cmb2-element.ui-datepicker .ui-widget-header,
1363
- .admin-color-fresh .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-fresh .cmb2-element .ui-datepicker .ui-widget-header,
1364
- .admin-color-fresh .cmb2-element .ui-datepicker .ui-datepicker-header {
1365
- background: #00a0d2;
1366
- }
1367
- /* line 265, sass/partials/_jquery_ui.scss */
1368
- .admin-color-fresh .cmb2-element.ui-datepicker thead, .admin-color-fresh .cmb2-element .ui-datepicker thead {
1369
- background: #32373c;
1370
- }
1371
- /* line 269, sass/partials/_jquery_ui.scss */
1372
- .admin-color-fresh .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-fresh .cmb2-element .ui-datepicker td .ui-state-hover {
1373
- background: #0073aa;
1374
- color: #fff;
1375
- }
1376
-
1377
- /* line 277, sass/partials/_jquery_ui.scss */
1378
- .admin-color-blue .cmb2-element.ui-datepicker .ui-widget-header,
1379
- .admin-color-blue .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-blue .cmb2-element .ui-datepicker .ui-widget-header,
1380
- .admin-color-blue .cmb2-element .ui-datepicker .ui-datepicker-header {
1381
- background: #52accc;
1382
- }
1383
- /* line 282, sass/partials/_jquery_ui.scss */
1384
- .admin-color-blue .cmb2-element.ui-datepicker thead, .admin-color-blue .cmb2-element .ui-datepicker thead {
1385
- background: #4796b3;
1386
- }
1387
- /* line 291, sass/partials/_jquery_ui.scss */
1388
- .admin-color-blue .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-blue .cmb2-element.ui-datepicker td .ui-state-active, .admin-color-blue .cmb2-element .ui-datepicker td .ui-state-hover, .admin-color-blue .cmb2-element .ui-datepicker td .ui-state-active {
1389
- background: #096484;
1390
- color: #fff;
1391
- }
1392
- /* line 296, sass/partials/_jquery_ui.scss */
1393
- .admin-color-blue .cmb2-element.ui-datepicker td.ui-datepicker-today, .admin-color-blue .cmb2-element .ui-datepicker td.ui-datepicker-today {
1394
- background: #eee;
1395
- }
1396
-
1397
- /* line 305, sass/partials/_jquery_ui.scss */
1398
- .admin-color-coffee .cmb2-element.ui-datepicker .ui-widget-header,
1399
- .admin-color-coffee .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-coffee .cmb2-element .ui-datepicker .ui-widget-header,
1400
- .admin-color-coffee .cmb2-element .ui-datepicker .ui-datepicker-header {
1401
- background: #59524c;
1402
- }
1403
- /* line 310, sass/partials/_jquery_ui.scss */
1404
- .admin-color-coffee .cmb2-element.ui-datepicker thead, .admin-color-coffee .cmb2-element .ui-datepicker thead {
1405
- background: #46403c;
1406
- }
1407
- /* line 314, sass/partials/_jquery_ui.scss */
1408
- .admin-color-coffee .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-coffee .cmb2-element .ui-datepicker td .ui-state-hover {
1409
- background: #c7a589;
1410
- color: #fff;
1411
- }
1412
-
1413
- /* line 322, sass/partials/_jquery_ui.scss */
1414
- .admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-widget-header,
1415
- .admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-widget-header,
1416
- .admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-datepicker-header {
1417
- background: #523f6d;
1418
- }
1419
- /* line 327, sass/partials/_jquery_ui.scss */
1420
- .admin-color-ectoplasm .cmb2-element.ui-datepicker thead, .admin-color-ectoplasm .cmb2-element .ui-datepicker thead {
1421
- background: #413256;
1422
- }
1423
- /* line 331, sass/partials/_jquery_ui.scss */
1424
- .admin-color-ectoplasm .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-ectoplasm .cmb2-element .ui-datepicker td .ui-state-hover {
1425
- background: #a3b745;
1426
- color: #fff;
1427
- }
1428
-
1429
- /* line 339, sass/partials/_jquery_ui.scss */
1430
- .admin-color-midnight .cmb2-element.ui-datepicker .ui-widget-header,
1431
- .admin-color-midnight .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-midnight .cmb2-element .ui-datepicker .ui-widget-header,
1432
- .admin-color-midnight .cmb2-element .ui-datepicker .ui-datepicker-header {
1433
- background: #363b3f;
1434
- }
1435
- /* line 344, sass/partials/_jquery_ui.scss */
1436
- .admin-color-midnight .cmb2-element.ui-datepicker thead, .admin-color-midnight .cmb2-element .ui-datepicker thead {
1437
- background: #26292c;
1438
- }
1439
- /* line 348, sass/partials/_jquery_ui.scss */
1440
- .admin-color-midnight .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-midnight .cmb2-element .ui-datepicker td .ui-state-hover {
1441
- background: #e14d43;
1442
- color: #fff;
1443
- }
1444
-
1445
- /* line 356, sass/partials/_jquery_ui.scss */
1446
- .admin-color-ocean .cmb2-element.ui-datepicker .ui-widget-header,
1447
- .admin-color-ocean .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-ocean .cmb2-element .ui-datepicker .ui-widget-header,
1448
- .admin-color-ocean .cmb2-element .ui-datepicker .ui-datepicker-header {
1449
- background: #738e96;
1450
- }
1451
- /* line 361, sass/partials/_jquery_ui.scss */
1452
- .admin-color-ocean .cmb2-element.ui-datepicker thead, .admin-color-ocean .cmb2-element .ui-datepicker thead {
1453
- background: #627c83;
1454
- }
1455
- /* line 365, sass/partials/_jquery_ui.scss */
1456
- .admin-color-ocean .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-ocean .cmb2-element .ui-datepicker td .ui-state-hover {
1457
- background: #9ebaa0;
1458
- color: #fff;
1459
- }
1460
-
1461
- /* line 373, sass/partials/_jquery_ui.scss */
1462
- .admin-color-sunrise .cmb2-element.ui-datepicker .ui-widget-header,
1463
- .admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header,
1464
- .admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover, .admin-color-sunrise .cmb2-element .ui-datepicker .ui-widget-header,
1465
- .admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header,
1466
- .admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover {
1467
- background: #cf4944;
1468
- }
1469
- /* line 379, sass/partials/_jquery_ui.scss */
1470
- .admin-color-sunrise .cmb2-element.ui-datepicker th, .admin-color-sunrise .cmb2-element .ui-datepicker th {
1471
- border-color: #be3631;
1472
- background: #be3631;
1473
- }
1474
- /* line 384, sass/partials/_jquery_ui.scss */
1475
- .admin-color-sunrise .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-sunrise .cmb2-element .ui-datepicker td .ui-state-hover {
1476
- background: #dd823b;
1477
- color: #fff;
1478
- }
1479
-
1480
- /* line 392, sass/partials/_jquery_ui.scss */
1481
- .admin-color-light .cmb2-element.ui-datepicker .ui-widget-header,
1482
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-light .cmb2-element .ui-datepicker .ui-widget-header,
1483
- .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-header {
1484
- background: #e5e5e5;
1485
- }
1486
- /* line 397, sass/partials/_jquery_ui.scss */
1487
- .admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-month,
1488
- .admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-year, .admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-month,
1489
- .admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-year {
1490
- color: #555;
1491
- }
1492
- /* line 402, sass/partials/_jquery_ui.scss */
1493
- .admin-color-light .cmb2-element.ui-datepicker thead, .admin-color-light .cmb2-element .ui-datepicker thead {
1494
- background: #888;
1495
- }
1496
- /* line 406, sass/partials/_jquery_ui.scss */
1497
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-title,
1498
- .admin-color-light .cmb2-element.ui-datepicker td .ui-state-default,
1499
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-prev:before,
1500
- .admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-next:before, .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-title,
1501
- .admin-color-light .cmb2-element .ui-datepicker td .ui-state-default,
1502
- .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-prev:before,
1503
- .admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-next:before {
1504
- color: #555;
1505
- }
1506
- /* line 414, sass/partials/_jquery_ui.scss */
1507
- .admin-color-light .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-light .cmb2-element.ui-datepicker td .ui-state-active, .admin-color-light .cmb2-element .ui-datepicker td .ui-state-hover, .admin-color-light .cmb2-element .ui-datepicker td .ui-state-active {
1508
- background: #ccc;
1509
- }
1510
- /* line 418, sass/partials/_jquery_ui.scss */
1511
- .admin-color-light .cmb2-element.ui-datepicker td.ui-datepicker-today, .admin-color-light .cmb2-element .ui-datepicker td.ui-datepicker-today {
1512
- background: #eee;
1513
- }
1514
-
1515
- /* line 426, sass/partials/_jquery_ui.scss */
1516
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-widget-header,
1517
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-widget-header,
1518
- .admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-datepicker-header {
1519
- background: #56b274;
1520
- }
1521
- /* line 431, sass/partials/_jquery_ui.scss */
1522
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker thead, .admin-color-bbp-evergreen .cmb2-element .ui-datepicker thead {
1523
- background: #36533f;
1524
- }
1525
- /* line 435, sass/partials/_jquery_ui.scss */
1526
- .admin-color-bbp-evergreen .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-bbp-evergreen .cmb2-element .ui-datepicker td .ui-state-hover {
1527
- background: #446950;
1528
- color: #fff;
1529
- }
1530
-
1531
- /* line 443, sass/partials/_jquery_ui.scss */
1532
- .admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-widget-header,
1533
- .admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-datepicker-header, .admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-widget-header,
1534
- .admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-datepicker-header {
1535
- background: #4ca26a;
1536
- }
1537
- /* line 448, sass/partials/_jquery_ui.scss */
1538
- .admin-color-bbp-mint .cmb2-element.ui-datepicker thead, .admin-color-bbp-mint .cmb2-element .ui-datepicker thead {
1539
- background: #4f6d59;
1540
- }
1541
- /* line 452, sass/partials/_jquery_ui.scss */
1542
- .admin-color-bbp-mint .cmb2-element.ui-datepicker td .ui-state-hover, .admin-color-bbp-mint .cmb2-element .ui-datepicker td .ui-state-hover {
1543
- background: #5fb37c;
1544
- color: #fff;
1545
- }
1546
-
1547
- /*--------------------------------------------------------------
1548
- * Character counter
1549
- --------------------------------------------------------------*/
1550
- /* line 5, sass/partials/_char_counter.scss */
1551
- .cmb2-char-counter-wrap {
1552
- margin: .5em 0 1em;
1553
- }
1554
- /* line 8, sass/partials/_char_counter.scss */
1555
- .cmb2-char-counter-wrap input[type="text"] {
1556
- font-size: 12px;
1557
- width: 25px;
1558
- }
1559
- /* line 14, sass/partials/_char_counter.scss */
1560
- .cmb2-char-counter-wrap.cmb2-max-exceeded input[type="text"] {
1561
- border-color: #a00 !important;
1562
- }
1563
- /* line 17, sass/partials/_char_counter.scss */
1564
- .cmb2-char-counter-wrap.cmb2-max-exceeded .cmb2-char-max-msg {
1565
- display: inline-block;
1566
- }
1567
-
1568
- /* line 23, sass/partials/_char_counter.scss */
1569
- .cmb2-char-max-msg {
1570
- color: #a00;
1571
- display: none;
1572
- font-weight: 600;
1573
- margin-left: 1em;
1574
- }
1575
-
1576
- /*# sourceMappingURL=cmb2.css.map */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/css/cmb2.min.css DELETED
@@ -1 +0,0 @@
1
- @charset "UTF-8";.cmb2-wrap{margin:0}.cmb2-wrap input,.cmb2-wrap textarea{max-width:100%}.cmb2-wrap input[type=text].cmb2-oembed{width:100%}.cmb2-wrap textarea{width:500px;padding:8px}.cmb2-wrap textarea.cmb2-textarea-code{font-family:"Courier 10 Pitch",Courier,monospace;line-height:16px}.cmb2-wrap input.cmb2-text-small,.cmb2-wrap input.cmb2-timepicker{width:100px}.cmb2-wrap input.cmb2-text-money{width:90px}.cmb2-wrap input.cmb2-text-medium{width:230px}.cmb2-wrap input.cmb2-upload-file{width:65%}.cmb2-wrap input.ed_button{padding:2px 4px}.cmb2-wrap input:not([type=hidden])+.button-secondary,.cmb2-wrap input:not([type=hidden])+input,.cmb2-wrap input:not([type=hidden])+select{margin-left:20px}.cmb2-wrap ul{margin:0}.cmb2-wrap li{font-size:14px;line-height:16px;margin:1px 0 5px 0}.cmb2-wrap select{font-size:14px;margin-top:3px}.cmb2-wrap input:focus,.cmb2-wrap textarea:focus{background:#fffff8}.cmb2-wrap input[type=radio]{margin:0 5px 0 0;padding:0}.cmb2-wrap input[type=checkbox]{margin:0 5px 0 0;padding:0}.cmb2-wrap .button-secondary,.cmb2-wrap button{white-space:nowrap}.cmb2-wrap .mceLayout{border:1px solid #e9e9e9!important}.cmb2-wrap .mceIframeContainer{background:#fff}.cmb2-wrap .meta_mce{width:97%}.cmb2-wrap .meta_mce textarea{width:100%}.cmb2-wrap .cmb-multicheck-toggle{margin-top:-1em}.cmb2-wrap .wp-picker-clear.button,.cmb2-wrap .wp-picker-default.button{margin-left:6px;padding:2px 8px}.cmb2-wrap .cmb-row{margin:0}.cmb2-wrap .cmb-row:after{content:'';clear:both;display:block;width:100%}.cmb2-wrap .cmb-row.cmb-repeat .cmb2-metabox-description{padding-top:0;padding-bottom:1em}body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type=radio]::before{margin:.1875rem}@media screen and (max-width:782px){body.block-editor-page.branch-5-3 .cmb2-wrap .cmb-row .cmb2-radio-list input[type=radio]::before{margin:.4375rem}}.cmb2-metabox{clear:both;margin:0}.cmb2-metabox .cmb-field-list>.cmb-row:first-of-type>.cmb-td,.cmb2-metabox .cmb-field-list>.cmb-row:first-of-type>.cmb-th,.cmb2-metabox>.cmb-row:first-of-type>.cmb-td,.cmb2-metabox>.cmb-row:first-of-type>.cmb-th{border:0}.cmb-add-row{margin:1.8em 0 0}.cmb-nested .cmb-td,.cmb-repeatable-group .cmb-th,.cmb-repeatable-group:first-of-type{border:0}.cmb-repeatable-group:last-of-type,.cmb-row:last-of-type,.cmb2-wrap .cmb-row:last-of-type{border-bottom:0}.cmb-repeatable-grouping{border:1px solid #e9e9e9;padding:0 1em}.cmb-repeatable-grouping.cmb-row{margin:0 0 .8em}.cmb-th{color:#222;float:left;font-weight:600;padding:20px 10px 20px 0;vertical-align:top;width:200px}@media (max-width:450px){.cmb-th{font-size:1.2em;display:block;float:none;padding-bottom:1em;text-align:left;width:100%}.cmb-th label{display:block;margin-top:0;margin-bottom:.5em}}.cmb-td{line-height:1.3;max-width:100%;padding:15px 10px;vertical-align:middle}.cmb-type-title .cmb-td{padding:0}.cmb-th label{display:block;padding:5px 0}.cmb-th+.cmb-td{float:left}.cmb-td .cmb-td{padding-bottom:1em}.cmb-remove-row{text-align:right}.empty-row.hidden{display:none}.cmb-repeat-table{background-color:#fafafa;border:1px solid #e1e1e1}.cmb-repeat-table .cmb-row.cmb-repeat-row{position:relative;counter-increment:el;margin:0;padding:10px 10px 10px 50px;border-bottom:none!important}.cmb-repeat-table .cmb-row.cmb-repeat-row+.cmb-repeat-row{border-top:solid 1px #e9e9e9}.cmb-repeat-table .cmb-row.cmb-repeat-row.ui-sortable-helper{outline:dashed 2px #e9e9e9!important}.cmb-repeat-table .cmb-row.cmb-repeat-row:before{content:counter(el);display:block;top:0;left:0;position:absolute;width:35px;height:100%;line-height:35px;cursor:move;color:#757575;text-align:center;border-right:solid 1px #e9e9e9}.cmb-repeat-table .cmb-row.cmb-repeat-row .cmb-td{margin:0;padding:0}.cmb-repeat-table+.cmb-add-row{margin:0}.cmb-repeat-table+.cmb-add-row:before{content:'';width:1px;height:1.6em;display:block;margin-left:17px;background-color:#dcdcdc}.cmb-repeat-table .cmb-remove-row{top:7px;right:7px;position:absolute;width:auto;margin-left:0;padding:0!important;display:none}.cmb-repeat-table .cmb-remove-row>.cmb-remove-row-button{font-size:20px;text-indent:-1000px;overflow:hidden;position:relative;height:auto;line-height:1;padding:0 10px 0}.cmb-repeat-table .cmb-remove-row>.cmb-remove-row-button:before{content:"";font-family:Dashicons;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center}.cmb-repeat-table .cmb-repeat-row:hover .cmb-remove-row{display:block}.cmb-repeatable-group .cmb-th{padding:5px}.cmb-repeatable-group .cmb-group-title{background-color:#e9e9e9;padding:8px 12px 8px 2.2em;margin:0 -1em;min-height:1.5em;font-size:14px;line-height:1.4}.cmb-repeatable-group .cmb-group-title h4{border:0;margin:0;font-size:1.2em;font-weight:500;padding:.5em .75em}.cmb-repeatable-group .cmb-group-title .cmb-th{display:block;width:100%}.cmb-repeatable-group .cmb-group-description .cmb-th{font-size:1.2em;display:block;float:none;padding-bottom:1em;text-align:left;width:100%}.cmb-repeatable-group .cmb-group-description .cmb-th label{display:block;margin-top:0;margin-bottom:.5em}.cmb-repeatable-group .cmb-shift-rows{margin-right:1em}.cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-up-alt2{margin-top:.15em}.cmb-repeatable-group .cmb-shift-rows .dashicons-arrow-down-alt2{margin-top:.2em}.cmb-repeatable-group .cmb2-upload-button{float:right}p.cmb2-metabox-description{color:#666;letter-spacing:.01em;margin:0;padding-top:.5em}span.cmb2-metabox-description{color:#666;letter-spacing:.01em}.cmb2-metabox-title{margin:0 0 5px 0;padding:5px 0 0 0;font-size:14px}.cmb-inline ul{padding:4px 0 0 0}.cmb-inline li{display:inline-block;padding-right:18px}.cmb-type-textarea-code pre{margin:0}.cmb2-media-status .img-status{clear:none;display:inline-block;vertical-align:middle;margin-right:10px;width:auto}.cmb2-media-status .img-status img{max-width:350px;height:auto}.cmb2-media-status .embed-status,.cmb2-media-status .img-status img{background:#eee;border:5px solid #fff;outline:1px solid #e9e9e9;box-shadow:inset 0 0 15px rgba(0,0,0,.3),inset 0 0 0 1px rgba(0,0,0,.05);background-image:linear-gradient(45deg,#d0d0d0 25%,transparent 25%,transparent 75%,#d0d0d0 75%,#d0d0d0),linear-gradient(45deg,#d0d0d0 25%,transparent 25%,transparent 75%,#d0d0d0 75%,#d0d0d0);background-position:0 0,10px 10px;background-size:20px 20px;border-radius:2px;-moz-border-radius:2px;margin:15px 0 0 0}.cmb2-media-status .embed-status{float:left;max-width:800px}.cmb2-media-status .embed-status,.cmb2-media-status .img-status{position:relative}.cmb2-media-status .embed-status .cmb2-remove-file-button,.cmb2-media-status .img-status .cmb2-remove-file-button{background:url(../images/ico-delete.png);height:16px;left:-5px;position:absolute;text-indent:-9999px;top:-5px;width:16px}.cmb2-media-status .img-status .cmb2-remove-file-button{top:10px}.cmb2-media-status .file-status>span,.cmb2-media-status .img-status img{cursor:pointer}.cmb2-media-status.cmb-attach-list .file-status>span,.cmb2-media-status.cmb-attach-list .img-status img{cursor:move}.cmb-type-file-list .cmb2-media-status .img-status{clear:none;vertical-align:middle;width:auto;margin-right:10px;margin-bottom:10px;margin-top:0}.cmb-attach-list li{clear:both;display:inline-block;width:100%;margin-top:5px;margin-bottom:10px}.cmb-attach-list li img{float:left;margin-right:10px}.cmb2-remove-wrapper{margin:0}.child-cmb2 .cmb-th{text-align:left}.cmb2-indented-hierarchy{padding-left:1.5em}@media (max-width:450px){.cmb-td,.cmb-th,.cmb-th+.cmb-td{display:block;float:none;width:100%}}#poststuff .cmb-group-title{margin-left:-1em;margin-right:-1em;min-height:1.5em}#poststuff .repeatable .cmb-group-title{padding-left:2.2em}.cmb-type-group .cmb2-wrap,.cmb2-postbox .cmb2-wrap{margin:0}.cmb-type-group .cmb2-wrap>.cmb-field-list>.cmb-row,.cmb2-postbox .cmb2-wrap>.cmb-field-list>.cmb-row{padding:1.8em 0}.cmb-type-group .cmb2-wrap input[type=text].cmb2-oembed,.cmb2-postbox .cmb2-wrap input[type=text].cmb2-oembed{width:100%}.cmb-type-group .cmb-row,.cmb2-postbox .cmb-row{padding:0 0 1.8em;margin:0 0 .8em}.cmb-type-group .cmb-row .cmbhandle,.cmb2-postbox .cmb-row .cmbhandle{right:-1em;position:relative;color:#222}.cmb-type-group .cmb-repeatable-grouping,.cmb2-postbox .cmb-repeatable-grouping{padding:0 1em;max-width:100%;min-width:1px!important}.cmb-type-group .cmb-repeatable-group>.cmb-row,.cmb2-postbox .cmb-repeatable-group>.cmb-row{padding-bottom:0}.cmb-type-group .cmb-th,.cmb2-postbox .cmb-th{width:18%;padding:0 2% 0 0}.cmb-type-group .cmb-td,.cmb2-postbox .cmb-td{margin-bottom:0;padding:0;line-height:1.3}.cmb-type-group .cmb-th+.cmb-td,.cmb2-postbox .cmb-th+.cmb-td{width:80%;float:right}.cmb-type-group .cmb-repeatable-group:not(:last-of-type),.cmb-type-group .cmb-row:not(:last-of-type),.cmb2-postbox .cmb-repeatable-group:not(:last-of-type),.cmb2-postbox .cmb-row:not(:last-of-type){border-bottom:1px solid #e9e9e9}@media (max-width:450px){.cmb-type-group .cmb-repeatable-group:not(:last-of-type),.cmb-type-group .cmb-row:not(:last-of-type),.cmb2-postbox .cmb-repeatable-group:not(:last-of-type),.cmb2-postbox .cmb-row:not(:last-of-type){border-bottom:0}}.cmb-type-group .cmb-remove-field-row,.cmb-type-group .cmb-repeat-group-field,.cmb2-postbox .cmb-remove-field-row,.cmb2-postbox .cmb-repeat-group-field{padding-top:1.8em}.js .cmb2-postbox.context-box .handlediv{text-align:center}.js .cmb2-postbox.context-box .toggle-indicator:before{content:"\f142";display:inline-block;font:normal 20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.js .cmb2-postbox.context-box.closed .toggle-indicator:before{content:"\f140"}.cmb2-postbox.context-box{margin-bottom:10px}.cmb2-postbox.context-box.context-before_permalink-box{margin-top:10px}.cmb2-postbox.context-box.context-after_title-box{margin-top:10px}.cmb2-postbox.context-box.context-after_editor-box{margin-top:20px;margin-bottom:0}.cmb2-postbox.context-box.context-form_top-box{margin-top:10px}.cmb2-postbox.context-box.context-form_top-box .hndle{font-size:14px;padding:8px 12px;margin:0;line-height:1.4}.cmb2-postbox.context-box .hndle{cursor:auto}.cmb2-context-wrap{margin-top:10px}.cmb2-context-wrap.cmb2-context-wrap-form_top{margin-right:300px;width:auto}.cmb2-context-wrap.cmb2-context-wrap-no-title .cmb2-metabox{padding:10px}.cmb2-context-wrap .cmb-th{padding:0 2% 0 0;width:18%}.cmb2-context-wrap .cmb-td{width:80%;padding:0}.cmb2-context-wrap .cmb-row{margin-bottom:10px}.cmb2-context-wrap .cmb-row:last-of-type{margin-bottom:0}@media only screen and (max-width:850px){.cmb2-context-wrap.cmb2-context-wrap-form_top{margin-right:0}}.cmb2-options-page{max-width:1200px}.cmb2-options-page.wrap>h2{margin-bottom:1em}.cmb2-options-page .cmb2-metabox>.cmb-row{padding:1em;margin-top:-1px;background:#fff;border:1px solid #e9e9e9;box-shadow:0 1px 1px rgba(0,0,0,.05)}.cmb2-options-page .cmb2-metabox>.cmb-row>.cmb-th{padding:0;font-weight:initial}.cmb2-options-page .cmb2-metabox>.cmb-row>.cmb-th+.cmb-td{float:none;padding:0 0 0 1em;margin-left:200px}@media (max-width:450px){.cmb2-options-page .cmb2-metabox>.cmb-row>.cmb-th+.cmb-td{padding:0;margin-left:0}}.cmb2-options-page .cmb2-wrap .cmb-type-title{margin-top:1em;padding:.6em 1em;background-color:#fafafa}.cmb2-options-page .cmb2-wrap .cmb-type-title .cmb2-metabox-title{font-size:12px;margin-top:0;margin-bottom:0;text-transform:uppercase}.cmb2-options-page .cmb2-wrap .cmb-type-title .cmb2-metabox-description{padding-top:.25em}.cmb2-options-page .cmb-repeatable-group .cmb-group-description .cmb-th{padding:0 0 .8em 0}.cmb2-options-page .cmb-repeatable-group .cmb-group-name{font-size:16px;margin-top:0;margin-bottom:0}.cmb2-options-page .cmb-repeatable-group .cmb-th>.cmb2-metabox-description{font-weight:400;padding-bottom:0!important}#addtag .cmb-th{float:none;width:auto;padding:20px 0 0}#addtag .cmb-td{padding:0}#addtag .cmb-th+.cmb-td{float:none}#addtag select{max-width:100%}#addtag .cmb2-metabox{padding-bottom:20px}#addtag .cmb-row li label{display:inline}#poststuff .cmb-repeatable-group h2{margin:0}.edit-tags-php .cmb2-metabox-title,.profile-php .cmb2-metabox-title,.user-edit-php .cmb2-metabox-title{font-size:1.4em}.cmb2-no-box-wrap .cmb-spinner,.cmb2-postbox .cmb-spinner{float:left;display:none}.cmb-spinner{display:none}.cmb-spinner.is-active{display:block}#side-sortables .cmb2-wrap>.cmb-field-list>.cmb-row,.inner-sidebar .cmb2-wrap>.cmb-field-list>.cmb-row{padding:1.4em 0}#side-sortables .cmb2-wrap input[type=text]:not(.wp-color-picker),.inner-sidebar .cmb2-wrap input[type=text]:not(.wp-color-picker){width:100%}#side-sortables .cmb2-wrap input+input:not(.wp-picker-clear),#side-sortables .cmb2-wrap input+select,.inner-sidebar .cmb2-wrap input+input:not(.wp-picker-clear),.inner-sidebar .cmb2-wrap input+select{margin-left:0;margin-top:1em;display:block}#side-sortables .cmb2-wrap input.cmb2-text-money,.inner-sidebar .cmb2-wrap input.cmb2-text-money{max-width:70%}#side-sortables .cmb2-wrap input.cmb2-text-money+.cmb2-metabox-description,.inner-sidebar .cmb2-wrap input.cmb2-text-money+.cmb2-metabox-description{display:block}#side-sortables .cmb2-wrap label,.inner-sidebar .cmb2-wrap label{display:block;font-weight:700;padding:0 0 5px}#side-sortables textarea,.inner-sidebar textarea{max-width:99%}#side-sortables .cmb-repeatable-group,.inner-sidebar .cmb-repeatable-group{border-bottom:1px solid #e9e9e9}#side-sortables .cmb-type-group>.cmb-td>.cmb-repeatable-group,.inner-sidebar .cmb-type-group>.cmb-td>.cmb-repeatable-group{border-bottom:0;margin-bottom:-1.4em}#side-sortables .cmb-td:not(.cmb-remove-row),#side-sortables .cmb-th,#side-sortables .cmb-th+.cmb-td,.inner-sidebar .cmb-td:not(.cmb-remove-row),.inner-sidebar .cmb-th,.inner-sidebar .cmb-th+.cmb-td{width:100%;display:block;float:none}#side-sortables .closed .inside,.inner-sidebar .closed .inside{display:none}#side-sortables .cmb-th,.inner-sidebar .cmb-th{display:block;float:none;padding-bottom:1em;text-align:left;width:100%;padding-left:0;padding-right:0}#side-sortables .cmb-th label,.inner-sidebar .cmb-th label{display:block;margin-top:0;margin-bottom:.5em}#side-sortables .cmb-th label,.inner-sidebar .cmb-th label{font-size:14px;line-height:1.4em}#side-sortables .cmb-group-description .cmb-th,.inner-sidebar .cmb-group-description .cmb-th{padding-top:0}#side-sortables .cmb-group-description .cmb2-metabox-description,.inner-sidebar .cmb-group-description .cmb2-metabox-description{padding:0}#side-sortables .cmb-group-title .cmb-th,.inner-sidebar .cmb-group-title .cmb-th{padding:0}#side-sortables .cmb-repeatable-grouping+.cmb-repeatable-grouping,.inner-sidebar .cmb-repeatable-grouping+.cmb-repeatable-grouping{margin-top:1em}#side-sortables .cmb2-media-status .embed-status img,#side-sortables .cmb2-media-status .img-status img,.inner-sidebar .cmb2-media-status .embed-status img,.inner-sidebar .cmb2-media-status .img-status img{max-width:90%;height:auto}#side-sortables .cmb2-list label,.inner-sidebar .cmb2-list label{display:inline;font-weight:400}#side-sortables .cmb2-metabox-description,.inner-sidebar .cmb2-metabox-description{display:block;padding:7px 0 0}#side-sortables .cmb-type-checkbox .cmb-td label,#side-sortables .cmb-type-checkbox .cmb2-metabox-description,.inner-sidebar .cmb-type-checkbox .cmb-td label,.inner-sidebar .cmb-type-checkbox .cmb2-metabox-description{font-weight:400;display:inline}#side-sortables .cmb-row .cmb2-metabox-description,.inner-sidebar .cmb-row .cmb2-metabox-description{padding-bottom:1.8em}#side-sortables .cmb2-metabox-title,.inner-sidebar .cmb2-metabox-title{font-size:1.2em;font-style:italic}#side-sortables .cmb-remove-row,.inner-sidebar .cmb-remove-row{clear:both;padding-top:12px;padding-bottom:0}#side-sortables .cmb2-upload-button,.inner-sidebar .cmb2-upload-button{clear:both;margin-top:12px}.cmb2-metabox .cmbhandle{color:#757575;float:right;width:27px;height:30px;cursor:pointer;right:-1em;position:relative}.cmb2-metabox .cmbhandle:before{content:'\f142';right:12px;font:normal 20px/1 dashicons;speak:none;display:inline-block;padding:8px 10px;top:0;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.cmb2-metabox .postbox.closed .cmbhandle:before{content:'\f140'}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row{-webkit-appearance:none!important;background:0 0!important;border:none!important;position:absolute;left:0;top:.5em;line-height:1em;padding:2px 6px 3px;opacity:.5}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]){cursor:pointer;color:#a00;opacity:1}.cmb2-metabox button.dashicons-before.dashicons-no-alt.cmb-remove-group-row:not([disabled]):hover{color:red}* html .cmb2-element.ui-helper-clearfix{height:1%}.cmb2-element .ui-datepicker,.cmb2-element.ui-datepicker{padding:0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;background-color:#fff;border:1px solid #dfdfdf;border-top:none;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.075);box-shadow:0 3px 6px rgba(0,0,0,.075);min-width:17em;width:auto}.cmb2-element .ui-datepicker *,.cmb2-element.ui-datepicker *{padding:0;font-family:"Open Sans",sans-serif;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.cmb2-element .ui-datepicker table,.cmb2-element.ui-datepicker table{font-size:13px;margin:0;border:none;border-collapse:collapse}.cmb2-element .ui-datepicker .ui-datepicker-header,.cmb2-element .ui-datepicker .ui-widget-header,.cmb2-element.ui-datepicker .ui-datepicker-header,.cmb2-element.ui-datepicker .ui-widget-header{background-image:none;border:none;color:#fff;font-weight:400}.cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover,.cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover{background:0 0;border-color:transparent;cursor:pointer}.cmb2-element .ui-datepicker .ui-datepicker-title,.cmb2-element.ui-datepicker .ui-datepicker-title{margin:0;padding:10px 0;color:#fff;font-size:14px;line-height:14px;text-align:center}.cmb2-element .ui-datepicker .ui-datepicker-title select,.cmb2-element.ui-datepicker .ui-datepicker-title select{margin-top:-8px;margin-bottom:-8px}.cmb2-element .ui-datepicker .ui-datepicker-next,.cmb2-element .ui-datepicker .ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-datepicker-next,.cmb2-element.ui-datepicker .ui-datepicker-prev{position:relative;top:0;height:34px;width:34px}.cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-next,.cmb2-element .ui-datepicker .ui-state-hover.ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-next,.cmb2-element.ui-datepicker .ui-state-hover.ui-datepicker-prev{border:none}.cmb2-element .ui-datepicker .ui-datepicker-prev,.cmb2-element .ui-datepicker .ui-datepicker-prev-hover,.cmb2-element.ui-datepicker .ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-datepicker-prev-hover{left:0}.cmb2-element .ui-datepicker .ui-datepicker-next,.cmb2-element .ui-datepicker .ui-datepicker-next-hover,.cmb2-element.ui-datepicker .ui-datepicker-next,.cmb2-element.ui-datepicker .ui-datepicker-next-hover{right:0}.cmb2-element .ui-datepicker .ui-datepicker-next span,.cmb2-element .ui-datepicker .ui-datepicker-prev span,.cmb2-element.ui-datepicker .ui-datepicker-next span,.cmb2-element.ui-datepicker .ui-datepicker-prev span{display:none}.cmb2-element .ui-datepicker .ui-datepicker-prev,.cmb2-element.ui-datepicker .ui-datepicker-prev{float:left}.cmb2-element .ui-datepicker .ui-datepicker-next,.cmb2-element.ui-datepicker .ui-datepicker-next{float:right}.cmb2-element .ui-datepicker .ui-datepicker-next:before,.cmb2-element .ui-datepicker .ui-datepicker-prev:before,.cmb2-element.ui-datepicker .ui-datepicker-next:before,.cmb2-element.ui-datepicker .ui-datepicker-prev:before{font:normal 20px/34px dashicons;padding-left:7px;color:#fff;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:34px;height:34px}.cmb2-element .ui-datepicker .ui-datepicker-prev:before,.cmb2-element.ui-datepicker .ui-datepicker-prev:before{content:'\f341'}.cmb2-element .ui-datepicker .ui-datepicker-next:before,.cmb2-element.ui-datepicker .ui-datepicker-next:before{content:'\f345'}.cmb2-element .ui-datepicker .ui-datepicker-next-hover:before,.cmb2-element .ui-datepicker .ui-datepicker-prev-hover:before,.cmb2-element.ui-datepicker .ui-datepicker-next-hover:before,.cmb2-element.ui-datepicker .ui-datepicker-prev-hover:before{opacity:.7}.cmb2-element .ui-datepicker select.ui-datepicker-month,.cmb2-element .ui-datepicker select.ui-datepicker-year,.cmb2-element.ui-datepicker select.ui-datepicker-month,.cmb2-element.ui-datepicker select.ui-datepicker-year{width:33%;background:0 0;border-color:transparent;box-shadow:none;color:#fff}.cmb2-element .ui-datepicker select.ui-datepicker-month option,.cmb2-element .ui-datepicker select.ui-datepicker-year option,.cmb2-element.ui-datepicker select.ui-datepicker-month option,.cmb2-element.ui-datepicker select.ui-datepicker-year option{color:#333}.cmb2-element .ui-datepicker thead,.cmb2-element.ui-datepicker thead{color:#fff;font-weight:600}.cmb2-element .ui-datepicker thead th,.cmb2-element.ui-datepicker thead th{font-weight:400}.cmb2-element .ui-datepicker th,.cmb2-element.ui-datepicker th{padding:10px}.cmb2-element .ui-datepicker td,.cmb2-element.ui-datepicker td{padding:0;border:1px solid #f4f4f4}.cmb2-element .ui-datepicker td.ui-datepicker-other-month,.cmb2-element.ui-datepicker td.ui-datepicker-other-month{border:transparent}.cmb2-element .ui-datepicker td.ui-datepicker-week-end,.cmb2-element.ui-datepicker td.ui-datepicker-week-end{background-color:#f4f4f4;border:1px solid #f4f4f4}.cmb2-element .ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today,.cmb2-element.ui-datepicker td.ui-datepicker-week-end.ui-datepicker-today{-webkit-box-shadow:inset 0 0 1px 0 rgba(0,0,0,.1);-moz-box-shadow:inset 0 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 0 1px 0 rgba(0,0,0,.1)}.cmb2-element .ui-datepicker td.ui-datepicker-today,.cmb2-element.ui-datepicker td.ui-datepicker-today{background-color:#f0f0c0}.cmb2-element .ui-datepicker td.ui-datepicker-current-day,.cmb2-element.ui-datepicker td.ui-datepicker-current-day{background:#bd8}.cmb2-element .ui-datepicker td .ui-state-default,.cmb2-element.ui-datepicker td .ui-state-default{background:0 0;border:none;text-align:center;text-decoration:none;width:auto;display:block;padding:5px 10px;font-weight:400;color:#444}.cmb2-element .ui-datepicker td.ui-state-disabled .ui-state-default,.cmb2-element.ui-datepicker td.ui-state-disabled .ui-state-default{opacity:.5}.cmb2-element .ui-datepicker .ui-datepicker-header,.cmb2-element .ui-datepicker .ui-widget-header,.cmb2-element.ui-datepicker .ui-datepicker-header,.cmb2-element.ui-datepicker .ui-widget-header{background:#00a0d2}.cmb2-element .ui-datepicker thead,.cmb2-element.ui-datepicker thead{background:#32373c}.cmb2-element .ui-datepicker td .ui-state-active,.cmb2-element .ui-datepicker td .ui-state-hover,.cmb2-element.ui-datepicker td .ui-state-active,.cmb2-element.ui-datepicker td .ui-state-hover{background:#0073aa;color:#fff}.cmb2-element .ui-datepicker .ui-timepicker-div,.cmb2-element.ui-datepicker .ui-timepicker-div{font-size:14px}.cmb2-element .ui-datepicker .ui-timepicker-div dl,.cmb2-element.ui-datepicker .ui-timepicker-div dl{text-align:left;padding:0 .6em}.cmb2-element .ui-datepicker .ui-timepicker-div dl dt,.cmb2-element.ui-datepicker .ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.cmb2-element .ui-datepicker .ui-timepicker-div dl dd,.cmb2-element.ui-datepicker .ui-timepicker-div dl dd{margin:0 10px 10px 40%}.cmb2-element .ui-datepicker .ui-timepicker-div dl dd select,.cmb2-element.ui-datepicker .ui-timepicker-div dl dd select{width:100%}.cmb2-element .ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane,.cmb2-element.ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane{padding:.6em;text-align:left}.cmb2-element .ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-primary,.cmb2-element .ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-secondary,.cmb2-element.ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-primary,.cmb2-element.ui-datepicker .ui-timepicker-div+.ui-datepicker-buttonpane .button-secondary{padding:0 10px 1px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;margin:0 .6em .4em .4em}.admin-color-fresh .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-fresh .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-fresh .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-fresh .cmb2-element.ui-datepicker .ui-widget-header{background:#00a0d2}.admin-color-fresh .cmb2-element .ui-datepicker thead,.admin-color-fresh .cmb2-element.ui-datepicker thead{background:#32373c}.admin-color-fresh .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-fresh .cmb2-element.ui-datepicker td .ui-state-hover{background:#0073aa;color:#fff}.admin-color-blue .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-blue .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-blue .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-blue .cmb2-element.ui-datepicker .ui-widget-header{background:#52accc}.admin-color-blue .cmb2-element .ui-datepicker thead,.admin-color-blue .cmb2-element.ui-datepicker thead{background:#4796b3}.admin-color-blue .cmb2-element .ui-datepicker td .ui-state-active,.admin-color-blue .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-blue .cmb2-element.ui-datepicker td .ui-state-active,.admin-color-blue .cmb2-element.ui-datepicker td .ui-state-hover{background:#096484;color:#fff}.admin-color-blue .cmb2-element .ui-datepicker td.ui-datepicker-today,.admin-color-blue .cmb2-element.ui-datepicker td.ui-datepicker-today{background:#eee}.admin-color-coffee .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-coffee .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-coffee .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-coffee .cmb2-element.ui-datepicker .ui-widget-header{background:#59524c}.admin-color-coffee .cmb2-element .ui-datepicker thead,.admin-color-coffee .cmb2-element.ui-datepicker thead{background:#46403c}.admin-color-coffee .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-coffee .cmb2-element.ui-datepicker td .ui-state-hover{background:#c7a589;color:#fff}.admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-ectoplasm .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-ectoplasm .cmb2-element.ui-datepicker .ui-widget-header{background:#523f6d}.admin-color-ectoplasm .cmb2-element .ui-datepicker thead,.admin-color-ectoplasm .cmb2-element.ui-datepicker thead{background:#413256}.admin-color-ectoplasm .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-ectoplasm .cmb2-element.ui-datepicker td .ui-state-hover{background:#a3b745;color:#fff}.admin-color-midnight .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-midnight .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-midnight .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-midnight .cmb2-element.ui-datepicker .ui-widget-header{background:#363b3f}.admin-color-midnight .cmb2-element .ui-datepicker thead,.admin-color-midnight .cmb2-element.ui-datepicker thead{background:#26292c}.admin-color-midnight .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-midnight .cmb2-element.ui-datepicker td .ui-state-hover{background:#e14d43;color:#fff}.admin-color-ocean .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-ocean .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-ocean .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-ocean .cmb2-element.ui-datepicker .ui-widget-header{background:#738e96}.admin-color-ocean .cmb2-element .ui-datepicker thead,.admin-color-ocean .cmb2-element.ui-datepicker thead{background:#627c83}.admin-color-ocean .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-ocean .cmb2-element.ui-datepicker td .ui-state-hover{background:#9ebaa0;color:#fff}.admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-sunrise .cmb2-element .ui-datepicker .ui-datepicker-header .ui-state-hover,.admin-color-sunrise .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-sunrise .cmb2-element.ui-datepicker .ui-datepicker-header .ui-state-hover,.admin-color-sunrise .cmb2-element.ui-datepicker .ui-widget-header{background:#cf4944}.admin-color-sunrise .cmb2-element .ui-datepicker th,.admin-color-sunrise .cmb2-element.ui-datepicker th{border-color:#be3631;background:#be3631}.admin-color-sunrise .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-sunrise .cmb2-element.ui-datepicker td .ui-state-hover{background:#dd823b;color:#fff}.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-light .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-light .cmb2-element.ui-datepicker .ui-widget-header{background:#e5e5e5}.admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-month,.admin-color-light .cmb2-element .ui-datepicker select.ui-datepicker-year,.admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-month,.admin-color-light .cmb2-element.ui-datepicker select.ui-datepicker-year{color:#555}.admin-color-light .cmb2-element .ui-datepicker thead,.admin-color-light .cmb2-element.ui-datepicker thead{background:#888}.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-next:before,.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-prev:before,.admin-color-light .cmb2-element .ui-datepicker .ui-datepicker-title,.admin-color-light .cmb2-element .ui-datepicker td .ui-state-default,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-next:before,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-prev:before,.admin-color-light .cmb2-element.ui-datepicker .ui-datepicker-title,.admin-color-light .cmb2-element.ui-datepicker td .ui-state-default{color:#555}.admin-color-light .cmb2-element .ui-datepicker td .ui-state-active,.admin-color-light .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-light .cmb2-element.ui-datepicker td .ui-state-active,.admin-color-light .cmb2-element.ui-datepicker td .ui-state-hover{background:#ccc}.admin-color-light .cmb2-element .ui-datepicker td.ui-datepicker-today,.admin-color-light .cmb2-element.ui-datepicker td.ui-datepicker-today{background:#eee}.admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-bbp-evergreen .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker .ui-widget-header{background:#56b274}.admin-color-bbp-evergreen .cmb2-element .ui-datepicker thead,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker thead{background:#36533f}.admin-color-bbp-evergreen .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-bbp-evergreen .cmb2-element.ui-datepicker td .ui-state-hover{background:#446950;color:#fff}.admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-datepicker-header,.admin-color-bbp-mint .cmb2-element .ui-datepicker .ui-widget-header,.admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-datepicker-header,.admin-color-bbp-mint .cmb2-element.ui-datepicker .ui-widget-header{background:#4ca26a}.admin-color-bbp-mint .cmb2-element .ui-datepicker thead,.admin-color-bbp-mint .cmb2-element.ui-datepicker thead{background:#4f6d59}.admin-color-bbp-mint .cmb2-element .ui-datepicker td .ui-state-hover,.admin-color-bbp-mint .cmb2-element.ui-datepicker td .ui-state-hover{background:#5fb37c;color:#fff}.cmb2-char-counter-wrap{margin:.5em 0 1em}.cmb2-char-counter-wrap input[type=text]{font-size:12px;width:25px}.cmb2-char-counter-wrap.cmb2-max-exceeded input[type=text]{border-color:#a00!important}.cmb2-char-counter-wrap.cmb2-max-exceeded .cmb2-char-max-msg{display:inline-block}.cmb2-char-max-msg{color:#a00;display:none;font-weight:600;margin-left:1em}
 
includes/lib/cmb2/css/index.php DELETED
@@ -1,2 +0,0 @@
1
- <?php
2
- // Silence is golden
 
 
includes/lib/cmb2/images/index.php DELETED
@@ -1,2 +0,0 @@
1
- <?php
2
- // Silence is golden
 
 
includes/lib/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png DELETED
Binary file
includes/lib/cmb2/images/ui-bg_flat_75_ffffff_40x100.png DELETED
Binary file
includes/lib/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png DELETED
Binary file
includes/lib/cmb2/images/ui-bg_glass_65_ffffff_1x400.png DELETED
Binary file
includes/lib/cmb2/images/ui-bg_glass_75_dadada_1x400.png DELETED
Binary file
includes/lib/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png DELETED
Binary file
includes/lib/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png DELETED
Binary file
includes/lib/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png DELETED
Binary file
includes/lib/cmb2/images/ui-icons_222222_256x240.png DELETED
Binary file
includes/lib/cmb2/images/ui-icons_2e83ff_256x240.png DELETED
Binary file
includes/lib/cmb2/images/ui-icons_454545_256x240.png DELETED
Binary file
includes/lib/cmb2/images/ui-icons_888888_256x240.png DELETED
Binary file
includes/lib/cmb2/images/ui-icons_cd0a0a_256x240.png DELETED
Binary file
includes/lib/cmb2/includes/CMB2.php DELETED
@@ -1,1817 +0,0 @@
1
- <?php
2
- /**
3
- * CMB2 - The core metabox object
4
- *
5
- * @category WordPress_Plugin
6
- * @package CMB2
7
- * @author CMB2 team
8
- * @license GPL-2.0+
9
- * @link https://cmb2.io
10
- *
11
- * @property-read string $cmb_id
12
- * @property-read array $meta_box
13
- * @property-read array $updated
14
- * @property-read bool $has_columns
15
- * @property-read array $tax_metaboxes_to_remove
16
- */
17
-
18
- /**
19
- * The main CMB2 object for storing box data/properties.
20
- */
21
- class CMB2 extends CMB2_Base {
22
-
23
- /**
24
- * The object properties name.
25
- *
26
- * @var string
27
- * @since 2.2.3
28
- */
29
- protected $properties_name = 'meta_box';
30
-
31
- /**
32
- * Metabox Config array
33
- *
34
- * @var array
35
- * @since 0.9.0
36
- */
37
- protected $meta_box = array();
38
-
39
- /**
40
- * Type of object registered for metabox. (e.g., post, user, or comment)
41
- *
42
- * @var string
43
- * @since 1.0.0
44
- */
45
- protected $mb_object_type = null;
46
-
47
- /**
48
- * List of fields that are changed/updated on save
49
- *
50
- * @var array
51
- * @since 1.1.0
52
- */
53
- protected $updated = array();
54
-
55
- /**
56
- * Metabox Defaults
57
- *
58
- * @var array
59
- * @since 1.0.1
60
- */
61
- protected $mb_defaults = array(
62
- 'id' => '',
63
- 'title' => '',
64
- // Post type slug, or 'user', 'term', 'comment', or 'options-page'.
65
- 'object_types' => array(),
66
-
67
- /**
68
- * The context within the screen where the boxes should display. Available contexts vary
69
- * from screen to screen. Post edit screen contexts include 'normal', 'side', and 'advanced'.
70
- *
71
- * For placement in locations outside of a metabox, other options include:
72
- * 'form_top', 'before_permalink', 'after_title', 'after_editor'
73
- *
74
- * Comments screen contexts include 'normal' and 'side'. Default is 'normal'.
75
- */
76
- 'context' => 'normal',
77
- 'priority' => 'high', // Or 10 for options pages.
78
- 'show_names' => true, // Show field names on the left.
79
- 'show_on_cb' => null, // Callback to determine if metabox should display.
80
- 'show_on' => array(), // Post IDs or page templates to display this metabox. overrides 'show_on_cb'.
81
- 'cmb_styles' => true, // Include CMB2 stylesheet.
82
- 'enqueue_js' => true, // Include CMB2 JS.
83
- 'fields' => array(),
84
-
85
- /**
86
- * Handles hooking CMB2 forms/metaboxes into the post/attachement/user/options-page screens
87
- * and handles hooking in and saving those fields.
88
- */
89
- 'hookup' => true,
90
- 'save_fields' => true, // Will not save during hookup if false.
91
- 'closed' => false, // Default metabox to being closed.
92
- 'taxonomies' => array(),
93
- 'new_user_section' => 'add-new-user', // or 'add-existing-user'.
94
- 'new_term_section' => true,
95
- 'show_in_rest' => false,
96
- 'classes' => null, // Optionally add classes to the CMB2 wrapper.
97
- 'classes_cb' => '', // Optionally add classes to the CMB2 wrapper (via a callback).
98
-
99
- /*
100
- * The following parameter is for post alternate-context metaboxes only.
101
- *
102
- * To output the fields 'naked' (without a postbox wrapper/style), then
103
- * add a `'remove_box_wrap' => true` to your metabox registration array.
104
- */
105
- 'remove_box_wrap' => false,
106
-
107
- /*
108
- * The following parameter is any additional arguments passed as $callback_args
109
- * to add_meta_box, if/when applicable.
110
- *
111
- * CMB2 does not use these arguments in the add_meta_box callback, however, these args
112
- * are parsed for certain special properties, like determining Gutenberg/block-editor
113
- * compatibility.
114
- *
115
- * Examples:
116
- *
117
- * - Make sure default editor is used as metabox is not compatible with block editor
118
- * [ '__block_editor_compatible_meta_box' => false/true ]
119
- *
120
- * - Or declare this box exists for backwards compatibility
121
- * [ '__back_compat_meta_box' => false ]
122
- *
123
- * More: https://wordpress.org/gutenberg/handbook/extensibility/meta-box/
124
- */
125
- 'mb_callback_args' => null,
126
-
127
- /*
128
- * The following parameters are for options-page metaboxes,
129
- * and several are passed along to add_menu_page()/add_submenu_page()
130
- */
131
-
132
- // 'menu_title' => null, // Falls back to 'title' (above). Do not define here so we can set a fallback.
133
- 'message_cb' => '', // Optionally define the options-save message (via a callback).
134
- 'option_key' => '', // The actual option key and admin menu page slug.
135
- 'parent_slug' => '', // Used as first param in add_submenu_page().
136
- 'capability' => 'manage_options', // Cap required to view options-page.
137
- 'icon_url' => '', // Menu icon. Only applicable if 'parent_slug' is left empty.
138
- 'position' => null, // Menu position. Only applicable if 'parent_slug' is left empty.
139
-
140
- 'admin_menu_hook' => 'admin_menu', // Alternately 'network_admin_menu' to add network-level options page.
141
- 'display_cb' => false, // Override the options-page form output (CMB2_Hookup::options_page_output()).
142
- 'save_button' => '', // The text for the options-page save button. Defaults to 'Save'.
143
- 'disable_settings_errors' => false, // On settings pages (not options-general.php sub-pages), allows disabling.
144
- 'tab_group' => '', // Tab-group identifier, enables options page tab navigation.
145
- // 'tab_title' => null, // Falls back to 'title' (above). Do not define here so we can set a fallback.
146
- // 'autoload' => true, // Defaults to true, the options-page option will be autloaded.
147
- );
148
-
149
- /**
150
- * Metabox field objects
151
- *
152
- * @var array
153
- * @since 2.0.3
154
- */
155
- protected $fields = array();
156
-
157
- /**
158
- * An array of hidden fields to output at the end of the form
159
- *
160
- * @var array
161
- * @since 2.0.0
162
- */
163
- protected $hidden_fields = array();
164
-
165
- /**
166
- * Array of key => value data for saving. Likely $_POST data.
167
- *
168
- * @var string
169
- * @since 2.0.0
170
- */
171
- protected $generated_nonce = '';
172
-
173
- /**
174
- * Whether there are fields to be shown in columns. Set in CMB2::add_field().
175
- *
176
- * @var bool
177
- * @since 2.2.2
178
- */
179
- protected $has_columns = false;
180
-
181
- /**
182
- * If taxonomy field is requesting to remove_default, we store the taxonomy here.
183
- *
184
- * @var array
185
- * @since 2.2.3
186
- */
187
- protected $tax_metaboxes_to_remove = array();
188
-
189
- /**
190
- * Get started
191
- *
192
- * @since 0.4.0
193
- * @param array $config Metabox config array.
194
- * @param integer $object_id Optional object id.
195
- */
196
- public function __construct( $config, $object_id = 0 ) {
197
-
198
- if ( empty( $config['id'] ) ) {
199
- wp_die( esc_html__( 'Metabox configuration is required to have an ID parameter.', 'cmb2' ) );
200
- }
201
-
202
- $this->cmb_id = $config['id'];
203
- $this->meta_box = wp_parse_args( $config, $this->mb_defaults );
204
- $this->meta_box['fields'] = array();
205
-
206
- // Ensures object_types is an array.
207
- $this->set_prop( 'object_types', $this->box_types() );
208
- $this->object_id( $object_id );
209
-
210
- if ( $this->is_options_page_mb() ) {
211
-
212
- // Check initial priority.
213
- if ( empty( $config['priority'] ) ) {
214
-
215
- // If not explicitly defined, Reset the priority to 10
216
- // Fixes https://github.com/CMB2/CMB2/issues/1410.
217
- $this->meta_box['priority'] = 10;
218
- }
219
-
220
- $this->init_options_mb();
221
- }
222
-
223
- $this->mb_object_type();
224
-
225
- if ( ! empty( $config['fields'] ) && is_array( $config['fields'] ) ) {
226
- $this->add_fields( $config['fields'] );
227
- }
228
-
229
- CMB2_Boxes::add( $this );
230
-
231
- /**
232
- * Hook during initiation of CMB2 object
233
- *
234
- * The dynamic portion of the hook name, $this->cmb_id, is this meta_box id.
235
- *
236
- * @param array $cmb This CMB2 object
237
- */
238
- do_action( "cmb2_init_{$this->cmb_id}", $this );
239
-
240
- // Hook in the hookup... how meta.
241
- add_action( "cmb2_init_hookup_{$this->cmb_id}", array( 'CMB2_Hookup', 'maybe_init_and_hookup' ) );
242
-
243
- // Hook in the rest api functionality.
244
- add_action( "cmb2_init_hookup_{$this->cmb_id}", array( 'CMB2_REST', 'maybe_init_and_hookup' ) );
245
- }
246
-
247
- /**
248
- * Loops through and displays fields
249
- *
250
- * @since 1.0.0
251
- * @param int $object_id Object ID.
252
- * @param string $object_type Type of object being saved. (e.g., post, user, or comment).
253
- *
254
- * @return CMB2
255
- */
256
- public function show_form( $object_id = 0, $object_type = '' ) {
257
- $this->render_form_open( $object_id, $object_type );
258
-
259
- foreach ( $this->prop( 'fields' ) as $field_args ) {
260
- $this->render_field( $field_args );
261
- }
262
-
263
- return $this->render_form_close( $object_id, $object_type );
264
- }
265
-
266
- /**
267
- * Outputs the opening form markup and runs corresponding hooks:
268
- * 'cmb2_before_form' and "cmb2_before_{$object_type}_form_{$this->cmb_id}"
269
- *
270
- * @since 2.2.0
271
- * @param integer $object_id Object ID.
272
- * @param string $object_type Object type.
273
- *
274
- * @return CMB2
275
- */
276
- public function render_form_open( $object_id = 0, $object_type = '' ) {
277
- $object_type = $this->object_type( $object_type );
278
- $object_id = $this->object_id( $object_id );
279
-
280
- echo "\n<!-- Begin CMB2 Fields -->\n";
281
-
282
- $this->nonce_field();
283
-
284
- /**
285
- * Hook before form table begins
286
- *
287
- * @param array $cmb_id The current box ID.
288
- * @param int $object_id The ID of the current object.
289
- * @param string $object_type The type of object you are working with.
290
- * Usually `post` (this applies to all post-types).
291
- * Could also be `comment`, `user` or `options-page`.
292
- * @param array $cmb This CMB2 object.
293
- */
294
- do_action( 'cmb2_before_form', $this->cmb_id, $object_id, $object_type, $this );
295
-
296
- /**
297
- * Hook before form table begins
298
- *
299
- * The first dynamic portion of the hook name, $object_type, is the type of object
300
- * you are working with. Usually `post` (this applies to all post-types).
301
- * Could also be `comment`, `user` or `options-page`.
302
- *
303
- * The second dynamic portion of the hook name, $this->cmb_id, is the meta_box id.
304
- *
305
- * @param array $cmb_id The current box ID
306
- * @param int $object_id The ID of the current object
307
- * @param array $cmb This CMB2 object
308
- */
309
- do_action( "cmb2_before_{$object_type}_form_{$this->cmb_id}", $object_id, $this );
310
-
311
- echo '<div class="', esc_attr( $this->box_classes() ), '"><div id="cmb2-metabox-', sanitize_html_class( $this->cmb_id ), '" class="cmb2-metabox cmb-field-list">';
312
-
313
- return $this;
314
- }
315
-
316
- /**
317
- * Defines the classes for the CMB2 form/wrap.
318
- *
319
- * @since 2.0.0
320
- * @return string Space concatenated list of classes
321
- */
322
- public function box_classes() {
323
-
324
- $classes = array( 'cmb2-wrap', 'form-table' );
325
-
326
- // Use the callback to fetch classes.
327
- if ( $added_classes = $this->get_param_callback_result( 'classes_cb' ) ) {
328
- $added_classes = is_array( $added_classes ) ? $added_classes : array( $added_classes );
329
- $classes = array_merge( $classes, $added_classes );
330
- }
331
-
332
- if ( $added_classes = $this->prop( 'classes' ) ) {
333
- $added_classes = is_array( $added_classes ) ? $added_classes : array( $added_classes );
334
- $classes = array_merge( $classes, $added_classes );
335
- }
336
-
337
- /**
338
- * Add our context classes for non-standard metaboxes.
339
- *
340
- * @since 2.2.4
341
- */
342
- if ( $this->is_alternate_context_box() ) {
343
- $context = array();
344
-
345
- // Include custom class if requesting no title.
346
- if ( ! $this->prop( 'title' ) && ! $this->prop( 'remove_box_wrap' ) ) {
347
- $context[] = 'cmb2-context-wrap-no-title';
348
- }
349
-
350
- // Include a generic context wrapper.
351
- $context[] = 'cmb2-context-wrap';
352
-
353
- // Include a context-type based context wrapper.
354
- $context[] = 'cmb2-context-wrap-' . $this->prop( 'context' );
355
-
356
- // Include an ID based context wrapper as well.
357
- $context[] = 'cmb2-context-wrap-' . $this->prop( 'id' );
358
-
359
- // And merge all the classes back into the array.
360
- $classes = array_merge( $classes, $context );
361
- }
362
-
363
- /**
364
- * Globally filter box wrap classes
365
- *
366
- * @since 2.2.2
367
- *
368
- * @param string $classes Array of classes for the cmb2-wrap.
369
- * @param CMB2 $cmb This CMB2 object.
370
- */
371
- $classes = apply_filters( 'cmb2_wrap_classes', $classes, $this );
372
-
373
- $split = array();
374
- foreach ( array_filter( $classes ) as $class ) {
375
- foreach ( explode( ' ', $class ) as $_class ) {
376
- // Clean up & sanitize.
377
- $split[] = sanitize_html_class( strip_tags( $_class ) );
378
- }
379
- }
380
- $classes = $split;
381
-
382
- // Remove any duplicates.
383
- $classes = array_unique( $classes );
384
-
385
- // Make it a string.
386
- return implode( ' ', $classes );
387
- }
388
-
389
- /**
390
- * Outputs the closing form markup and runs corresponding hooks:
391
- * 'cmb2_after_form' and "cmb2_after_{$object_type}_form_{$this->cmb_id}"
392
- *
393
- * @since 2.2.0
394
- * @param integer $object_id Object ID.
395
- * @param string $object_type Object type.
396
- *
397
- * @return CMB2
398
- */
399
- public function render_form_close( $object_id = 0, $object_type = '' ) {
400
- $object_type = $this->object_type( $object_type );
401
- $object_id = $this->object_id( $object_id );
402
-
403
- echo '</div></div>';
404
-
405
- $this->render_hidden_fields();
406
-
407
- /**
408
- * Hook after form form has been rendered
409
- *
410
- * The dynamic portion of the hook name, $this->cmb_id, is the meta_box id.
411
- *
412
- * The first dynamic portion of the hook name, $object_type, is the type of object
413
- * you are working with. Usually `post` (this applies to all post-types).
414
- * Could also be `comment`, `user` or `options-page`.
415
- *
416
- * @param int $object_id The ID of the current object
417
- * @param array $cmb This CMB2 object
418
- */
419
- do_action( "cmb2_after_{$object_type}_form_{$this->cmb_id}", $object_id, $this );
420
-
421
- /**
422
- * Hook after form form has been rendered
423
- *
424
- * @param array $cmb_id The current box ID.
425
- * @param int $object_id The ID of the current object.
426
- * @param string $object_type The type of object you are working with.
427
- * Usually `post` (this applies to all post-types).
428
- * Could also be `comment`, `user` or `options-page`.
429
- * @param array $cmb This CMB2 object.
430
- */
431
- do_action( 'cmb2_after_form', $this->cmb_id, $object_id, $object_type, $this );
432
-
433
- echo "\n<!-- End CMB2 Fields -->\n";
434
-
435
- return $this;
436
- }
437
-
438
- /**
439
- * Renders a field based on the field type
440
- *
441
- * @since 2.2.0
442
- * @param array $field_args A field configuration array.
443
- * @return mixed CMB2_Field object if successful.
444
- */
445
- public function render_field( $field_args ) {
446
- $field_args['context'] = $this->prop( 'context' );
447
-
448
- if ( 'group' === $field_args['type'] ) {
449
-
450
- if ( ! isset( $field_args['show_names'] ) ) {
451
- $field_args['show_names'] = $this->prop( 'show_names' );
452
- }
453
- $field = $this->render_group( $field_args );
454
-
455
- } elseif ( 'hidden' === $field_args['type'] && $this->get_field( $field_args )->should_show() ) {
456
- // Save rendering for after the metabox.
457
- $field = $this->add_hidden_field( $field_args );
458
-
459
- } else {
460
-
461
- $field_args['show_names'] = $this->prop( 'show_names' );
462
-
463
- // Render default fields.
464
- $field = $this->get_field( $field_args )->render_field();
465
- }
466
-
467
- return $field;
468
- }
469
-
470
- /**
471
- * Render a group of fields.
472
- *
473
- * @param array|CMB2_Field $args Array of field arguments for a group field parent or the group parent field.
474
- * @return CMB2_Field|null Group field object.
475
- */
476
- public function render_group( $args ) {
477
- $field_group = false;
478
-
479
- if ( $args instanceof CMB2_Field ) {
480
- $field_group = 'group' === $args->type() ? $args : false;
481
- } elseif ( isset( $args['id'], $args['fields'] ) && is_array( $args['fields'] ) ) {
482
- $field_group = $this->get_field( $args );
483
- }
484
-
485
- if ( ! $field_group ) {
486
- return;
487
- }
488
-
489
- $field_group->render_context = 'edit';
490
- $field_group->peform_param_callback( 'render_row_cb' );
491
-
492
- return $field_group;
493
- }
494
-
495
- /**
496
- * The default callback to render a group of fields.
497
- *
498
- * @since 2.2.6
499
- *
500
- * @param array $field_args Array of field arguments for the group field parent.
501
- * @param CMB2_Field $field_group The CMB2_Field group object.
502
- *
503
- * @return CMB2_Field|null Group field object.
504
- */
505
- public function render_group_callback( $field_args, $field_group ) {
506
-
507
- // If field is requesting to be conditionally shown.
508
- if ( ! $field_group || ! $field_group->should_show() ) {
509
- return;
510
- }
511
-
512
- $field_group->index = 0;
513
-
514
- $field_group->peform_param_callback( 'before_group' );
515
-
516
- $desc = $field_group->args( 'description' );
517
- $label = $field_group->args( 'name' );
518
- $group_val = (array) $field_group->value();
519
-
520
- echo '<div class="cmb-row cmb-repeat-group-wrap ', esc_attr( $field_group->row_classes() ), '" data-fieldtype="group"><div class="cmb-td"><div data-groupid="', esc_attr( $field_group->id() ), '" id="', esc_attr( $field_group->id() ), '_repeat" ', $this->group_wrap_attributes( $field_group ), '>';
521
-
522
- if ( $desc || $label ) {
523
- $class = $desc ? ' cmb-group-description' : '';
524
- echo '<div class="cmb-row', $class, '"><div class="cmb-th">';
525
- if ( $label ) {
526
- echo '<h2 class="cmb-group-name">', $label, '</h2>';
527
- }
528
- if ( $desc ) {
529
- echo '<p class="cmb2-metabox-description">', $desc, '</p>';
530
- }
531
- echo '</div></div>';
532
- }
533
-
534
- if ( ! empty( $group_val ) ) {
535
- foreach ( $group_val as $group_key => $field_id ) {
536
- $this->render_group_row( $field_group );
537
- $field_group->index++;
538
- }
539
- } else {
540
- $this->render_group_row( $field_group );
541
- }
542
-
543
- if ( $field_group->args( 'repeatable' ) ) {
544
- echo '<div class="cmb-row"><div class="cmb-td"><p class="cmb-add-row"><button type="button" data-selector="', esc_attr( $field_group->id() ), '_repeat" data-grouptitle="', esc_attr( $field_group->options( 'group_title' ) ), '" class="cmb-add-group-row button-secondary">', $field_group->options( 'add_button' ), '</button></p></div></div>';
545
- }
546
-
547
- echo '</div></div></div>';
548
-
549
- $field_group->peform_param_callback( 'after_group' );
550
-
551
- return $field_group;
552
- }
553
-
554
- /**
555
- * Get the group wrap attributes, which are passed through a filter.
556
- *
557
- * @since 2.2.3
558
- * @param CMB2_Field $field_group The group CMB2_Field object.
559
- * @return string The attributes string.
560
- */
561
- public function group_wrap_attributes( $field_group ) {
562
- $classes = 'cmb-nested cmb-field-list cmb-repeatable-group';
563
- $classes .= $field_group->options( 'sortable' ) ? ' sortable' : ' non-sortable';
564
- $classes .= $field_group->args( 'repeatable' ) ? ' repeatable' : ' non-repeatable';
565
-
566
- $group_wrap_attributes = array(
567
- 'class' => $classes,
568
- 'style' => 'width:100%;',
569
- );
570
-
571
- /**
572
- * Allow for adding additional HTML attributes to a group wrapper.
573
- *
574
- * The attributes will be an array of key => value pairs for each attribute.
575
- *
576
- * @since 2.2.2
577
- *
578
- * @param string $group_wrap_attributes Current attributes array.
579
- * @param CMB2_Field $field_group The group CMB2_Field object.
580
- */
581
- $group_wrap_attributes = apply_filters( 'cmb2_group_wrap_attributes', $group_wrap_attributes, $field_group );
582
-
583
- $atts = array();
584
- foreach ( $group_wrap_attributes as $att => $att_value ) {
585
- if ( ! CMB2_Utils::is_data_attribute( $att ) ) {
586
- $att_value = htmlspecialchars( $att_value );
587
- }
588
-
589
- $atts[ sanitize_html_class( $att ) ] = sanitize_text_field( $att_value );
590
- }
591
-
592
- return CMB2_Utils::concat_attrs( $atts );
593
- }
594
-
595
- /**
596
- * Render a repeatable group row
597
- *
598
- * @since 1.0.2
599
- * @param CMB2_Field $field_group CMB2_Field group field object.
600
- *
601
- * @return CMB2
602
- */
603
- public function render_group_row( $field_group ) {
604
-
605
- $field_group->peform_param_callback( 'before_group_row' );
606
- $closed_class = $field_group->options( 'closed' ) ? ' closed' : '';
607
- $confirm_deletion = $field_group->options( 'remove_confirm' );
608
- $confirm_deletion = ! empty( $confirm_deletion ) ? $confirm_deletion : '';
609
-
610
- echo '
611
- <div id="cmb-group-', $field_group->id(), '-', $field_group->index, '" class="postbox cmb-row cmb-repeatable-grouping', $closed_class, '" data-iterator="', $field_group->index, '">';
612
-
613
- if ( $field_group->args( 'repeatable' ) ) {
614
- echo '<button type="button" data-selector="', $field_group->id(), '_repeat" data-confirm="', esc_attr( $confirm_deletion ), '" class="dashicons-before dashicons-no-alt cmb-remove-group-row" title="', esc_attr( $field_group->options( 'remove_button' ) ), '"></button>';
615
- }
616
-
617
- echo '
618
- <div class="cmbhandle" title="' , esc_attr__( 'Click to toggle', 'cmb2' ), '"><br></div>
619
- <h3 class="cmb-group-title cmbhandle-title"><span>', $field_group->replace_hash( $field_group->options( 'group_title' ) ), '</span></h3>
620
-
621
- <div class="inside cmb-td cmb-nested cmb-field-list">';
622
- // Loop and render repeatable group fields.
623
- foreach ( array_values( $field_group->args( 'fields' ) ) as $field_args ) {
624
- if ( 'hidden' === $field_args['type'] ) {
625
-
626
- // Save rendering for after the metabox.
627
- $this->add_hidden_field( $field_args, $field_group );
628
-
629
- } else {
630
-
631
- $field_args['show_names'] = $field_group->args( 'show_names' );
632
- $field_args['context'] = $field_group->args( 'context' );
633
-
634
- $this->get_field( $field_args, $field_group )->render_field();
635
- }
636
- }
637
-
638
- if ( $field_group->args( 'repeatable' ) ) {
639
- echo '
640
- <div class="cmb-row cmb-remove-field-row">
641
- <div class="cmb-remove-row">
642
- <button type="button" data-selector="', $field_group->id(), '_repeat" data-confirm="', esc_attr( $confirm_deletion ), '" class="cmb-remove-group-row cmb-remove-group-row-button alignright button-secondary">', $field_group->options( 'remove_button' ), '</button>
643
- </div>
644
- </div>
645
- ';
646
- }
647
- echo '
648
- </div>
649
- </div>
650
- ';
651
-
652
- $field_group->peform_param_callback( 'after_group_row' );
653
-
654
- return $this;
655
- }
656
-
657
- /**
658
- * Add a hidden field to the list of hidden fields to be rendered later.
659
- *
660
- * @since 2.0.0
661
- *
662
- * @param array $field_args Array of field arguments to be passed to CMB2_Field.
663
- * @param CMB2_Field|null $field_group CMB2_Field group field object.
664
- * @return CMB2_Field
665
- */
666
- public function add_hidden_field( $field_args, $field_group = null ) {
667
- if ( isset( $field_args['field_args'] ) ) {
668
- // For back-compatibility.
669
- $field = new CMB2_Field( $field_args );
670
- } else {
671
- $field = $this->get_new_field( $field_args, $field_group );
672
- }
673
-
674
- $types = new CMB2_Types( $field );
675
-
676
- if ( $field_group ) {
677
- $types->iterator = $field_group->index;
678
- }
679
-
680
- $this->hidden_fields[] = $types;
681
-
682
- return $field;
683
- }
684
-
685
- /**
686
- * Loop through and output hidden fields
687
- *
688
- * @since 2.0.0
689
- *
690
- * @return CMB2
691
- */
692
- public function render_hidden_fields() {
693
- if ( ! empty( $this->hidden_fields ) ) {
694
- foreach ( $this->hidden_fields as $hidden ) {
695
- $hidden->render();
696
- }
697
- }
698
-
699
- return $this;
700
- }
701
-
702
- /**
703
- * Returns array of sanitized field values (without saving them)
704
- *
705
- * @since 2.0.3
706
- * @param array $data_to_sanitize Array of field_id => value data for sanitizing (likely $_POST data).
707
- * @return mixed
708
- */
709
- public function get_sanitized_values( array $data_to_sanitize ) {
710
- $this->data_to_save = $data_to_sanitize;
711
- $stored_id = $this->object_id();
712
-
713
- // We do this So CMB will sanitize our data for us, but not save it.
714
- $this->object_id( '_' );
715
-
716
- // Ensure temp. data store is empty.
717
- cmb2_options( 0 )->set();
718
-
719
- // We want to get any taxonomy values back.
720
- add_filter( "cmb2_return_taxonomy_values_{$this->cmb_id}", '__return_true' );
721
-
722
- // Process/save fields.
723
- $this->process_fields();
724
-
725
- // Put things back the way they were.
726
- remove_filter( "cmb2_return_taxonomy_values_{$this->cmb_id}", '__return_true' );
727
-
728
- // Get data from temp. data store.
729
- $sanitized_values = cmb2_options( 0 )->get_options();
730
-
731
- // Empty out temp. data store again.
732
- cmb2_options( 0 )->set();
733
-
734
- // Reset the object id.
735
- $this->object_id( $stored_id );
736
-
737
- return $sanitized_values;
738
- }
739
-
740
- /**
741
- * Loops through and saves field data
742
- *
743
- * @since 1.0.0
744
- * @param int $object_id Object ID.
745
- * @param string $object_type Type of object being saved. (e.g., post, user, or comment).
746
- * @param array $data_to_save Array of key => value data for saving. Likely $_POST data.
747
- *
748
- * @return CMB2
749
- */
750
- public function save_fields( $object_id = 0, $object_type = '', $data_to_save = array() ) {
751
-
752
- // Fall-back to $_POST data.
753
- $this->data_to_save = ! empty( $data_to_save ) ? $data_to_save : $_POST;
754
- $object_id = $this->object_id( $object_id );
755
- $object_type = $this->object_type( $object_type );
756
-
757
- $this->process_fields();
758
-
759
- // If options page, save the updated options.
760
- if ( 'options-page' === $object_type ) {
761
- cmb2_options( $object_id )->set();
762
- }
763
-
764
- return $this->after_save();
765
- }
766
-
767
- /**
768
- * Process and save form fields
769
- *
770
- * @since 2.0.0
771
- *
772
- * @return CMB2
773
- */
774
- public function process_fields() {
775
-
776
- $this->pre_process();
777
-
778
- // Remove the show_on properties so saving works.
779
- $this->prop( 'show_on', array() );
780
-
781
- // save field ids of those that are updated.
782
- $this->updated = array();
783
-
784
- foreach ( $this->prop( 'fields' ) as $field_args ) {
785
- $this->process_field( $field_args );
786
- }
787
-
788
- return $this;
789
- }
790
-
791
- /**
792
- * Process and save a field
793
- *
794
- * @since 2.0.0
795
- * @param array $field_args Array of field arguments.
796
- *
797
- * @return CMB2
798
- */
799
- public function process_field( $field_args ) {
800
-
801
- switch ( $field_args['type'] ) {
802
-
803
- case 'group':
804
- if ( $this->save_group( $field_args ) ) {
805
- $this->updated[] = $field_args['id'];
806
- }
807
-
808
- break;
809
-
810
- case 'title':
811
- // Don't process title fields.
812
- break;
813
-
814
- default:
815
- $field = $this->get_new_field( $field_args );
816
-
817
- if ( $field->save_field_from_data( $this->data_to_save ) ) {
818
- $this->updated[] = $field->id();
819
- }
820
-
821
- break;
822
- }
823
-
824
- return $this;
825
- }
826
-
827
- /**
828
- * Fires the "cmb2_{$object_type}_process_fields_{$cmb_id}" action hook.
829
- *
830
- * @since 2.2.2
831
- *
832
- * @return CMB2
833
- */
834
- public function pre_process() {
835
- $object_type = $this->object_type();
836
-
837
- /**
838
- * Fires before fields have been processed/saved.
839
- *
840
- * The dynamic portion of the hook name, $object_type, refers to the
841
- * metabox/form's object type
842
- * Usually `post` (this applies to all post-types).
843
- * Could also be `comment`, `user` or `options-page`.
844
- *
845
- * The dynamic portion of the hook name, $this->cmb_id, is the meta_box id.
846
- *
847
- * @param array $cmb This CMB2 object
848
- * @param int $object_id The ID of the current object
849
- */
850
- do_action( "cmb2_{$object_type}_process_fields_{$this->cmb_id}", $this, $this->object_id() );
851
-
852
- return $this;
853
- }
854
-
855
- /**
856
- * Fires the "cmb2_save_{$object_type}_fields" and
857
- * "cmb2_save_{$object_type}_fields_{$cmb_id}" action hooks.
858
- *
859
- * @since 2.x.x
860
- *
861
- * @return CMB2
862
- */
863
- public function after_save() {
864
- $object_type = $this->object_type();
865
- $object_id = $this->object_id();
866
-
867
- /**
868
- * Fires after all fields have been saved.
869
- *
870
- * The dynamic portion of the hook name, $object_type, refers to the metabox/form's object type
871
- * Usually `post` (this applies to all post-types).
872
- * Could also be `comment`, `user` or `options-page`.
873
- *
874
- * @param int $object_id The ID of the current object
875
- * @param array $cmb_id The current box ID
876
- * @param string $updated Array of field ids that were updated.
877
- * Will only include field ids that had values change.
878
- * @param array $cmb This CMB2 object
879
- */
880
- do_action( "cmb2_save_{$object_type}_fields", $object_id, $this->cmb_id, $this->updated, $this );
881
-
882
- /**
883
- * Fires after all fields have been saved.
884
- *
885
- * The dynamic portion of the hook name, $this->cmb_id, is the meta_box id.
886
- *
887
- * The dynamic portion of the hook name, $object_type, refers to the metabox/form's object type
888
- * Usually `post` (this applies to all post-types).
889
- * Could also be `comment`, `user` or `options-page`.
890
- *
891
- * @param int $object_id The ID of the current object
892
- * @param string $updated Array of field ids that were updated.
893
- * Will only include field ids that had values change.
894
- * @param array $cmb This CMB2 object
895
- */
896
- do_action( "cmb2_save_{$object_type}_fields_{$this->cmb_id}", $object_id, $this->updated, $this );
897
-
898
- return $this;
899
- }
900
-
901
- /**
902
- * Save a repeatable group
903
- *
904
- * @since 1.x.x
905
- * @param array $args Field arguments array.
906
- * @return mixed Return of CMB2_Field::update_data().
907
- */
908
- public function save_group( $args ) {
909
- if ( ! isset( $args['id'], $args['fields'] ) || ! is_array( $args['fields'] ) ) {
910
- return;
911
- }
912
-
913
- return $this->save_group_field( $this->get_new_field( $args ) );
914
- }
915
-
916
- /**
917
- * Save a repeatable group
918
- *
919
- * @since 1.x.x
920
- * @param CMB2_Field $field_group CMB2_Field group field object.
921
- * @return mixed Return of CMB2_Field::update_data().
922
- */
923
- public function save_group_field( $field_group ) {
924
- $base_id = $field_group->id();
925
-
926
- if ( ! isset( $this->data_to_save[ $base_id ] ) ) {
927
- return;
928
- }
929
-
930
- $old = $field_group->get_data();
931
- // Check if group field has sanitization_cb.
932
- $group_vals = $field_group->sanitization_cb( $this->data_to_save[ $base_id ] );
933
- $saved = array();
934
-
935
- $field_group->index = 0;
936
- $field_group->data_to_save = $this->data_to_save;
937
-
938
- foreach ( array_values( $field_group->fields() ) as $field_args ) {
939
- if ( 'title' === $field_args['type'] ) {
940
- // Don't process title fields.
941
- continue;
942
- }
943
-
944
- $field = $this->get_new_field( $field_args, $field_group );
945
- $sub_id = $field->id( true );
946
- if ( empty( $saved[ $field_group->index ] ) ) {
947
- $saved[ $field_group->index ] = array();
948
- }
949
-
950
- foreach ( (array) $group_vals as $field_group->index => $post_vals ) {
951
-
952
- // Get value.
953
- $new_val = isset( $group_vals[ $field_group->index ][ $sub_id ] )
954
- ? $group_vals[ $field_group->index ][ $sub_id ]
955
- : false;
956
-
957
- // Sanitize.
958
- $new_val = $field->sanitization_cb( $new_val );
959
-
960
- if ( is_array( $new_val ) && $field->args( 'has_supporting_data' ) ) {
961
- if ( $field->args( 'repeatable' ) ) {
962
- $_new_val = array();
963
- foreach ( $new_val as $group_index => $grouped_data ) {
964
- // Add the supporting data to the $saved array stack.
965
- $saved[ $field_group->index ][ $grouped_data['supporting_field_id'] ][] = $grouped_data['supporting_field_value'];
966
- // Reset var to the actual value.
967
- $_new_val[ $group_index ] = $grouped_data['value'];
968
- }
969
- $new_val = $_new_val;
970
- } else {
971
- // Add the supporting data to the $saved array stack.
972
- $saved[ $field_group->index ][ $new_val['supporting_field_id'] ] = $new_val['supporting_field_value'];
973
- // Reset var to the actual value.
974
- $new_val = $new_val['value'];
975
- }
976
- }
977
-
978
- // Get old value.
979
- $old_val = is_array( $old ) && isset( $old[ $field_group->index ][ $sub_id ] )
980
- ? $old[ $field_group->index ][ $sub_id ]
981
- : false;
982
-
983
- $is_updated = ( ! CMB2_Utils::isempty( $new_val ) && $new_val !== $old_val );
984
- $is_removed = ( CMB2_Utils::isempty( $new_val ) && ! CMB2_Utils::isempty( $old_val ) );
985
-
986
- // Compare values and add to `$updated` array.
987
- if ( $is_updated || $is_removed ) {
988
- $this->updated[] = $base_id . '::' . $field_group->index . '::' . $sub_id;
989
- }
990
-
991
- // Add to `$saved` array.
992
- $saved[ $field_group->index ][ $sub_id ] = $new_val;
993
-
994
- }// End foreach.
995
-
996
- $saved[ $field_group->index ] = CMB2_Utils::filter_empty( $saved[ $field_group->index ] );
997
- }// End foreach.
998
-
999
- $saved = CMB2_Utils::filter_empty( $saved );
1000
-
1001
- return $field_group->update_data( $saved, true );
1002
- }
1003
-
1004
- /**
1005
- * Get object id from global space if no id is provided
1006
- *
1007
- * @since 1.0.0
1008
- * @param integer|string $object_id Object ID.
1009
- * @return integer|string $object_id Object ID.
1010
- */
1011
- public function object_id( $object_id = 0 ) {
1012
- global $pagenow;
1013
-
1014
- if ( $object_id ) {
1015
- $this->object_id = $object_id;
1016
- return $this->object_id;
1017
- }
1018
-
1019
- if ( $this->object_id ) {
1020
- return $this->object_id;
1021
- }
1022
-
1023
- // Try to get our object ID from the global space.
1024
- switch ( $this->object_type() ) {
1025
- case 'user':
1026
- $object_id = isset( $_REQUEST['user_id'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['user_id'] ) ) : $object_id;
1027
- $object_id = ! $object_id && 'user-new.php' !== $pagenow && isset( $GLOBALS['user_ID'] ) ? $GLOBALS['user_ID'] : $object_id;
1028
- break;
1029
-
1030
- case 'comment':
1031
- $object_id = isset( $_REQUEST['c'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['c'] ) ) : $object_id;
1032
- $object_id = ! $object_id && isset( $GLOBALS['comments']->comment_ID ) ? $GLOBALS['comments']->comment_ID : $object_id;
1033
- break;
1034
-
1035
- case 'term':
1036
- $object_id = isset( $_REQUEST['tag_ID'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['tag_ID'] ) ) : $object_id;
1037
- break;
1038
-
1039
- case 'options-page':
1040
- $key = $this->doing_options_page();
1041
- if ( ! empty( $key ) ) {
1042
- $object_id = $key;
1043
- }
1044
- break;
1045
-
1046
- default:
1047
- $object_id = isset( $GLOBALS['post']->ID ) ? $GLOBALS['post']->ID : $object_id;
1048
- $object_id = isset( $_REQUEST['post'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['post'] ) ) : $object_id;
1049
- break;
1050
- }
1051
-
1052
- // reset to id or 0.
1053
- $this->object_id = $object_id ? $object_id : 0;
1054
-
1055
- return $this->object_id;
1056
- }
1057
-
1058
- /**
1059
- * Sets the $object_type based on metabox settings
1060
- *
1061
- * @since 1.0.0
1062
- * @return string Object type.
1063
- */
1064
- public function mb_object_type() {
1065
- if ( null !== $this->mb_object_type ) {
1066
- return $this->mb_object_type;
1067
- }
1068
-
1069
- if ( $this->is_options_page_mb() ) {
1070
- $this->mb_object_type = 'options-page';
1071
- return $this->mb_object_type;
1072
- }
1073
-
1074
- $registered_types = $this->box_types();
1075
-
1076
- $type = '';
1077
-
1078
- // if it's an array of one, extract it.
1079
- if ( 1 === count( $registered_types ) ) {
1080
- $last = end( $registered_types );
1081
- if ( is_string( $last ) ) {
1082
- $type = $last;
1083
- }
1084
- } elseif ( ( $curr_type = $this->current_object_type() ) && in_array( $curr_type, $registered_types, true ) ) {
1085
- $type = $curr_type;
1086
- }
1087
-
1088
- // Get our object type.
1089
- switch ( $type ) {
1090
-
1091
- case 'user':
1092
- case 'comment':
1093
- case 'term':
1094
- $this->mb_object_type = $type;
1095
- break;
1096
-
1097
- default:
1098
- $this->mb_object_type = 'post';
1099
- break;
1100
- }
1101
-
1102
- return $this->mb_object_type;
1103
- }
1104
-
1105
- /**
1106
- * Gets the box 'object_types' array based on box settings.
1107
- *
1108
- * @since 2.2.3
1109
- * @param array $fallback Fallback value.
1110
- *
1111
- * @return array Object types.
1112
- */
1113
- public function box_types( $fallback = array() ) {
1114
- return CMB2_Utils::ensure_array( $this->prop( 'object_types' ), $fallback );
1115
- }
1116
-
1117
- /**
1118
- * Check if given object_type(s) matches any of the registered object types or
1119
- * taxonomies for this box.
1120
- *
1121
- * @since 2.7.0
1122
- * @param string|array $object_types The object type(s) to check.
1123
- * @param array $fallback Fallback object_types value.
1124
- *
1125
- * @return bool Whether given object type(s) are registered to this box.
1126
- */
1127
- public function is_box_type( $object_types = array(), $fallback = array() ) {
1128
- $object_types = (array) $object_types;
1129
- $box_types = $this->box_types( $fallback );
1130
-
1131
- if ( in_array( 'term', $box_types, true ) ) {
1132
- $taxonomies = CMB2_Utils::ensure_array( $this->prop( 'taxonomies' ) );
1133
- $box_types = array_merge( $box_types, $taxonomies );
1134
- }
1135
-
1136
- $found = array_intersect( $object_types, $box_types );
1137
-
1138
- return ! empty( $found );
1139
- }
1140
-
1141
- /**
1142
- * Initates the object types and option key for an options page metabox.
1143
- *
1144
- * @since 2.2.5
1145
- *
1146
- * @return void
1147
- */
1148
- public function init_options_mb() {
1149
- $keys = $this->options_page_keys();
1150
- $types = $this->box_types();
1151
-
1152
- if ( empty( $keys ) ) {
1153
- $keys = '';
1154
- $types = $this->deinit_options_mb( $types );
1155
- } else {
1156
-
1157
- // Make sure 'options-page' is one of the object types.
1158
- $types[] = 'options-page';
1159
- }
1160
-
1161
- // Set/Reset the option_key property.
1162
- $this->set_prop( 'option_key', $keys );
1163
-
1164
- // Reset the object types.
1165
- $this->set_prop( 'object_types', array_unique( $types ) );
1166
- }
1167
-
1168
- /**
1169
- * If object-page initiation failed, remove traces options page setup.
1170
- *
1171
- * @since 2.2.5
1172
- *
1173
- * @param array $types Array of types.
1174
- * @return array
1175
- */
1176
- protected function deinit_options_mb( $types ) {
1177
- if ( isset( $this->meta_box['show_on']['key'] ) && 'options-page' === $this->meta_box['show_on']['key'] ) {
1178
- unset( $this->meta_box['show_on']['key'] );
1179
- }
1180
-
1181
- if ( array_key_exists( 'options-page', $this->meta_box['show_on'] ) ) {
1182
- unset( $this->meta_box['show_on']['options-page'] );
1183
- }
1184
-
1185
- $index = array_search( 'options-page', $types );
1186
-
1187
- if ( false !== $index ) {
1188
- unset( $types[ $index ] );
1189
- }
1190
-
1191
- return $types;
1192
- }
1193
-
1194
- /**
1195
- * Determines if metabox is for an options page
1196
- *
1197
- * @since 1.0.1
1198
- * @return boolean True/False.
1199
- */
1200
- public function is_options_page_mb() {
1201
- return (
1202
- // 'show_on' values checked for back-compatibility.
1203
- $this->is_old_school_options_page_mb()
1204
- || in_array( 'options-page', $this->box_types() )
1205
- );
1206
- }
1207
-
1208
- /**
1209
- * Determines if metabox uses old-schoold options page config.
1210
- *
1211
- * @since 2.2.5
1212
- * @return boolean True/False.
1213
- */
1214
- public function is_old_school_options_page_mb() {
1215
- return (
1216
- // 'show_on' values checked for back-compatibility.
1217
- isset( $this->meta_box['show_on']['key'] ) && 'options-page' === $this->meta_box['show_on']['key']
1218
- || array_key_exists( 'options-page', $this->meta_box['show_on'] )
1219
- );
1220
- }
1221
-
1222
- /**
1223
- * Determine if we are on an options page (or saving the options page).
1224
- *
1225
- * @since 2.2.5
1226
- *
1227
- * @return bool
1228
- */
1229
- public function doing_options_page() {
1230
- $found_key = false;
1231
- $keys = $this->options_page_keys();
1232
-
1233
- if ( empty( $keys ) ) {
1234
- return $found_key;
1235
- }
1236
-
1237
- if ( ! empty( $_GET['page'] ) && in_array( $_GET['page'], $keys ) ) {
1238
- $found_key = sanitize_text_field( $_GET['page'] );
1239
- }
1240
-
1241
- if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $keys ) ) {
1242
- $found_key = sanitize_text_field( $_POST['action'] );
1243
- }
1244
-
1245
- return $found_key ? $found_key : false;
1246
- }
1247
-
1248
- /**
1249
- * Get the options page key.
1250
- *
1251
- * @since 2.2.5
1252
- * @return string|array
1253
- */
1254
- public function options_page_keys() {
1255
- $key = '';
1256
- if ( ! $this->is_options_page_mb() ) {
1257
- return $key;
1258
- }
1259
-
1260
- $values = null;
1261
- if ( ! empty( $this->meta_box['show_on']['value'] ) ) {
1262
- $values = $this->meta_box['show_on']['value'];
1263
- } elseif ( ! empty( $this->meta_box['show_on']['options-page'] ) ) {
1264
- $values = $this->meta_box['show_on']['options-page'];
1265
- } elseif ( $this->prop( 'option_key' ) ) {
1266
- $values = $this->prop( 'option_key' );
1267
- }
1268
-
1269
- if ( $values ) {
1270
- $key = $values;
1271
- }
1272
-
1273
- if ( ! is_array( $key ) ) {
1274
- $key = array( $key );
1275
- }
1276
-
1277
- return $key;
1278
- }
1279
-
1280
- /**
1281
- * Returns the object type
1282
- *
1283
- * @since 1.0.0
1284
- * @param string $object_type Type of object being saved. (e.g., post, user, or comment). Optional.
1285
- * @return string Object type.
1286
- */
1287
- public function object_type( $object_type = '' ) {
1288
- if ( $object_type ) {
1289
- $this->object_type = $object_type;
1290
- return $this->object_type;
1291
- }
1292
-
1293
- if ( $this->object_type ) {
1294
- return $this->object_type;
1295
- }
1296
-
1297
- $this->object_type = $this->current_object_type();
1298
-
1299
- return $this->object_type;
1300
- }
1301
-
1302
- /**
1303
- * Get the object type for the current page, based on the $pagenow global.
1304
- *
1305
- * @since 2.2.2
1306
- * @return string Page object type name.
1307
- */
1308
- public function current_object_type() {
1309
- global $pagenow;
1310
- $type = 'post';
1311
-
1312
- if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) {
1313
- $type = 'user';
1314
- }
1315
-
1316
- if ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) {
1317
- $type = 'comment';
1318
- }
1319
-
1320
- if ( in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) ) {
1321
- $type = 'term';
1322
- }
1323
-
1324
- if ( defined( 'DOING_AJAX' ) && isset( $_POST['action'] ) && 'add-tag' === $_POST['action'] ) {
1325
- $type = 'term';
1326
- }
1327
-
1328
- if (
1329
- in_array( $pagenow, array( 'admin.php', 'admin-post.php' ), true )
1330
- && $this->doing_options_page()
1331
- ) {
1332
- $type = 'options-page';
1333
- }
1334
-
1335
- return $type;
1336
- }
1337
-
1338
- /**
1339
- * Set metabox property.
1340
- *
1341
- * @since 2.2.2
1342
- * @param string $property Metabox config property to retrieve.
1343
- * @param mixed $value Value to set if no value found.
1344
- * @return mixed Metabox config property value or false.
1345
- */
1346
- public function set_prop( $property, $value ) {
1347
- $this->meta_box[ $property ] = $value;
1348
-
1349
- return $this->prop( $property );
1350
- }
1351
-
1352
- /**
1353
- * Get metabox property and optionally set a fallback
1354
- *
1355
- * @since 2.0.0
1356
- * @param string $property Metabox config property to retrieve.
1357
- * @param mixed $fallback Fallback value to set if no value found.
1358
- * @return mixed Metabox config property value or false.
1359
- */
1360
- public function prop( $property, $fallback = null ) {
1361
- if ( array_key_exists( $property, $this->meta_box ) ) {
1362
- return $this->meta_box[ $property ];
1363
- } elseif ( $fallback ) {
1364
- return $this->meta_box[ $property ] = $fallback;
1365
- }
1366
- }
1367
-
1368
- /**
1369
- * Get a field object
1370
- *
1371
- * @since 2.0.3
1372
- * @param string|array|CMB2_Field $field Metabox field id or field config array or CMB2_Field object.
1373
- * @param CMB2_Field|null $field_group (optional) CMB2_Field object (group parent).
1374
- * @param bool $reset_cached (optional) Reset the internal cache for this field object.
1375
- * Use sparingly.
1376
- *
1377
- * @return CMB2_Field|false CMB2_Field object (or false).
1378
- */
1379
- public function get_field( $field, $field_group = null, $reset_cached = false ) {
1380
- if ( $field instanceof CMB2_Field ) {
1381
- return $field;
1382
- }
1383
-
1384
- $field_id = is_string( $field ) ? $field : $field['id'];
1385
-
1386
- $parent_field_id = ! empty( $field_group ) ? $field_group->id() : '';
1387
- $ids = $this->get_field_ids( $field_id, $parent_field_id );
1388
-
1389
- if ( ! $ids ) {
1390
- return false;
1391
- }
1392
-
1393
- list( $field_id, $sub_field_id ) = $ids;
1394
-
1395
- $index = $field_id . ( $sub_field_id ? '|' . $sub_field_id : '' ) . ( $field_group ? '|' . $field_group->index : '' );
1396
-
1397
- if ( array_key_exists( $index, $this->fields ) && ! $reset_cached ) {
1398
- return $this->fields[ $index ];
1399
- }
1400
-
1401
- $this->fields[ $index ] = new CMB2_Field( $this->get_field_args( $field_id, $field, $sub_field_id, $field_group ) );
1402
-
1403
- return $this->fields[ $index ];
1404
- }
1405
-
1406
- /**
1407
- * Handles determining which type of arguments to pass to CMB2_Field
1408
- *
1409
- * @since 2.0.7
1410
- * @param mixed $field_id Field (or group field) ID.
1411
- * @param mixed $field_args Array of field arguments.
1412
- * @param mixed $sub_field_id Sub field ID (if field_group exists).
1413
- * @param CMB2_Field|null $field_group If a sub-field, will be the parent group CMB2_Field object.
1414
- * @return array Array of CMB2_Field arguments.
1415
- */
1416
- public function get_field_args( $field_id, $field_args, $sub_field_id, $field_group ) {
1417
-
1418
- // Check if group is passed and if fields were added in the old-school fields array.
1419
- if ( $field_group && ( $sub_field_id || 0 === $sub_field_id ) ) {
1420
-
1421
- // Update the fields array w/ any modified properties inherited from the group field.
1422
- $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] = $field_args;
1423
-
1424
- return $this->get_default_args( $field_args, $field_group );
1425
- }
1426
-
1427
- if ( is_array( $field_args ) ) {
1428
- $this->meta_box['fields'][ $field_id ] = array_merge( $field_args, $this->meta_box['fields'][ $field_id ] );
1429
- }
1430
-
1431
- return $this->get_default_args( $this->meta_box['fields'][ $field_id ] );
1432
- }
1433
-
1434
- /**
1435
- * Get default field arguments specific to this CMB2 object.
1436
- *
1437
- * @since 2.2.0
1438
- * @param array $field_args Metabox field config array.
1439
- * @param CMB2_Field $field_group (optional) CMB2_Field object (group parent).
1440
- * @return array Array of field arguments.
1441
- */
1442
- protected function get_default_args( $field_args, $field_group = null ) {
1443
- if ( $field_group ) {
1444
- $args = array(
1445
- 'field_args' => $field_args,
1446
- 'group_field' => $field_group,
1447
- );
1448
- } else {
1449
- $args = array(
1450
- 'field_args' => $field_args,
1451
- 'object_type' => $this->object_type(),
1452
- 'object_id' => $this->object_id(),
1453
- 'cmb_id' => $this->cmb_id,
1454
- );
1455
- }
1456
-
1457
- return $args;
1458
- }
1459
-
1460
- /**
1461
- * When fields are added in the old-school way, intitate them as they should be
1462
- *
1463
- * @since 2.1.0
1464
- * @param array $fields Array of fields to add.
1465
- * @param mixed $parent_field_id Parent field id or null.
1466
- *
1467
- * @return CMB2
1468
- */
1469
- protected function add_fields( $fields, $parent_field_id = null ) {
1470
- foreach ( $fields as $field ) {
1471
-
1472
- $sub_fields = false;
1473
- if ( array_key_exists( 'fields', $field ) ) {
1474
- $sub_fields = $field['fields'];
1475
- unset( $field['fields'] );
1476
- }
1477
-
1478
- $field_id = $parent_field_id
1479
- ? $this->add_group_field( $parent_field_id, $field )
1480
- : $this->add_field( $field );
1481
-
1482
- if ( $sub_fields ) {
1483
- $this->add_fields( $sub_fields, $field_id );
1484
- }
1485
- }
1486
-
1487
- return $this;
1488
- }
1489
-
1490
- /**
1491
- * Add a field to the metabox
1492
- *
1493
- * @since 2.0.0
1494
- * @param array $field Metabox field config array.
1495
- * @param int $position (optional) Position of metabox. 1 for first, etc.
1496
- * @return string|false Field id or false.
1497
- */
1498
- public function add_field( array $field, $position = 0 ) {
1499
- if ( ! array_key_exists( 'id', $field ) ) {
1500
- return false;
1501
- }
1502
-
1503
- $this->_add_field_to_array(
1504
- $field,
1505
- $this->meta_box['fields'],
1506
- $position
1507
- );
1508
-
1509
- return $field['id'];
1510
- }
1511
-
1512
- /**
1513
- * Add a field to a group
1514
- *
1515
- * @since 2.0.0
1516
- * @param string $parent_field_id The field id of the group field to add the field.
1517
- * @param array $field Metabox field config array.
1518
- * @param int $position (optional) Position of metabox. 1 for first, etc.
1519
- * @return mixed Array of parent/field ids or false.
1520
- */
1521
- public function add_group_field( $parent_field_id, array $field, $position = 0 ) {
1522
- if ( ! array_key_exists( $parent_field_id, $this->meta_box['fields'] ) ) {
1523
- return false;
1524
- }
1525
-
1526
- $parent_field = $this->meta_box['fields'][ $parent_field_id ];
1527
-
1528
- if ( 'group' !== $parent_field['type'] ) {
1529
- return false;
1530
- }
1531
-
1532
- if ( ! isset( $parent_field['fields'] ) ) {
1533
- $this->meta_box['fields'][ $parent_field_id ]['fields'] = array();
1534
- }
1535
-
1536
- $this->_add_field_to_array(
1537
- $field,
1538
- $this->meta_box['fields'][ $parent_field_id ]['fields'],
1539
- $position
1540
- );
1541
-
1542
- return array( $parent_field_id, $field['id'] );
1543
- }
1544
-
1545
- /**
1546
- * Perform some field-type-specific initiation actions.
1547
- *
1548
- * @since 2.7.0
1549
- * @param array $field Metabox field config array.
1550
- * @return void
1551
- */
1552
- protected function field_actions( $field ) {
1553
- switch ( $field['type'] ) {
1554
- case 'file':
1555
- case 'file_list':
1556
-
1557
- // Initiate attachment JS hooks.
1558
- add_filter( 'wp_prepare_attachment_for_js', array( 'CMB2_Type_File_Base', 'prepare_image_sizes_for_js' ), 10, 3 );
1559
- break;
1560
-
1561
- case 'oembed':
1562
- // Initiate oembed Ajax hooks.
1563
- cmb2_ajax();
1564
- break;
1565
-
1566
- case 'group':
1567
- if ( empty( $field['render_row_cb'] ) ) {
1568
- $field['render_row_cb'] = array( $this, 'render_group_callback' );
1569
- }
1570
- break;
1571
- case 'colorpicker':
1572
-
1573
- // https://github.com/JayWood/CMB2_RGBa_Picker
1574
- // Dequeue the rgba_colorpicker custom field script if it is used,
1575
- // since we now enqueue our own more current version.
1576
- add_action( 'admin_enqueue_scripts', array( 'CMB2_Type_Colorpicker', 'dequeue_rgba_colorpicker_script' ), 99 );
1577
- break;
1578
- }
1579
-
1580
- if ( isset( $field['column'] ) && false !== $field['column'] ) {
1581
- $field = $this->define_field_column( $field );
1582
- }
1583
-
1584
- if ( isset( $field['taxonomy'] ) && ! empty( $field['remove_default'] ) ) {
1585
- $this->tax_metaboxes_to_remove[ $field['taxonomy'] ] = $field['taxonomy'];
1586
- }
1587
-
1588
- return $field;
1589
- }
1590
-
1591
- /**
1592
- * Defines a field's column if requesting to be show in admin columns.
1593
- *
1594
- * @since 2.2.3
1595
- * @param array $field Metabox field config array.
1596
- * @return array Modified metabox field config array.
1597
- */
1598
- protected function define_field_column( array $field ) {
1599
- $this->has_columns = true;
1600
-
1601
- $column = is_array( $field['column'] ) ? $field['column'] : array();
1602
-
1603
- $field['column'] = wp_parse_args( $column, array(
1604
- 'name' => isset( $field['name'] ) ? $field['name'] : '',
1605
- 'position' => false,
1606
- ) );
1607
-
1608
- return $field;
1609
- }
1610
-
1611
- /**
1612
- * Add a field array to a fields array in desired position
1613
- *
1614
- * @since 2.0.2
1615
- * @param array $field Metabox field config array.
1616
- * @param array $fields Array (passed by reference) to append the field (array) to.
1617
- * @param integer $position Optionally specify a position in the array to be inserted.
1618
- */
1619
- protected function _add_field_to_array( $field, &$fields, $position = 0 ) {
1620
- $field = $this->field_actions( $field );
1621
-
1622
- if ( $position ) {
1623
- CMB2_Utils::array_insert( $fields, array( $field['id'] => $field ), $position );
1624
- } else {
1625
- $fields[ $field['id'] ] = $field;
1626
- }
1627
- }
1628
-
1629
- /**
1630
- * Remove a field from the metabox
1631
- *
1632
- * @since 2.0.0
1633
- * @param string $field_id The field id of the field to remove.
1634
- * @param string $parent_field_id (optional) The field id of the group field to remove field from.
1635
- * @return bool True if field was removed.
1636
- */
1637
- public function remove_field( $field_id, $parent_field_id = '' ) {
1638
- $ids = $this->get_field_ids( $field_id, $parent_field_id );
1639
-
1640
- if ( ! $ids ) {
1641
- return false;
1642
- }
1643
-
1644
- list( $field_id, $sub_field_id ) = $ids;
1645
-
1646
- unset( $this->fields[ implode( '', $ids ) ] );
1647
-
1648
- if ( ! $sub_field_id ) {
1649
- unset( $this->meta_box['fields'][ $field_id ] );
1650
- return true;
1651
- }
1652
-
1653
- if ( isset( $this->fields[ $field_id ]->args['fields'][ $sub_field_id ] ) ) {
1654
- unset( $this->fields[ $field_id ]->args['fields'][ $sub_field_id ] );
1655
- }
1656
- if ( isset( $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] ) ) {
1657
- unset( $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] );
1658
- }
1659
-
1660
- return true;
1661
- }
1662
-
1663
- /**
1664
- * Update or add a property to a field
1665
- *
1666
- * @since 2.0.0
1667
- * @param string $field_id Field id.
1668
- * @param string $property Field property to set/update.
1669
- * @param mixed $value Value to set the field property.
1670
- * @param string $parent_field_id (optional) The field id of the group field to remove field from.
1671
- * @return mixed Field id. Strict compare to false, as success can return a falsey value (like 0).
1672
- */
1673
- public function update_field_property( $field_id, $property, $value, $parent_field_id = '' ) {
1674
- $ids = $this->get_field_ids( $field_id, $parent_field_id );
1675
-
1676
- if ( ! $ids ) {
1677
- return false;
1678
- }
1679
-
1680
- list( $field_id, $sub_field_id ) = $ids;
1681
-
1682
- if ( ! $sub_field_id ) {
1683
- $this->meta_box['fields'][ $field_id ][ $property ] = $value;
1684
- return $field_id;
1685
- }
1686
-
1687
- $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ][ $property ] = $value;
1688
- return $field_id;
1689
- }
1690
-
1691
- /**
1692
- * Check if field ids match a field and return the index/field id
1693
- *
1694
- * @since 2.0.2
1695
- * @param string $field_id Field id.
1696
- * @param string $parent_field_id (optional) Parent field id.
1697
- * @return mixed Array of field/parent ids, or false.
1698
- */
1699
- public function get_field_ids( $field_id, $parent_field_id = '' ) {
1700
- $sub_field_id = $parent_field_id ? $field_id : '';
1701
- $field_id = $parent_field_id ? $parent_field_id : $field_id;
1702
- $fields =& $this->meta_box['fields'];
1703
-
1704
- if ( ! array_key_exists( $field_id, $fields ) ) {
1705
- $field_id = $this->search_old_school_array( $field_id, $fields );
1706
- }
1707
-
1708
- if ( false === $field_id ) {
1709
- return false;
1710
- }
1711
-
1712
- if ( ! $sub_field_id ) {
1713
- return array( $field_id, $sub_field_id );
1714
- }
1715
-
1716
- if ( 'group' !== $fields[ $field_id ]['type'] ) {
1717
- return false;
1718
- }
1719
-
1720
- if ( ! array_key_exists( $sub_field_id, $fields[ $field_id ]['fields'] ) ) {
1721
- $sub_field_id = $this->search_old_school_array( $sub_field_id, $fields[ $field_id ]['fields'] );
1722
- }
1723
-
1724
- return false === $sub_field_id ? false : array( $field_id, $sub_field_id );
1725
- }
1726
-
1727
- /**
1728
- * When using the old array filter, it is unlikely field array indexes will be the field id.
1729
- *
1730
- * @since 2.0.2
1731
- * @param string $field_id The field id.
1732
- * @param array $fields Array of fields to search.
1733
- * @return mixed Field index or false.
1734
- */
1735
- public function search_old_school_array( $field_id, $fields ) {
1736
- $ids = wp_list_pluck( $fields, 'id' );
1737
- $index = array_search( $field_id, $ids );
1738
- return false !== $index ? $index : false;
1739
- }
1740
-
1741
- /**
1742
- * Handles metabox property callbacks, and passes this $cmb object as property.
1743
- *
1744
- * @since 2.2.3
1745
- * @param callable $cb The callback method/function/closure.
1746
- * @param mixed $additional_params Any additoinal parameters which should be passed to the callback.
1747
- * @return mixed Return of the callback function.
1748
- */
1749
- public function do_callback( $cb, $additional_params = null ) {
1750
- return call_user_func( $cb, $this, $additional_params );
1751
- }
1752
-
1753
- /**
1754
- * Generate a unique nonce field for each registered meta_box
1755
- *
1756
- * @since 2.0.0
1757
- * @return void
1758
- */
1759
- public function nonce_field() {
1760
- wp_nonce_field( $this->nonce(), $this->nonce(), false, true );
1761
- }
1762
-
1763
- /**
1764
- * Generate a unique nonce for each registered meta_box
1765
- *
1766
- * @since 2.0.0
1767
- * @return string unique nonce string.
1768
- */
1769
- public function nonce() {
1770
- if ( ! $this->generated_nonce ) {
1771
- $this->generated_nonce = sanitize_html_class( 'nonce_' . basename( __FILE__ ) . $this->cmb_id );
1772
- }
1773
-
1774
- return $this->generated_nonce;
1775
- }
1776
-
1777
- /**
1778
- * Checks if field-saving updated any fields.
1779
- *
1780
- * @since 2.2.5
1781
- *
1782
- * @return bool
1783
- */
1784
- public function was_updated() {
1785
- return ! empty( $this->updated );
1786
- }
1787
-
1788
- /**
1789
- * Whether this box is an "alternate context" box. This means the box has a 'context' property defined as:
1790
- * 'form_top', 'before_permalink', 'after_title', or 'after_editor'.
1791
- *
1792
- * @since 2.2.4
1793
- * @return bool
1794
- */
1795
- public function is_alternate_context_box() {
1796
- return $this->prop( 'context' ) && in_array( $this->prop( 'context' ), array( 'form_top', 'before_permalink', 'after_title', 'after_editor' ), true );
1797
- }
1798
-
1799
- /**
1800
- * Magic getter for our object.
1801
- *
1802
- * @param string $property Object property.
1803
- * @throws Exception Throws an exception if the field is invalid.
1804
- * @return mixed
1805
- */
1806
- public function __get( $property ) {
1807
- switch ( $property ) {
1808
- case 'updated':
1809
- case 'has_columns':
1810
- case 'tax_metaboxes_to_remove':
1811
- return $this->{$property};
1812
- default:
1813
- return parent::__get( $property );
1814
- }
1815
- }
1816
-
1817
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/CMB2_Ajax.php DELETED
@@ -1,323 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * CMB2 ajax methods
5
- * (i.e. a lot of work to get oEmbeds to work with non-post objects)
6
- *
7
- * @since 0.9.5
8
- *
9
- * @category WordPress_Plugin
10
- * @package CMB2
11
- * @author CMB2 team
12
- * @license GPL-2.0+
13
- */
14
- class CMB2_Ajax {
15
-
16
- // Whether to hijack the oembed cache system.
17
- protected $hijack = false;
18
- protected $object_id = 0;
19
- protected $embed_args = array();
20
- protected $object_type = 'post';
21
- protected $ajax_update = false;
22
-
23
- /**
24
- * Instance of this class.
25
- *
26
- * @since 2.2.2
27
- * @var object
28
- */
29
- protected static $instance;
30
-
31
- /**
32
- * Get the singleton instance of this class.
33
- *
34
- * @since 2.2.2
35
- * @return CMB2_Ajax
36
- */
37
- public static function get_instance() {
38
- if ( ! ( self::$instance instanceof self ) ) {
39
- self::$instance = new self();
40
- }
41
-
42
- return self::$instance;
43
- }
44
-
45
- /**
46
- * Constructor
47
- *
48
- * @since 2.2.0
49
- */
50
- protected function __construct() {
51
- add_action( 'wp_ajax_cmb2_oembed_handler', array( $this, 'oembed_handler' ) );
52
- add_action( 'wp_ajax_nopriv_cmb2_oembed_handler', array( $this, 'oembed_handler' ) );
53
- // Need to occasionally clean stale oembed cache data from the option value.
54
- add_action( 'cmb2_save_options-page_fields', array( __CLASS__, 'clean_stale_options_page_oembeds' ) );
55
- }
56
-
57
- /**
58
- * Handles our oEmbed ajax request
59
- *
60
- * @since 0.9.5
61
- * @return mixed oEmbed embed code | fallback | error message
62
- */
63
- public function oembed_handler() {
64
-
65
- // Verify our nonce.
66
- if ( ! ( isset( $_REQUEST['cmb2_ajax_nonce'], $_REQUEST['oembed_url'] ) && wp_verify_nonce( $_REQUEST['cmb2_ajax_nonce'], 'ajax_nonce' ) ) ) {
67
- die();
68
- }
69
-
70
- // Sanitize our search string.
71
- $oembed_string = sanitize_text_field( $_REQUEST['oembed_url'] );
72
-
73
- // Send back error if empty.
74
- if ( empty( $oembed_string ) ) {
75
- wp_send_json_error( '<p class="ui-state-error-text">' . esc_html__( 'Please Try Again', 'cmb2' ) . '</p>' );
76
- }
77
-
78
- // Set width of embed.
79
- $embed_width = isset( $_REQUEST['oembed_width'] ) && intval( $_REQUEST['oembed_width'] ) < 640 ? intval( $_REQUEST['oembed_width'] ) : '640';
80
-
81
- // Set url.
82
- $oembed_url = esc_url( $oembed_string );
83
-
84
- // Set args.
85
- $embed_args = array(
86
- 'width' => $embed_width,
87
- );
88
-
89
- $this->ajax_update = true;
90
-
91
- // Get embed code (or fallback link).
92
- $html = $this->get_oembed( array(
93
- 'url' => $oembed_url,
94
- 'object_id' => $_REQUEST['object_id'],
95
- 'object_type' => isset( $_REQUEST['object_type'] ) ? $_REQUEST['object_type'] : 'post',
96
- 'oembed_args' => $embed_args,
97
- 'field_id' => $_REQUEST['field_id'],
98
- ) );
99
-
100
- wp_send_json_success( $html );
101
- }
102
-
103
- /**
104
- * Retrieves oEmbed from url/object ID
105
- *
106
- * @since 0.9.5
107
- * @param array $args Arguments for method.
108
- * @return mixed HTML markup with embed or fallback.
109
- */
110
- public function get_oembed_no_edit( $args ) {
111
- global $wp_embed;
112
-
113
- $oembed_url = esc_url( $args['url'] );
114
-
115
- // Sanitize object_id.
116
- $this->object_id = is_numeric( $args['object_id'] ) ? absint( $args['object_id'] ) : sanitize_text_field( $args['object_id'] );
117
-
118
- $args = wp_parse_args( $args, array(
119
- 'object_type' => 'post',
120
- 'oembed_args' => array(),
121
- 'field_id' => false,
122
- 'wp_error' => false,
123
- ) );
124
-
125
- $this->embed_args =& $args;
126
-
127
- /*
128
- * Set the post_ID so oEmbed won't fail
129
- * wp-includes/class-wp-embed.php, WP_Embed::shortcode()
130
- */
131
- $wp_embed->post_ID = $this->object_id;
132
-
133
- // Special scenario if NOT a post object.
134
- if ( isset( $args['object_type'] ) && 'post' != $args['object_type'] ) {
135
-
136
- if ( 'options-page' == $args['object_type'] ) {
137
-
138
- // Bogus id to pass some numeric checks. Issue with a VERY large WP install?
139
- $wp_embed->post_ID = 1987645321;
140
- }
141
-
142
- // Ok, we need to hijack the oembed cache system.
143
- $this->hijack = true;
144
- $this->object_type = $args['object_type'];
145
-
146
- // Gets ombed cache from our object's meta (vs postmeta).
147
- add_filter( 'get_post_metadata', array( $this, 'hijack_oembed_cache_get' ), 10, 3 );
148
-
149
- // Sets ombed cache in our object's meta (vs postmeta).
150
- add_filter( 'update_post_metadata', array( $this, 'hijack_oembed_cache_set' ), 10, 4 );
151
-
152
- }
153
-
154
- $embed_args = '';
155
-
156
- foreach ( $args['oembed_args'] as $key => $val ) {
157
- $embed_args .= " $key=\"$val\"";
158
- }
159
-
160
- // Ping WordPress for an embed.
161
- $embed = $wp_embed->run_shortcode( '[embed' . $embed_args . ']' . $oembed_url . '[/embed]' );
162
-
163
- // Fallback that WordPress creates when no oEmbed was found.
164
- $fallback = $wp_embed->maybe_make_link( $oembed_url );
165
-
166
- return compact( 'embed', 'fallback', 'args' );
167
- }
168
-
169
- /**
170
- * Retrieves oEmbed from url/object ID
171
- *
172
- * @since 0.9.5
173
- * @param array $args Arguments for method.
174
- * @return string HTML markup with embed or fallback.
175
- */
176
- public function get_oembed( $args ) {
177
- $oembed = $this->get_oembed_no_edit( $args );
178
-
179
- // Send back our embed.
180
- if ( $oembed['embed'] && $oembed['embed'] != $oembed['fallback'] ) {
181
- return '<div class="cmb2-oembed embed-status">' . $oembed['embed'] . '<p class="cmb2-remove-wrapper"><a href="#" class="cmb2-remove-file-button" rel="' . $oembed['args']['field_id'] . '">' . esc_html__( 'Remove Embed', 'cmb2' ) . '</a></p></div>';
182
- }
183
-
184
- // Otherwise, send back error info that no oEmbeds were found.
185
- return sprintf(
186
- '<p class="ui-state-error-text">%s</p>',
187
- sprintf(
188
- /* translators: 1: results for. 2: link to codex.wordpress.org/Embeds */
189
- esc_html__( 'No oEmbed Results Found for %1$s. View more info at %2$s.', 'cmb2' ),
190
- $oembed['fallback'],
191
- '<a href="https://wordpress.org/support/article/embeds/" target="_blank">codex.wordpress.org/Embeds</a>'
192
- )
193
- );
194
- }
195
-
196
- /**
197
- * Hijacks retrieving of cached oEmbed.
198
- * Returns cached data from relevant object metadata (vs postmeta)
199
- *
200
- * @since 0.9.5
201
- * @param boolean $check Whether to retrieve postmeta or override.
202
- * @param int $object_id Object ID.
203
- * @param string $meta_key Object metakey.
204
- * @return mixed Object's oEmbed cached data.
205
- */
206
- public function hijack_oembed_cache_get( $check, $object_id, $meta_key ) {
207
- if ( ! $this->hijack || ( $this->object_id != $object_id && 1987645321 !== $object_id ) ) {
208
- return $check;
209
- }
210
-
211
- if ( $this->ajax_update ) {
212
- return false;
213
- }
214
-
215
- return $this->cache_action( $meta_key );
216
- }
217
-
218
- /**
219
- * Hijacks saving of cached oEmbed.
220
- * Saves cached data to relevant object metadata (vs postmeta)
221
- *
222
- * @since 0.9.5
223
- * @param boolean $check Whether to continue setting postmeta.
224
- * @param int $object_id Object ID to get postmeta from.
225
- * @param string $meta_key Postmeta's key.
226
- * @param mixed $meta_value Value of the postmeta to be saved.
227
- * @return boolean Whether to continue setting.
228
- */
229
- public function hijack_oembed_cache_set( $check, $object_id, $meta_key, $meta_value ) {
230
-
231
- if (
232
- ! $this->hijack
233
- || ( $this->object_id != $object_id && 1987645321 !== $object_id )
234
- // Only want to hijack oembed meta values.
235
- || 0 !== strpos( $meta_key, '_oembed_' )
236
- ) {
237
- return $check;
238
- }
239
-
240
- $this->cache_action( $meta_key, $meta_value );
241
-
242
- // Anything other than `null` to cancel saving to postmeta.
243
- return true;
244
- }
245
-
246
- /**
247
- * Gets/updates the cached oEmbed value from/to relevant object metadata (vs postmeta).
248
- *
249
- * @since 1.3.0
250
- *
251
- * @param string $meta_key Postmeta's key.
252
- * @return mixed
253
- */
254
- protected function cache_action( $meta_key ) {
255
- $func_args = func_get_args();
256
- $action = isset( $func_args[1] ) ? 'update' : 'get';
257
-
258
- if ( 'options-page' === $this->object_type ) {
259
-
260
- $args = array( $meta_key );
261
-
262
- if ( 'update' === $action ) {
263
- $args[] = $func_args[1];
264
- $args[] = true;
265
- }
266
-
267
- // Cache the result to our options.
268
- $status = call_user_func_array( array( cmb2_options( $this->object_id ), $action ), $args );
269
- } else {
270
-
271
- $args = array( $this->object_type, $this->object_id, $meta_key );
272
- $args[] = 'update' === $action ? $func_args[1] : true;
273
-
274
- // Cache the result to our metadata.
275
- $status = call_user_func_array( $action . '_metadata', $args );
276
- }
277
-
278
- return $status;
279
- }
280
-
281
- /**
282
- * Hooks in when options-page data is saved to clean stale
283
- * oembed cache data from the option value.
284
- *
285
- * @since 2.2.0
286
- * @param string $option_key The options-page option key.
287
- * @return void
288
- */
289
- public static function clean_stale_options_page_oembeds( $option_key ) {
290
- $options = cmb2_options( $option_key )->get_options();
291
- $modified = false;
292
- if ( is_array( $options ) ) {
293
-
294
- $ttl = apply_filters( 'oembed_ttl', DAY_IN_SECONDS, '', array(), 0 );
295
- $now = time();
296
-
297
- foreach ( $options as $key => $value ) {
298
- // Check for cached oembed data.
299
- if ( 0 === strpos( $key, '_oembed_time_' ) ) {
300
- $cached_recently = ( $now - $value ) < $ttl;
301
-
302
- if ( ! $cached_recently ) {
303
- $modified = true;
304
- // Remove the the cached ttl expiration, and the cached oembed value.
305
- unset( $options[ $key ] );
306
- unset( $options[ str_replace( '_oembed_time_', '_oembed_', $key ) ] );
307
- }
308
- } // End if.
309
- // Remove the cached unknown values.
310
- elseif ( '{{unknown}}' === $value ) {
311
- $modified = true;
312
- unset( $options[ $key ] );
313
- }
314
- }
315
- }
316
-
317
- // Update the option and remove stale cache data.
318
- if ( $modified ) {
319
- $updated = cmb2_options( $option_key )->set( $options );
320
- }
321
- }
322
-
323
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/CMB2_Base.php DELETED
@@ -1,534 +0,0 @@
1
- <?php
2
- /**
3
- * CMB2 Base - Base object functionality.
4
- *
5
- * @category WordPress_Plugin
6
- * @package CMB2
7
- * @author CMB2 team
8
- * @license GPL-2.0+
9
- * @link https://cmb2.io
10
- *
11
- * @property-read $args The objects array of properties/arguments.
12
- * @property-read $meta_box The objects array of properties/arguments.
13
- * @property-read $properties The objects array of properties/arguments.
14
- * @property-read $cmb_id Current CMB2 instance ID
15
- * @property-read $object_id Object ID
16
- * @property-read $object_type Type of object being handled. (e.g., post, user, comment, or term)
17
- */
18
- abstract class CMB2_Base {
19
-
20
- /**
21
- * Current CMB2 instance ID
22
- *
23
- * @var string
24
- * @since 2.2.3
25
- */
26
- protected $cmb_id = '';
27
-
28
- /**
29
- * The object properties name.
30
- *
31
- * @var string
32
- * @since 2.2.3
33
- */
34
- protected $properties_name = 'meta_box';
35
-
36
- /**
37
- * Object ID
38
- *
39
- * @var mixed
40
- * @since 2.2.3
41
- */
42
- protected $object_id = 0;
43
-
44
- /**
45
- * Type of object being handled. (e.g., post, user, comment, or term)
46
- *
47
- * @var string
48
- * @since 2.2.3
49
- */
50
- protected $object_type = '';
51
-
52
- /**
53
- * Array of key => value data for saving. Likely $_POST data.
54
- *
55
- * @var array
56
- * @since 2.2.3
57
- */
58
- public $data_to_save = array();
59
-
60
- /**
61
- * Array of field param callback results
62
- *
63
- * @var array
64
- * @since 2.0.0
65
- */
66
- protected $callback_results = array();
67
-
68
- /**
69
- * The deprecated_param method deprecated param message signature.
70
- */
71
- const DEPRECATED_PARAM = 1;
72
-
73
- /**
74
- * The deprecated_param method deprecated callback param message signature.
75
- */
76
- const DEPRECATED_CB_PARAM = 2;
77
-
78
- /**
79
- * Get started
80
- *
81
- * @since 2.2.3
82
- * @param array $args Object properties array.
83
- */
84
- public function __construct( $args = array() ) {
85
- if ( ! empty( $args ) ) {
86
- foreach ( array(
87
- 'cmb_id',
88
- 'properties_name',
89
- 'object_id',
90
- 'object_type',
91
- 'data_to_save',
92
- ) as $object_prop ) {
93
- if ( isset( $args[ $object_prop ] ) ) {
94
- $this->{$object_prop} = $args[ $object_prop ];
95
- }
96
- }
97
- }
98
- }
99
-
100
- /**
101
- * Returns the object ID
102
- *
103
- * @since 2.2.3
104
- * @param integer $object_id Object ID.
105
- * @return integer Object ID
106
- */
107
- public function object_id( $object_id = 0 ) {
108
- if ( $object_id ) {
109
- $this->object_id = $object_id;
110
- }
111
-
112
- return $this->object_id;
113
- }
114
-
115
- /**
116
- * Returns the object type
117
- *
118
- * @since 2.2.3
119
- * @param string $object_type Object Type.
120
- * @return string Object type
121
- */
122
- public function object_type( $object_type = '' ) {
123
- if ( $object_type ) {
124
- $this->object_type = $object_type;
125
- }
126
-
127
- return $this->object_type;
128
- }
129
-
130
- /**
131
- * Get the object type for the current page, based on the $pagenow global.
132
- *
133
- * @since 2.2.2
134
- * @return string Page object type name.
135
- */
136
- public function current_object_type() {
137
- global $pagenow;
138
- $type = 'post';
139
-
140
- if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) {
141
- $type = 'user';
142
- }
143
-
144
- if ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) {
145
- $type = 'comment';
146
- }
147
-
148
- if ( in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) ) {
149
- $type = 'term';
150
- }
151
-
152
- return $type;
153
- }
154
-
155
- /**
156
- * Set object property.
157
- *
158
- * @since 2.2.2
159
- * @param string $property Metabox config property to retrieve.
160
- * @param mixed $value Value to set if no value found.
161
- * @return mixed Metabox config property value or false.
162
- */
163
- public function set_prop( $property, $value ) {
164
- $this->{$this->properties_name}[ $property ] = $value;
165
-
166
- return $this->prop( $property );
167
- }
168
-
169
- /**
170
- * Get object property and optionally set a fallback
171
- *
172
- * @since 2.0.0
173
- * @param string $property Metabox config property to retrieve.
174
- * @param mixed $fallback Fallback value to set if no value found.
175
- * @return mixed Metabox config property value or false
176
- */
177
- public function prop( $property, $fallback = null ) {
178
- if ( array_key_exists( $property, $this->{$this->properties_name} ) ) {
179
- return $this->{$this->properties_name}[ $property ];
180
- } elseif ( $fallback ) {
181
- return $this->{$this->properties_name}[ $property ] = $fallback;
182
- }
183
- }
184
-
185
- /**
186
- * Get default field arguments specific to this CMB2 object.
187
- *
188
- * @since 2.2.0
189
- * @param array $field_args Metabox field config array.
190
- * @param CMB2_Field $field_group (optional) CMB2_Field object (group parent).
191
- * @return array Array of field arguments.
192
- */
193
- protected function get_default_args( $field_args, $field_group = null ) {
194
- if ( $field_group ) {
195
- $args = array(
196
- 'field_args' => $field_args,
197
- 'group_field' => $field_group,
198
- );
199
- } else {
200
- $args = array(
201
- 'field_args' => $field_args,
202
- 'object_type' => $this->object_type(),
203
- 'object_id' => $this->object_id(),
204
- 'cmb_id' => $this->cmb_id,
205
- );
206
- }
207
-
208
- return $args;
209
- }
210
-
211
- /**
212
- * Get a new field object specific to this CMB2 object.
213
- *
214
- * @since 2.2.0
215
- * @param array $field_args Metabox field config array.
216
- * @param CMB2_Field $field_group (optional) CMB2_Field object (group parent).
217
- * @return CMB2_Field CMB2_Field object
218
- */
219
- protected function get_new_field( $field_args, $field_group = null ) {
220
- return new CMB2_Field( $this->get_default_args( $field_args, $field_group ) );
221
- }
222
-
223
- /**
224
- * Determine whether this cmb object should show, based on the 'show_on_cb' callback.
225
- *
226
- * @since 2.0.9
227
- *
228
- * @return bool Whether this cmb should be shown.
229
- */
230
- public function should_show() {
231
- // Default to showing this cmb
232
- $show = true;
233
-
234
- // Use the callback to determine showing the cmb, if it exists.
235
- if ( is_callable( $this->prop( 'show_on_cb' ) ) ) {
236
- $show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this );
237
- }
238
-
239
- return $show;
240
- }
241
-
242
- /**
243
- * Displays the results of the param callbacks.
244
- *
245
- * @since 2.0.0
246
- * @param string $param Field parameter.
247
- */
248
- public function peform_param_callback( $param ) {
249
- echo $this->get_param_callback_result( $param );
250
- }
251
-
252
- /**
253
- * Store results of the param callbacks for continual access
254
- *
255
- * @since 2.0.0
256
- * @param string $param Field parameter.
257
- * @return mixed Results of param/param callback
258
- */
259
- public function get_param_callback_result( $param ) {
260
-
261
- // If we've already retrieved this param's value.
262
- if ( array_key_exists( $param, $this->callback_results ) ) {
263
-
264
- // Send it back.
265
- return $this->callback_results[ $param ];
266
- }
267
-
268
- // Check if parameter has registered a callback.
269
- if ( $cb = $this->maybe_callback( $param ) ) {
270
-
271
- // Ok, callback is good, let's run it and store the result.
272
- ob_start();
273
- $returned = $this->do_callback( $cb );
274
-
275
- // Grab the result from the output buffer and store it.
276
- $echoed = ob_get_clean();
277
-
278
- // This checks if the user returned or echoed their callback.
279
- // Defaults to using the echoed value.
280
- $this->callback_results[ $param ] = $echoed ? $echoed : $returned;
281
-
282
- } else {
283
-
284
- // Otherwise just get whatever is there.
285
- $this->callback_results[ $param ] = isset( $this->{$this->properties_name}[ $param ] ) ? $this->{$this->properties_name}[ $param ] : false;
286
- }
287
-
288
- return $this->callback_results[ $param ];
289
- }
290
-
291
- /**
292
- * Unset the cached results of the param callback.
293
- *
294
- * @since 2.2.6
295
- * @param string $param Field parameter.
296
- * @return CMB2_Base
297
- */
298
- public function unset_param_callback_cache( $param ) {
299
- if ( isset( $this->callback_results[ $param ] ) ) {
300
- unset( $this->callback_results[ $param ] );
301
- }
302
-
303
- return $this;
304
- }
305
-
306
- /**
307
- * Handles the parameter callbacks, and passes this object as parameter.
308
- *
309
- * @since 2.2.3
310
- * @param callable $cb The callback method/function/closure.
311
- * @param mixed $additional_params Any additoinal parameters which should be passed to the callback.
312
- * @return mixed Return of the callback function.
313
- */
314
- protected function do_callback( $cb, $additional_params = null ) {
315
- return call_user_func( $cb, $this->{$this->properties_name}, $this, $additional_params );
316
- }
317
-
318
- /**
319
- * Checks if field has a callback value
320
- *
321
- * @since 1.0.1
322
- * @param string $cb Callback string.
323
- * @return mixed NULL, false for NO validation, or $cb string if it exists.
324
- */
325
- public function maybe_callback( $cb ) {
326
- $args = $this->{$this->properties_name};
327
- if ( ! isset( $args[ $cb ] ) ) {
328
- return null;
329
- }
330
-
331
- // Check if requesting explicitly false.
332
- $cb = false !== $args[ $cb ] && 'false' !== $args[ $cb ] ? $args[ $cb ] : false;
333
-
334
- // If requesting NO validation, return false.
335
- if ( ! $cb ) {
336
- return false;
337
- }
338
-
339
- if ( is_callable( $cb ) ) {
340
- return $cb;
341
- }
342
-
343
- return null;
344
- }
345
-
346
- /**
347
- * Checks if this object has parameter corresponding to the given filter
348
- * which is callable. If so, it registers the callback, and if not,
349
- * converts the maybe-modified $val to a boolean for return.
350
- *
351
- * The registered handlers will have a parameter name which matches the filter, except:
352
- * - The 'cmb2_api' prefix will be removed
353
- * - A '_cb' suffix will be added (to stay inline with other '*_cb' parameters).
354
- *
355
- * @since 2.2.3
356
- *
357
- * @param string $hook_name The hook name.
358
- * @param bool $val The default value.
359
- * @param string $hook_function The hook function. Default: 'add_filter'.
360
- *
361
- * @return null|bool Null if hook is registered, or bool for value.
362
- */
363
- public function maybe_hook_parameter( $hook_name, $val = null, $hook_function = 'add_filter' ) {
364
-
365
- // Remove filter prefix, add param suffix.
366
- $parameter = substr( $hook_name, strlen( 'cmb2_api_' ) ) . '_cb';
367
-
368
- return self::maybe_hook(
369
- $this->prop( $parameter, $val ),
370
- $hook_name,
371
- $hook_function
372
- );
373
- }
374
-
375
- /**
376
- * Checks if given value is callable, and registers the callback.
377
- * If is non-callable, converts the $val to a boolean for return.
378
- *
379
- * @since 2.2.3
380
- *
381
- * @param bool $val The default value.
382
- * @param string $hook_name The hook name.
383
- * @param string $hook_function The hook function.
384
- *
385
- * @return null|bool Null if hook is registered, or bool for value.
386
- */
387
- public static function maybe_hook( $val, $hook_name, $hook_function ) {
388
- if ( is_callable( $val ) ) {
389
- call_user_func( $hook_function, $hook_name, $val, 10, 2 );
390
- return null;
391
- }
392
-
393
- // Cast to bool.
394
- return ! ! $val;
395
- }
396
-
397
- /**
398
- * Mark a param as deprecated and inform when it has been used.
399
- *
400
- * There is a default WordPress hook deprecated_argument_run that will be called
401
- * that can be used to get the backtrace up to what file and function used the
402
- * deprecated argument.
403
- *
404
- * The current behavior is to trigger a user error if WP_DEBUG is true.
405
- *
406
- * @since 2.2.3
407
- *
408
- * @param string $function The function that was called.
409
- * @param string $version The version of CMB2 that deprecated the argument used.
410
- * @param string $message Optional. A message regarding the change, or numeric
411
- * key to generate message from additional arguments.
412
- * Default null.
413
- */
414
- protected function deprecated_param( $function, $version, $message = null ) {
415
-
416
- $args = func_get_args();
417
-
418
- if ( is_numeric( $message ) ) {
419
-
420
- switch ( $message ) {
421
-
422
- case self::DEPRECATED_PARAM:
423
- $message = sprintf( __( 'The "%1$s" field parameter has been deprecated in favor of the "%2$s" parameter.', 'cmb2' ), $args[3], $args[4] );
424
- break;
425
-
426
- case self::DEPRECATED_CB_PARAM:
427
- $message = sprintf( __( 'Using the "%1$s" field parameter as a callback has been deprecated in favor of the "%2$s" parameter.', 'cmb2' ), $args[3], $args[4] );
428
- break;
429
-
430
- default:
431
- $message = null;
432
- break;
433
- }
434
- }
435
-
436
- /**
437
- * Fires when a deprecated argument is called. This is a WP core action.
438
- *
439
- * @since 2.2.3
440
- *
441
- * @param string $function The function that was called.
442
- * @param string $message A message regarding the change.
443
- * @param string $version The version of CMB2 that deprecated the argument used.
444
- */
445
- do_action( 'deprecated_argument_run', $function, $message, $version );
446
-
447
- /**
448
- * Filters whether to trigger an error for deprecated arguments. This is a WP core filter.
449
- *
450
- * @since 2.2.3
451
- *
452
- * @param bool $trigger Whether to trigger the error for deprecated arguments. Default true.
453
- */
454
- if ( defined( 'WP_DEBUG' ) && WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
455
- if ( function_exists( '__' ) ) {
456
- if ( ! is_null( $message ) ) {
457
- trigger_error( sprintf( __( '%1$s was called with a parameter that is <strong>deprecated</strong> since version %2$s! %3$s', 'cmb2' ), $function, $version, $message ) );
458
- } else {
459
- trigger_error( sprintf( __( '%1$s was called with a parameter that is <strong>deprecated</strong> since version %2$s with no alternative available.', 'cmb2' ), $function, $version ) );
460
- }
461
- } else {
462
- if ( ! is_null( $message ) ) {
463
- trigger_error( sprintf( '%1$s was called with a parameter that is <strong>deprecated</strong> since version %2$s! %3$s', $function, $version, $message ) );
464
- } else {
465
- trigger_error( sprintf( '%1$s was called with a parameter that is <strong>deprecated</strong> since version %2$s with no alternative available.', $function, $version ) );
466
- }
467
- }
468
- }
469
- }
470
-
471
- /**
472
- * Magic getter for our object.
473
- *
474
- * @param string $field Requested property.
475
- * @throws Exception Throws an exception if the field is invalid.
476
- * @return mixed
477
- */
478
- public function __get( $field ) {
479
- switch ( $field ) {
480
- case 'args':
481
- case 'meta_box':
482
- if ( $field === $this->properties_name ) {
483
- return $this->{$this->properties_name};
484
- }
485
- case 'properties':
486
- return $this->{$this->properties_name};
487
- case 'cmb_id':
488
- case 'object_id':
489
- case 'object_type':
490
- return $this->{$field};
491
- default:
492
- throw new Exception( sprintf( esc_html__( 'Invalid %1$s property: %2$s', 'cmb2' ), __CLASS__, $field ) );
493
- }
494
- }
495
-
496
- /**
497
- * Allows overloading the object with methods... Whooaaa oooh it's magic, y'knoooow.
498
- *
499
- * @since 1.0.0
500
- * @throws Exception Invalid method exception.
501
- *
502
- * @param string $method Non-existent method.
503
- * @param array $args All arguments passed to the method.
504
- * @return mixed
505
- */
506
- public function __call( $method, $args ) {
507
- $object_class = strtolower( get_class( $this ) );
508
-
509
- if ( ! has_filter( "{$object_class}_inherit_{$method}" ) ) {
510
- throw new Exception( sprintf( esc_html__( 'Invalid %1$s method: %2$s', 'cmb2' ), get_class( $this ), $method ) );
511
- }
512
-
513
- array_unshift( $args, $this );
514
-
515
- /**
516
- * Allows overloading the object (CMB2 or CMB2_Field) with additional capabilities
517
- * by registering hook callbacks.
518
- *
519
- * The first dynamic portion of the hook name, $object_class, refers to the object class,
520
- * either cmb2 or cmb2_field.
521
- *
522
- * The second dynamic portion of the hook name, $method, is the non-existent method being
523
- * called on the object. To avoid possible future methods encroaching on your hooks,
524
- * use a unique method (aka, $cmb->prefix_my_method()).
525
- *
526
- * When registering your callback, you will need to ensure that you register the correct
527
- * number of `$accepted_args`, accounting for this object instance being the first argument.
528
- *
529
- * @param array $args The arguments to be passed to the hook.
530
- * The first argument will always be this object instance.
531
- */
532
- return apply_filters_ref_array( "{$object_class}_inherit_{$method}", $args );
533
- }
534
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/CMB2_Boxes.php DELETED
@@ -1,139 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * A CMB2 object instance registry for storing every CMB2 instance.
5
- *
6
- * @category WordPress_Plugin
7
- * @package CMB2
8
- * @author CMB2 team
9
- * @license GPL-2.0+
10
- * @link https://cmb2.io
11
- */
12
- class CMB2_Boxes {
13
-
14
- /**
15
- * Array of all metabox objects.
16
- *
17
- * @since 2.0.0
18
- * @var array
19
- */
20
- protected static $cmb2_instances = array();
21
-
22
- /**
23
- * Add a CMB2 instance object to the registry.
24
- *
25
- * @since 1.X.X
26
- *
27
- * @param CMB2 $cmb_instance CMB2 instance.
28
- */
29
- public static function add( CMB2 $cmb_instance ) {
30
- self::$cmb2_instances[ $cmb_instance->cmb_id ] = $cmb_instance;
31
- }
32
-
33
- /**
34
- * Remove a CMB2 instance object from the registry.
35
- *
36
- * @since 1.X.X
37
- *
38
- * @param string $cmb_id A CMB2 instance id.
39
- */
40
- public static function remove( $cmb_id ) {
41
- if ( array_key_exists( $cmb_id, self::$cmb2_instances ) ) {
42
- unset( self::$cmb2_instances[ $cmb_id ] );
43
- }
44
- }
45
-
46
- /**
47
- * Retrieve a CMB2 instance by cmb id.
48
- *
49
- * @since 1.X.X
50
- *
51
- * @param string $cmb_id A CMB2 instance id.
52
- *
53
- * @return CMB2|bool False or CMB2 object instance.
54
- */
55
- public static function get( $cmb_id ) {
56
- if ( empty( self::$cmb2_instances ) || empty( self::$cmb2_instances[ $cmb_id ] ) ) {
57
- return false;
58
- }
59
-
60
- return self::$cmb2_instances[ $cmb_id ];
61
- }
62
-
63
- /**
64
- * Retrieve all CMB2 instances registered.
65
- *
66
- * @since 1.X.X
67
- * @return CMB2[] Array of all registered cmb2 instances.
68
- */
69
- public static function get_all() {
70
- return self::$cmb2_instances;
71
- }
72
-
73
- /**
74
- * Retrieve all CMB2 instances that have the specified property set.
75
- *
76
- * @since 2.4.0
77
- * @param string $property Property name.
78
- * @param mixed $compare (Optional) The value to compare.
79
- * @return CMB2[] Array of matching cmb2 instances.
80
- */
81
- public static function get_by( $property, $compare = 'nocompare' ) {
82
- $boxes = array();
83
-
84
- foreach ( self::$cmb2_instances as $cmb_id => $cmb ) {
85
- $prop = $cmb->prop( $property );
86
-
87
- if ( 'nocompare' === $compare ) {
88
- if ( ! empty( $prop ) ) {
89
- $boxes[ $cmb_id ] = $cmb;
90
- }
91
- continue;
92
- }
93
-
94
- if ( $compare === $prop ) {
95
- $boxes[ $cmb_id ] = $cmb;
96
- }
97
- }
98
-
99
- return $boxes;
100
- }
101
-
102
- /**
103
- * Retrieve all CMB2 instances as long as they do not include the ignored property.
104
- *
105
- * @since 2.4.0
106
- * @param string $property Property name.
107
- * @param mixed $to_ignore The value to ignore.
108
- * @return CMB2[] Array of matching cmb2 instances.
109
- */
110
- public static function filter_by( $property, $to_ignore = null ) {
111
- $boxes = array();
112
-
113
- foreach ( self::$cmb2_instances as $cmb_id => $cmb ) {
114
-
115
- if ( $to_ignore === $cmb->prop( $property ) ) {
116
- continue;
117
- }
118
-
119
- $boxes[ $cmb_id ] = $cmb;
120
- }
121
-
122
- return $boxes;
123
- }
124
-
125
- /**
126
- * Deprecated and left for back-compatibility. The original `get_by_property`
127
- * method was misnamed and never actually used by CMB2 core.
128
- *
129
- * @since 2.2.3
130
- *
131
- * @param string $property Property name.
132
- * @param mixed $to_ignore The value to ignore.
133
- * @return CMB2[] Array of matching cmb2 instances.
134
- */
135
- public static function get_by_property( $property, $to_ignore = null ) {
136
- _deprecated_function( __METHOD__, '2.4.0', 'CMB2_Boxes::filter_by()' );
137
- return self::filter_by( $property );
138
- }
139
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/CMB2_Field.php DELETED
@@ -1,1644 +0,0 @@
1
- <?php
2
- /**
3
- * CMB2 field objects
4
- *
5
- * @since 1.1.0
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- *
13
- * @method string _id()
14
- * @method string type()
15
- * @method mixed fields()
16
- */
17
- class CMB2_Field extends CMB2_Base {
18
-
19
- /**
20
- * The object properties name.
21
- *
22
- * @var string
23
- * @since 2.2.3
24
- */
25
- protected $properties_name = 'args';
26
-
27
- /**
28
- * Field arguments
29
- *
30
- * @var mixed
31
- * @since 1.1.0
32
- */
33
- public $args = array();
34
-
35
- /**
36
- * Field group object or false (if no group)
37
- *
38
- * @var mixed
39
- * @since 1.1.0
40
- */
41
- public $group = false;
42
-
43
- /**
44
- * Field meta value
45
- *
46
- * @var mixed
47
- * @since 1.1.0
48
- */
49
- public $value = null;
50
-
51
- /**
52
- * Field meta value
53
- *
54
- * @var mixed
55
- * @since 1.1.0
56
- */
57
- public $escaped_value = null;
58
-
59
- /**
60
- * Grouped Field's current numeric index during the save process
61
- *
62
- * @var mixed
63
- * @since 2.0.0
64
- */
65
- public $index = 0;
66
-
67
- /**
68
- * Array of field options
69
- *
70
- * @var array
71
- * @since 2.0.0
72
- */
73
- protected $field_options = array();
74
-
75
- /**
76
- * Array of provided field text strings
77
- *
78
- * @var array
79
- * @since 2.0.0
80
- */
81
- protected $strings;
82
-
83
- /**
84
- * The field's render context. In most cases, 'edit', but can be 'display'.
85
- *
86
- * @var string
87
- * @since 2.2.2
88
- */
89
- public $render_context = 'edit';
90
-
91
- /**
92
- * All CMB2_Field callable field arguments.
93
- * Can be used to determine if a field argument is callable.
94
- *
95
- * @var array
96
- */
97
- public static $callable_fields = array(
98
- 'default_cb',
99
- 'classes_cb',
100
- 'options_cb',
101
- 'text_cb',
102
- 'label_cb',
103
- 'render_row_cb',
104
- 'display_cb',
105
- 'before_group',
106
- 'before_group_row',
107
- 'before_row',
108
- 'before',
109
- 'before_field',
110
- 'after_field',
111
- 'after',
112
- 'after_row',
113
- 'after_group_row',
114
- 'after_group',
115
- );
116
-
117
- /**
118
- * Represents a unique hash representing this field.
119
- *
120
- * @since 2.2.4
121
- *
122
- * @var string
123
- */
124
- protected $hash_id = '';
125
-
126
- /**
127
- * Constructs our field object
128
- *
129
- * @since 1.1.0
130
- * @param array $args Field arguments.
131
- */
132
- public function __construct( $args ) {
133
-
134
- if ( ! empty( $args['group_field'] ) ) {
135
- $this->group = $args['group_field'];
136
- $this->object_id = $this->group->object_id;
137
- $this->object_type = $this->group->object_type;
138
- $this->cmb_id = $this->group->cmb_id;
139
- } else {
140
- $this->object_id = isset( $args['object_id'] ) && '_' !== $args['object_id'] ? $args['object_id'] : 0;
141
- $this->object_type = isset( $args['object_type'] ) ? $args['object_type'] : 'post';
142
-
143
- if ( isset( $args['cmb_id'] ) ) {
144
- $this->cmb_id = $args['cmb_id'];
145
- }
146
- }
147
-
148
- $this->args = $this->_set_field_defaults( $args['field_args'] );
149
-
150
- if ( $this->object_id ) {
151
- $this->value = $this->get_data();
152
- }
153
- }
154
-
155
- /**
156
- * Non-existent methods fallback to checking for field arguments of the same name
157
- *
158
- * @since 1.1.0
159
- * @param string $name Method name.
160
- * @param array $arguments Array of passed-in arguments.
161
- * @return mixed Value of field argument
162
- */
163
- public function __call( $name, $arguments ) {
164
- if ( 'string' === $name ) {
165
- return call_user_func_array( array( $this, 'get_string' ), $arguments );
166
- }
167
-
168
- $key = isset( $arguments[0] ) ? $arguments[0] : '';
169
- return $this->args( $name, $key );
170
- }
171
-
172
- /**
173
- * Retrieves the field id
174
- *
175
- * @since 1.1.0
176
- * @param boolean $raw Whether to retrieve pre-modidifed id.
177
- * @return string Field id
178
- */
179
- public function id( $raw = false ) {
180
- $id = $raw ? '_id' : 'id';
181
- return $this->args( $id );
182
- }
183
-
184
- /**
185
- * Get a field argument
186
- *
187
- * @since 1.1.0
188
- * @param string $key Argument to check.
189
- * @param string $_key Sub argument to check.
190
- * @return mixed Argument value or false if non-existent
191
- */
192
- public function args( $key = '', $_key = '' ) {
193
- $arg = $this->_data( 'args', $key );
194
-
195
- if ( in_array( $key, array( 'default', 'default_cb' ), true ) ) {
196
-
197
- $arg = $this->get_default();
198
-
199
- } elseif ( $_key ) {
200
-
201
- $arg = isset( $arg[ $_key ] ) ? $arg[ $_key ] : false;
202
- }
203
-
204
- return $arg;
205
- }
206
-
207
- /**
208
- * Retrieve a portion of a field property
209
- *
210
- * @since 1.1.0
211
- * @param string $var Field property to check.
212
- * @param string $key Field property array key to check.
213
- * @return mixed Queried property value or false
214
- */
215
- public function _data( $var, $key = '' ) {
216
- $vars = $this->{$var};
217
- if ( $key ) {
218
- return array_key_exists( $key, $vars ) ? $vars[ $key ] : false;
219
- }
220
- return $vars;
221
- }
222
-
223
- /**
224
- * Get Field's value
225
- *
226
- * @since 1.1.0
227
- * @param string $key If value is an array, is used to get array key->value.
228
- * @return mixed Field value or false if non-existent
229
- */
230
- public function value( $key = '' ) {
231
- return $this->_data( 'value', $key );
232
- }
233
-
234
- /**
235
- * Retrieves metadata/option data
236
- *
237
- * @since 1.0.1
238
- * @param string $field_id Meta key/Option array key.
239
- * @param array $args Override arguments.
240
- * @return mixed Meta/Option value
241
- */
242
- public function get_data( $field_id = '', $args = array() ) {
243
- if ( $field_id ) {
244
- $args['field_id'] = $field_id;
245
- } elseif ( $this->group ) {
246
- $args['field_id'] = $this->group->id();
247
- }
248
-
249
- $a = $this->data_args( $args );
250
-
251
- /**
252
- * Filter whether to override getting of meta value.
253
- * Returning a non 'cmb2_field_no_override_val' value
254
- * will effectively short-circuit the value retrieval.
255
- *
256
- * @since 2.0.0
257
- *
258
- * @param mixed $value The value get_metadata() should
259
- * return - a single metadata value,
260
- * or an array of values.
261
- *
262
- * @param int $object_id Object ID.
263
- *
264
- * @param array $args {
265
- * An array of arguments for retrieving data
266
- *
267
- * @type string $type The current object type
268
- * @type int $id The current object ID
269
- * @type string $field_id The ID of the field being requested
270
- * @type bool $repeat Whether current field is repeatable
271
- * @type bool $single Whether current field is a single database row
272
- * }
273
- *
274
- * @param CMB2_Field object $field This field object
275
- */
276
- $data = apply_filters( 'cmb2_override_meta_value', 'cmb2_field_no_override_val', $this->object_id, $a, $this );
277
-
278
- /**
279
- * Filter and parameters are documented for 'cmb2_override_meta_value' filter (above).
280
- *
281
- * The dynamic portion of the hook, $field_id, refers to the current
282
- * field id paramater. Returning a non 'cmb2_field_no_override_val' value
283
- * will effectively short-circuit the value retrieval.
284
- *
285
- * @since 2.0.0
286
- */
287
- $data = apply_filters( "cmb2_override_{$a['field_id']}_meta_value", $data, $this->object_id, $a, $this );
288
-
289
- // If no override, get value normally.
290
- if ( 'cmb2_field_no_override_val' === $data ) {
291
- $data = 'options-page' === $a['type']
292
- ? cmb2_options( $a['id'] )->get( $a['field_id'] )
293
- : get_metadata( $a['type'], $a['id'], $a['field_id'], ( $a['single'] || $a['repeat'] ) );
294
- }
295
-
296
- if ( $this->group ) {
297
-
298
- $data = is_array( $data ) && isset( $data[ $this->group->index ][ $this->args( '_id' ) ] )
299
- ? $data[ $this->group->index ][ $this->args( '_id' ) ]
300
- : false;
301
- }
302
-
303
- return $data;
304
- }
305
-
306
- /**
307
- * Updates metadata/option data.
308
- *
309
- * @since 1.0.1
310
- * @param mixed $new_value Value to update data with.
311
- * @param bool $single Whether data is an array (add_metadata).
312
- * @return mixed
313
- */
314
- public function update_data( $new_value, $single = true ) {
315
- $a = $this->data_args( array(
316
- 'single' => $single,
317
- ) );
318
-
319
- $a['value'] = $a['repeat'] ? array_values( $new_value ) : $new_value;
320
-
321
- /**
322
- * Filter whether to override saving of meta value.
323
- * Returning a non-null value will effectively short-circuit the function.
324
- *
325
- * @since 2.0.0
326
- *
327
- * @param null|bool $check Whether to allow updating metadata for the given type.
328
- *
329
- * @param array $args {
330
- * Array of data about current field including:
331
- *
332
- * @type string $value The value to set
333
- * @type string $type The current object type
334
- * @type int $id The current object ID
335
- * @type string $field_id The ID of the field being updated
336
- * @type bool $repeat Whether current field is repeatable
337
- * @type bool $single Whether current field is a single database row
338
- * }
339
- *
340
- * @param array $field_args All field arguments
341
- *
342
- * @param CMB2_Field object $field This field object
343
- */
344
- $override = apply_filters( 'cmb2_override_meta_save', null, $a, $this->args(), $this );
345
-
346
- /**
347
- * Filter and parameters are documented for 'cmb2_override_meta_save' filter (above).
348
- *
349
- * The dynamic portion of the hook, $a['field_id'], refers to the current
350
- * field id paramater. Returning a non-null value
351
- * will effectively short-circuit the function.
352
- *
353
- * @since 2.0.0
354
- */
355
- $override = apply_filters( "cmb2_override_{$a['field_id']}_meta_save", $override, $a, $this->args(), $this );
356
-
357
- // If override, return that.
358
- if ( null !== $override ) {
359
- return $override;
360
- }
361
-
362
- // Options page handling (or temp data store).
363
- if ( 'options-page' === $a['type'] || empty( $a['id'] ) ) {
364
- return cmb2_options( $a['id'] )->update( $a['field_id'], $a['value'], false, $a['single'] );
365
- }
366
-
367
- // Add metadata if not single.
368
- if ( ! $a['single'] ) {
369
- return add_metadata( $a['type'], $a['id'], $a['field_id'], $a['value'], false );
370
- }
371
-
372
- // Delete meta if we have an empty array.
373
- if ( is_array( $a['value'] ) && empty( $a['value'] ) ) {
374
- return delete_metadata( $a['type'], $a['id'], $a['field_id'], $this->value );
375
- }
376
-
377
- // Update metadata.
378
- return update_metadata( $a['type'], $a['id'], $a['field_id'], $a['value'] );
379
- }
380
-
381
- /**
382
- * Removes/updates metadata/option data.
383
- *
384
- * @since 1.0.1
385
- * @param string $old Old value.
386
- * @return mixed
387
- */
388
- public function remove_data( $old = '' ) {
389
- $a = $this->data_args( array(
390
- 'old' => $old,
391
- ) );
392
-
393
- /**
394
- * Filter whether to override removing of meta value.
395
- * Returning a non-null value will effectively short-circuit the function.
396
- *
397
- * @since 2.0.0
398
- *
399
- * @param null|bool $delete Whether to allow metadata deletion of the given type.
400
- * @param array $args Array of data about current field including:
401
- * 'type' : Current object type
402
- * 'id' : Current object ID
403
- * 'field_id' : Current Field ID
404
- * 'repeat' : Whether current field is repeatable
405
- * 'single' : Whether to save as a
406
- * single meta value
407
- * @param array $field_args All field arguments
408
- * @param CMB2_Field object $field This field object
409
- */
410
- $override = apply_filters( 'cmb2_override_meta_remove', null, $a, $this->args(), $this );
411
-
412
- /**
413
- * Filter whether to override removing of meta value.
414
- *
415
- * The dynamic portion of the hook, $a['field_id'], refers to the current
416
- * field id paramater. Returning a non-null value
417
- * will effectively short-circuit the function.
418
- *
419
- * @since 2.0.0
420
- *
421
- * @param null|bool $delete Whether to allow metadata deletion of the given type.
422
- * @param array $args Array of data about current field including:
423
- * 'type' : Current object type
424
- * 'id' : Current object ID
425
- * 'field_id' : Current Field ID
426
- * 'repeat' : Whether current field is repeatable
427
- * 'single' : Whether to save as a
428
- * single meta value
429
- * @param array $field_args All field arguments
430
- * @param CMB2_Field object $field This field object
431
- */
432
- $override = apply_filters( "cmb2_override_{$a['field_id']}_meta_remove", $override, $a, $this->args(), $this );
433
-
434
- // If no override, remove as usual.
435
- if ( null !== $override ) {
436
- return $override;
437
- } // End if.
438
- // Option page handling.
439
- elseif ( 'options-page' === $a['type'] || empty( $a['id'] ) ) {
440
- return cmb2_options( $a['id'] )->remove( $a['field_id'] );
441
- }
442
-
443
- // Remove metadata.
444
- return delete_metadata( $a['type'], $a['id'], $a['field_id'], $old );
445
- }
446
-
447
- /**
448
- * Data variables for get/set data methods
449
- *
450
- * @since 1.1.0
451
- * @param array $args Override arguments.
452
- * @return array Updated arguments
453
- */
454
- public function data_args( $args = array() ) {
455
- $args = wp_parse_args( $args, array(
456
- 'type' => $this->object_type,
457
- 'id' => $this->object_id,
458
- 'field_id' => $this->id( true ),
459
- 'repeat' => $this->args( 'repeatable' ),
460
- 'single' => ! $this->args( 'multiple' ),
461
- ) );
462
- return $args;
463
- }
464
-
465
- /**
466
- * Checks if field has a registered sanitization callback
467
- *
468
- * @since 1.0.1
469
- * @param mixed $meta_value Meta value.
470
- * @return mixed Possibly sanitized meta value
471
- */
472
- public function sanitization_cb( $meta_value ) {
473
-
474
- if ( $this->args( 'repeatable' ) && is_array( $meta_value ) ) {
475
- // Remove empties.
476
- $meta_value = array_filter( $meta_value );
477
- }
478
-
479
- // Check if the field has a registered validation callback.
480
- $cb = $this->maybe_callback( 'sanitization_cb' );
481
- if ( false === $cb ) {
482
- // If requesting NO validation, return meta value.
483
- return $meta_value;
484
- } elseif ( $cb ) {
485
- // Ok, callback is good, let's run it.
486
- return call_user_func( $cb, $meta_value, $this->args(), $this );
487
- }
488
-
489
- $sanitizer = new CMB2_Sanitize( $this, $meta_value );
490
- $field_type = $this->type();
491
-
492
- /**
493
- * Filter the value before it is saved.
494
- *
495
- * The dynamic portion of the hook name, $field_type, refers to the field type.
496
- *
497
- * Passing a non-null value to the filter will short-circuit saving
498
- * the field value, saving the passed value instead.
499
- *
500
- * @param bool|mixed $override_value Sanitization/Validation override value to return.
501
- * Default: null. false to skip it.
502
- * @param mixed $value The value to be saved to this field.
503
- * @param int $object_id The ID of the object where the value will be saved
504
- * @param array $field_args The current field's arguments
505
- * @param object $sanitizer This `CMB2_Sanitize` object
506
- */
507
- $override_value = apply_filters( "cmb2_sanitize_{$field_type}", null, $sanitizer->value, $this->object_id, $this->args(), $sanitizer );
508
-
509
- if ( null !== $override_value ) {
510
- return $override_value;
511
- }
512
-
513
- // Sanitization via 'CMB2_Sanitize'.
514
- return $sanitizer->{$field_type}();
515
- }
516
-
517
- /**
518
- * Process $_POST data to save this field's value
519
- *
520
- * @since 2.0.3
521
- * @param array $data_to_save $_POST data to check.
522
- * @return array|int|bool Result of save, false on failure
523
- */
524
- public function save_field_from_data( array $data_to_save ) {
525
- $this->data_to_save = $data_to_save;
526
-
527
- $meta_value = isset( $this->data_to_save[ $this->id( true ) ] )
528
- ? $this->data_to_save[ $this->id( true ) ]
529
- : null;
530
-
531
- return $this->save_field( $meta_value );
532
- }
533
-
534
- /**
535
- * Sanitize/store a value to this field
536
- *
537
- * @since 2.0.0
538
- * @param array $meta_value Desired value to sanitize/store.
539
- * @return array|int|bool Result of save. false on failure
540
- */
541
- public function save_field( $meta_value ) {
542
-
543
- $updated = false;
544
- $action = '';
545
- $new_value = $this->sanitization_cb( $meta_value );
546
-
547
- if ( ! $this->args( 'save_field' ) ) {
548
-
549
- // Nothing to see here.
550
- $action = 'disabled';
551
-
552
- } elseif ( $this->args( 'multiple' ) && ! $this->args( 'repeatable' ) && ! $this->group ) {
553
-
554
- $this->remove_data();
555
- $count = 0;
556
-
557
- if ( ! empty( $new_value ) ) {
558
- foreach ( $new_value as $add_new ) {
559
- if ( $this->update_data( $add_new, false ) ) {
560
- $count++;
561
- }
562
- }
563
- }
564
-
565
- $updated = $count ? $count : false;
566
- $action = 'repeatable';
567
-
568
- } elseif ( ! CMB2_Utils::isempty( $new_value ) && $new_value !== $this->get_data() ) {
569
- $updated = $this->update_data( $new_value );
570
- $action = 'updated';
571
- } elseif ( CMB2_Utils::isempty( $new_value ) ) {
572
- $updated = $this->remove_data();
573
- $action = 'removed';
574
- }
575
-
576
- if ( $updated ) {
577
- $this->value = $this->get_data();
578
- $this->escaped_value = null;
579
- }
580
-
581
- $field_id = $this->id( true );
582
-
583
- /**
584
- * Hooks after save field action.
585
- *
586
- * @since 2.2.0
587
- *
588
- * @param string $field_id the current field id paramater.
589
- * @param bool $updated Whether the metadata update action occurred.
590
- * @param string $action Action performed. Could be "repeatable", "updated", or "removed".
591
- * @param CMB2_Field object $field This field object
592
- */
593
- do_action( 'cmb2_save_field', $field_id, $updated, $action, $this );
594
-
595
- /**
596
- * Hooks after save field action.
597
- *
598
- * The dynamic portion of the hook, $field_id, refers to the
599
- * current field id paramater.
600
- *
601
- * @since 2.2.0
602
- *
603
- * @param bool $updated Whether the metadata update action occurred.
604
- * @param string $action Action performed. Could be "repeatable", "updated", or "removed".
605
- * @param CMB2_Field object $field This field object
606
- */
607
- do_action( "cmb2_save_field_{$field_id}", $updated, $action, $this );
608
-
609
- return $updated;
610
- }
611
-
612
- /**
613
- * Determine if current type is exempt from escaping
614
- *
615
- * @since 1.1.0
616
- * @return bool True if exempt
617
- */
618
- public function escaping_exception() {
619
- // These types cannot be escaped.
620
- return in_array( $this->type(), array(
621
- 'file_list',
622
- 'multicheck',
623
- 'text_datetime_timestamp_timezone',
624
- ) );
625
- }
626
-
627
- /**
628
- * Determine if current type cannot be repeatable
629
- *
630
- * @since 1.1.0
631
- * @param string $type Field type to check.
632
- * @return bool True if type cannot be repeatable
633
- */
634
- public function repeatable_exception( $type ) {
635
- // These types cannot be repeatable.
636
- $internal_fields = array(
637
- // Use file_list instead.
638
- 'file' => 1,
639
- 'radio' => 1,
640
- 'title' => 1,
641
- 'wysiwyg' => 1,
642
- 'checkbox' => 1,
643
- 'radio_inline' => 1,
644
- 'taxonomy_radio' => 1,
645
- 'taxonomy_radio_inline' => 1,
646
- 'taxonomy_radio_hierarchical' => 1,
647
- 'taxonomy_select' => 1,
648
- 'taxonomy_select_hierarchical' => 1,
649
- 'taxonomy_multicheck' => 1,
650
- 'taxonomy_multicheck_inline' => 1,
651
- 'taxonomy_multicheck_hierarchical' => 1,
652
- );
653
-
654
- /**
655
- * Filter field types that are non-repeatable.
656
- *
657
- * Note that this does *not* allow overriding the default non-repeatable types.
658
- *
659
- * @since 2.1.1
660
- *
661
- * @param array $fields Array of fields designated as non-repeatable. Note that the field names are *keys*,
662
- * and not values. The value can be anything, because it is meaningless. Example:
663
- * array( 'my_custom_field' => 1 )
664
- */
665
- $all_fields = array_merge( apply_filters( 'cmb2_non_repeatable_fields', array() ), $internal_fields );
666
- return isset( $all_fields[ $type ] );
667
- }
668
-
669
- /**
670
- * Determine if current type has its own defaults field-arguments method.
671
- *
672
- * @since 2.2.6
673
- * @param string $type Field type to check.
674
- * @return bool True if has own method.
675
- */
676
- public function has_args_method( $type ) {
677
-
678
- // These types have their own arguments parser.
679
- $type_methods = array(
680
- 'group' => 'set_field_defaults_group',
681
- 'wysiwyg' => 'set_field_defaults_wysiwyg',
682
- );
683
-
684
- if ( isset( $type_methods[ $type ] ) ) {
685
- return $type_methods[ $type ];
686
- }
687
-
688
- $all_or_nothing_types = array_flip( apply_filters( 'cmb2_all_or_nothing_types', array(
689
- 'select',
690
- 'radio',
691
- 'radio_inline',
692
- 'taxonomy_select',
693
- 'taxonomy_select_hierarchical',
694
- 'taxonomy_radio',
695
- 'taxonomy_radio_inline',
696
- 'taxonomy_radio_hierarchical',
697
- ), $this ) );
698
-
699
- if ( isset( $all_or_nothing_types[ $type ] ) ) {
700
- return 'set_field_defaults_all_or_nothing_types';
701
- }
702
-
703
- return false;
704
- }
705
-
706
- /**
707
- * Escape the value before output. Defaults to 'esc_attr()'
708
- *
709
- * @since 1.0.1
710
- * @param callable|string $func Escaping function (if not esc_attr()).
711
- * @param mixed $meta_value Meta value.
712
- * @return mixed Final value.
713
- */
714
- public function escaped_value( $func = 'esc_attr', $meta_value = '' ) {
715
-
716
- if ( null !== $this->escaped_value ) {
717
- return $this->escaped_value;
718
- }
719
-
720
- $meta_value = $meta_value ? $meta_value : $this->value();
721
-
722
- // Check if the field has a registered escaping callback.
723
- if ( $cb = $this->maybe_callback( 'escape_cb' ) ) {
724
- // Ok, callback is good, let's run it.
725
- return call_user_func( $cb, $meta_value, $this->args(), $this );
726
- }
727
-
728
- $field_type = $this->type();
729
-
730
- /**
731
- * Filter the value for escaping before it is ouput.
732
- *
733
- * The dynamic portion of the hook name, $field_type, refers to the field type.
734
- *
735
- * Passing a non-null value to the filter will short-circuit the built-in
736
- * escaping for this field.
737
- *
738
- * @param bool|mixed $override_value Escaping override value to return.
739
- * Default: null. false to skip it.
740
- * @param mixed $meta_value The value to be output.
741
- * @param array $field_args The current field's arguments.
742
- * @param object $field This `CMB2_Field` object.
743
- */
744
- $esc = apply_filters( "cmb2_types_esc_{$field_type}", null, $meta_value, $this->args(), $this );
745
- if ( null !== $esc ) {
746
- return $esc;
747
- }
748
-
749
- if ( false === $cb || $this->escaping_exception() ) {
750
- // If requesting NO escaping, return meta value.
751
- return $this->val_or_default( $meta_value );
752
- }
753
-
754
- // escaping function passed in?
755
- $func = $func ? $func : 'esc_attr';
756
- $meta_value = $this->val_or_default( $meta_value );
757
-
758
- if ( is_array( $meta_value ) ) {
759
- foreach ( $meta_value as $key => $value ) {
760
- $meta_value[ $key ] = call_user_func( $func, $value );
761
- }
762
- } else {
763
- $meta_value = call_user_func( $func, $meta_value );
764
- }
765
-
766
- $this->escaped_value = $meta_value;
767
- return $this->escaped_value;
768
- }
769
-
770
- /**
771
- * Return non-empty value or field default if value IS empty
772
- *
773
- * @since 2.0.0
774
- * @param mixed $meta_value Field value.
775
- * @return mixed Field value, or default value
776
- */
777
- public function val_or_default( $meta_value ) {
778
- return ! CMB2_Utils::isempty( $meta_value ) ? $meta_value : $this->get_default();
779
- }
780
-
781
- /**
782
- * Offset a time value based on timezone
783
- *
784
- * @since 1.0.0
785
- * @return string Offset time string
786
- */
787
- public function field_timezone_offset() {
788
- return CMB2_Utils::timezone_offset( $this->field_timezone() );
789
- }
790
-
791
- /**
792
- * Return timezone string
793
- *
794
- * @since 1.0.0
795
- * @return string Timezone string
796
- */
797
- public function field_timezone() {
798
- $value = '';
799
-
800
- // Is timezone arg set?
801
- if ( $this->args( 'timezone' ) ) {
802
- $value = $this->args( 'timezone' );
803
- } // End if.
804
- // Is there another meta key with a timezone stored as its value we should use?
805
- elseif ( $this->args( 'timezone_meta_key' ) ) {
806
- $value = $this->get_data( $this->args( 'timezone_meta_key' ) );
807
- }
808
-
809
- return $value;
810
- }
811
-
812
- /**
813
- * Format the timestamp field value based on the field date/time format arg
814
- *
815
- * @since 2.0.0
816
- * @param int $meta_value Timestamp.
817
- * @param string $format Either date_format or time_format.
818
- * @return string Formatted date
819
- */
820
- public function format_timestamp( $meta_value, $format = 'date_format' ) {
821
- return date( stripslashes( $this->args( $format ) ), $meta_value );
822
- }
823
-
824
- /**
825
- * Return a formatted timestamp for a field
826
- *
827
- * @since 2.0.0
828
- * @param string $format Either date_format or time_format.
829
- * @param string|int $meta_value Optional meta value to check.
830
- * @return string Formatted date
831
- */
832
- public function get_timestamp_format( $format = 'date_format', $meta_value = 0 ) {
833
- $meta_value = $meta_value ? $meta_value : $this->escaped_value();
834
- if ( empty( $meta_value ) ) {
835
- $meta_value = $this->get_default();
836
- }
837
-
838
- $meta_value = CMB2_Utils::make_valid_time_stamp( $meta_value );
839
- if ( empty( $meta_value ) ) {
840
- return '';
841
- }
842
-
843
- return is_array( $meta_value )
844
- ? array_map( array( $this, 'format_timestamp' ), $meta_value, $format )
845
- : $this->format_timestamp( $meta_value, $format );
846
- }
847
-
848
- /**
849
- * Get timestamp from text date
850
- *
851
- * @since 2.2.0
852
- * @param string $value Date value.
853
- * @return mixed Unix timestamp representing the date.
854
- */
855
- public function get_timestamp_from_value( $value ) {
856
- return CMB2_Utils::get_timestamp_from_value( $value, $this->args( 'date_format' ) );
857
- }
858
-
859
- /**
860
- * Get field render callback and Render the field row
861
- *
862
- * @since 1.0.0
863
- */
864
- public function render_field() {
865
- $this->render_context = 'edit';
866
-
867
- $this->peform_param_callback( 'render_row_cb' );
868
-
869
- // For chaining.
870
- return $this;
871
- }
872
-
873
- /**
874
- * Default field render callback
875
- *
876
- * @since 2.1.1
877
- */
878
- public function render_field_callback() {
879
-
880
- // If field is requesting to not be shown on the front-end.
881
- if ( ! is_admin() && ! $this->args( 'on_front' ) ) {
882
- return;
883
- }
884
-
885
- // If field is requesting to be conditionally shown.
886
- if ( ! $this->should_show() ) {
887
- return;
888
- }
889
-
890
- $field_type = $this->type();
891
-
892
- /**
893
- * Hook before field row begins.
894
- *
895
- * @param CMB2_Field $field The current field object.
896
- */
897
- do_action( 'cmb2_before_field_row', $this );
898
-
899
- /**
900
- * Hook before field row begins.
901
- *
902
- * The dynamic portion of the hook name, $field_type, refers to the field type.
903
- *
904
- * @param CMB2_Field $field The current field object.
905
- */
906
- do_action( "cmb2_before_{$field_type}_field_row", $this );
907
-
908
- $this->peform_param_callback( 'before_row' );
909
-
910
- printf( "<div class=\"cmb-row %s\" data-fieldtype=\"%s\">\n", $this->row_classes(), $field_type );
911
-
912
- if ( ! $this->args( 'show_names' ) ) {
913
- echo "\n\t<div class=\"cmb-td\">\n";
914
-
915
- $this->peform_param_callback( 'label_cb' );
916
-
917
- } else {
918
-
919
- if ( $this->get_param_callback_result( 'label_cb' ) ) {
920
- echo '<div class="cmb-th">', $this->peform_param_callback( 'label_cb' ), '</div>';
921
- }
922
-
923
- echo "\n\t<div class=\"cmb-td\">\n";
924
- }
925
-
926
- $this->peform_param_callback( 'before' );
927
-
928
- $types = new CMB2_Types( $this );
929
- $types->render();
930
-
931
- $this->peform_param_callback( 'after' );
932
-
933
- echo "\n\t</div>\n</div>";
934
-
935
- $this->peform_param_callback( 'after_row' );
936
-
937
- /**
938
- * Hook after field row ends.
939
- *
940
- * The dynamic portion of the hook name, $field_type, refers to the field type.
941
- *
942
- * @param CMB2_Field $field The current field object.
943
- */
944
- do_action( "cmb2_after_{$field_type}_field_row", $this );
945
-
946
- /**
947
- * Hook after field row ends.
948
- *
949
- * @param CMB2_Field $field The current field object.
950
- */
951
- do_action( 'cmb2_after_field_row', $this );
952
-
953
- // For chaining.
954
- return $this;
955
- }
956
-
957
- /**
958
- * The default label_cb callback (if not a title field)
959
- *
960
- * @since 2.1.1
961
- * @return string Label html markup.
962
- */
963
- public function label() {
964
- if ( ! $this->args( 'name' ) ) {
965
- return '';
966
- }
967
-
968
- $style = ! $this->args( 'show_names' ) ? ' style="display:none;"' : '';
969
-
970
- return sprintf( "\n" . '<label%1$s for="%2$s">%3$s</label>' . "\n", $style, $this->id(), $this->args( 'name' ) );
971
- }
972
-
973
- /**
974
- * Defines the classes for the current CMB2 field row
975
- *
976
- * @since 2.0.0
977
- * @return string Space concatenated list of classes
978
- */
979
- public function row_classes() {
980
-
981
- $classes = array();
982
-
983
- /**
984
- * By default, 'text_url' and 'text' fields get table-like styling
985
- *
986
- * @since 2.0.0
987
- *
988
- * @param array $field_types The types of fields which should get the 'table-layout' class
989
- */
990
- $repeat_table_rows_types = apply_filters( 'cmb2_repeat_table_row_types', array(
991
- 'text_url',
992
- 'text',
993
- ) );
994
-
995
- $conditional_classes = array(
996
- 'cmb-type-' . str_replace( '_', '-', sanitize_html_class( $this->type() ) ) => true,
997
- 'cmb2-id-' . str_replace( '_', '-', sanitize_html_class( $this->id() ) ) => true,
998
- 'cmb-repeat' => $this->args( 'repeatable' ),
999
- 'cmb-repeat-group-field' => $this->group,
1000
- 'cmb-inline' => $this->args( 'inline' ),
1001
- 'table-layout' => 'edit' === $this->render_context && in_array( $this->type(), $repeat_table_rows_types ),
1002
- );
1003
-
1004
- foreach ( $conditional_classes as $class => $condition ) {
1005
- if ( $condition ) {
1006
- $classes[] = $class;
1007
- }
1008
- }
1009
-
1010
- if ( $added_classes = $this->args( 'classes' ) ) {
1011
- $added_classes = is_array( $added_classes ) ? implode( ' ', $added_classes ) : (string) $added_classes;
1012
- } elseif ( $added_classes = $this->get_param_callback_result( 'classes_cb' ) ) {
1013
- $added_classes = is_array( $added_classes ) ? implode( ' ', $added_classes ) : (string) $added_classes;
1014
- }
1015
-
1016
- if ( $added_classes ) {
1017
- $classes[] = esc_attr( $added_classes );
1018
- }
1019
-
1020
- /**
1021
- * Globally filter row classes
1022
- *
1023
- * @since 2.0.0
1024
- *
1025
- * @param string $classes Space-separated list of row classes
1026
- * @param CMB2_Field object $field This field object
1027
- */
1028
- return apply_filters( 'cmb2_row_classes', implode( ' ', $classes ), $this );
1029
- }
1030
-
1031
- /**
1032
- * Get field display callback and render the display value in the column.
1033
- *
1034
- * @since 2.2.2
1035
- */
1036
- public function render_column() {
1037
- $this->render_context = 'display';
1038
-
1039
- $this->peform_param_callback( 'display_cb' );
1040
-
1041
- // For chaining.
1042
- return $this;
1043
- }
1044
-
1045
- /**
1046
- * The method to fetch the value for this field for the REST API.
1047
- *
1048
- * @since 2.5.0
1049
- */
1050
- public function get_rest_value() {
1051
- $field_type = $this->type();
1052
- $field_id = $this->id( true );
1053
-
1054
- if ( $cb = $this->maybe_callback( 'rest_value_cb' ) ) {
1055
- add_filter( "cmb2_get_rest_value_for_{$field_id}", $cb, 99 );
1056
- }
1057
-
1058
- $value = $this->get_data();
1059
-
1060
- /**
1061
- * Filter the value before it is sent to the REST request.
1062
- *
1063
- * @since 2.5.0
1064
- *
1065
- * @param mixed $value The value from CMB2_Field::get_data()
1066
- * @param CMB2_Field $field This field object.
1067
- */
1068
- $value = apply_filters( 'cmb2_get_rest_value', $value, $this );
1069
-
1070
- /**
1071
- * Filter the value before it is sent to the REST request.
1072
- *
1073
- * The dynamic portion of the hook name, $field_type, refers to the field type.
1074
- *
1075
- * @since 2.5.0
1076
- *
1077
- * @param mixed $value The value from CMB2_Field::get_data()
1078
- * @param CMB2_Field $field This field object.
1079
- */
1080
- $value = apply_filters( "cmb2_get_rest_value_{$field_type}", $value, $this );
1081
-
1082
- /**
1083
- * Filter the value before it is sent to the REST request.
1084
- *
1085
- * The dynamic portion of the hook name, $field_id, refers to the field id.
1086
- *
1087
- * @since 2.5.0
1088
- *
1089
- * @param mixed $value The value from CMB2_Field::get_data()
1090
- * @param CMB2_Field $field This field object.
1091
- */
1092
- return apply_filters( "cmb2_get_rest_value_for_{$field_id}", $value, $this );
1093
- }
1094
-
1095
- /**
1096
- * Get a field object for a supporting field. (e.g. file field)
1097
- *
1098
- * @since 2.7.0
1099
- *
1100
- * @return CMB2_Field|bool Supporting field object, if supported.
1101
- */
1102
- public function get_supporting_field() {
1103
- $suffix = $this->args( 'has_supporting_data' );
1104
- if ( empty( $suffix ) ) {
1105
- return false;
1106
- }
1107
-
1108
- return $this->get_field_clone( array(
1109
- 'id' => $this->_id( '', false ) . $suffix,
1110
- 'sanitization_cb' => false,
1111
- ) );
1112
- }
1113
-
1114
- /**
1115
- * Default callback to outputs field value in a display format.
1116
- *
1117
- * @since 2.2.2
1118
- */
1119
- public function display_value_callback() {
1120
- // If field is requesting to be conditionally shown.
1121
- if ( ! $this->should_show() ) {
1122
- return;
1123
- }
1124
-
1125
- $display = new CMB2_Field_Display( $this );
1126
- $field_type = $this->type();
1127
-
1128
- /**
1129
- * A filter to bypass the default display.
1130
- *
1131
- * The dynamic portion of the hook name, $field_type, refers to the field type.
1132
- *
1133
- * Passing a non-null value to the filter will short-circuit the default display.
1134
- *
1135
- * @param bool|mixed $pre_output Default null value.
1136
- * @param CMB2_Field $field This field object.
1137
- * @param CMB2_Field_Display $display The `CMB2_Field_Display` object.
1138
- */
1139
- $pre_output = apply_filters( "cmb2_pre_field_display_{$field_type}", null, $this, $display );
1140
-
1141
- if ( null !== $pre_output ) {
1142
- echo $pre_output;
1143
- return;
1144
- }
1145
-
1146
- $this->peform_param_callback( 'before_display_wrap' );
1147
-
1148
- printf( "<div class=\"cmb-column %s\" data-fieldtype=\"%s\">\n", $this->row_classes(), $field_type );
1149
-
1150
- $this->peform_param_callback( 'before_display' );
1151
-
1152
- CMB2_Field_Display::get( $this )->display();
1153
-
1154
- $this->peform_param_callback( 'after_display' );
1155
-
1156
- echo "\n</div>";
1157
-
1158
- $this->peform_param_callback( 'after_display_wrap' );
1159
-
1160
- // For chaining.
1161
- return $this;
1162
- }
1163
-
1164
- /**
1165
- * Replaces a hash key - {#} - with the repeatable index
1166
- *
1167
- * @since 1.2.0
1168
- * @param string $value Value to update.
1169
- * @return string Updated value
1170
- */
1171
- public function replace_hash( $value ) {
1172
- // Replace hash with 1 based count.
1173
- return str_replace( '{#}', ( $this->index + 1 ), $value );
1174
- }
1175
-
1176
- /**
1177
- * Retrieve text parameter from field's text array (if it has one), or use fallback text
1178
- * For back-compatibility, falls back to checking the options array.
1179
- *
1180
- * @since 2.2.2
1181
- * @param string $text_key Key in field's text array.
1182
- * @param string $fallback Fallback text.
1183
- * @return string Text
1184
- */
1185
- public function get_string( $text_key, $fallback ) {
1186
- // If null, populate with our field strings values.
1187
- if ( null === $this->strings ) {
1188
- $this->strings = (array) $this->args['text'];
1189
-
1190
- if ( is_callable( $this->args['text_cb'] ) ) {
1191
- $strings = call_user_func( $this->args['text_cb'], $this );
1192
-
1193
- if ( $strings && is_array( $strings ) ) {
1194
- $this->strings += $strings;
1195
- }
1196
- }
1197
- }
1198
-
1199
- // If we have that string value, send it back.
1200
- if ( isset( $this->strings[ $text_key ] ) ) {
1201
- return $this->strings[ $text_key ];
1202
- }
1203
-
1204
- // Check options for back-compat.
1205
- $string = $this->options( $text_key );
1206
-
1207
- return $string ? $string : $fallback;
1208
- }
1209
-
1210
- /**
1211
- * Retrieve options args.
1212
- *
1213
- * @since 2.0.0
1214
- * @param string $key Specific option to retrieve.
1215
- * @return array|mixed Array of options or specific option.
1216
- */
1217
- public function options( $key = '' ) {
1218
- if ( empty( $this->field_options ) ) {
1219
- $this->set_options();
1220
- }
1221
-
1222
- if ( $key ) {
1223
- return array_key_exists( $key, $this->field_options ) ? $this->field_options[ $key ] : false;
1224
- }
1225
-
1226
- return $this->field_options;
1227
- }
1228
-
1229
- /**
1230
- * Generates/sets options args. Calls options_cb if it exists.
1231
- *
1232
- * @since 2.2.5
1233
- *
1234
- * @return array Array of options
1235
- */
1236
- public function set_options() {
1237
- $this->field_options = (array) $this->args['options'];
1238
-
1239
- if ( is_callable( $this->args['options_cb'] ) ) {
1240
- $options = call_user_func( $this->args['options_cb'], $this );
1241
-
1242
- if ( $options && is_array( $options ) ) {
1243
- $this->field_options = $options + $this->field_options;
1244
- }
1245
- }
1246
-
1247
- return $this->field_options;
1248
- }
1249
-
1250
- /**
1251
- * Store JS dependencies as part of the field args.
1252
- *
1253
- * @since 2.2.0
1254
- * @param array $dependencies Dependies to register for this field.
1255
- */
1256
- public function add_js_dependencies( $dependencies = array() ) {
1257
- foreach ( (array) $dependencies as $dependency ) {
1258
- $this->args['js_dependencies'][ $dependency ] = $dependency;
1259
- }
1260
-
1261
- CMB2_JS::add_dependencies( $dependencies );
1262
- }
1263
-
1264
- /**
1265
- * Send field data to JS.
1266
- *
1267
- * @since 2.2.0
1268
- */
1269
- public function register_js_data() {
1270
- if ( $this->group ) {
1271
- CMB2_JS::add_field_data( $this->group );
1272
- }
1273
-
1274
- return CMB2_JS::add_field_data( $this );
1275
- }
1276
-
1277
- /**
1278
- * Get an array of some of the field data to be used in the Javascript.
1279
- *
1280
- * @since 2.2.4
1281
- *
1282
- * @return array
1283
- */
1284
- public function js_data() {
1285
- return array(
1286
- 'label' => $this->args( 'name' ),
1287
- 'id' => $this->id( true ),
1288
- 'type' => $this->type(),
1289
- 'hash' => $this->hash_id(),
1290
- 'box' => $this->cmb_id,
1291
- 'id_attr' => $this->id(),
1292
- 'name_attr' => $this->args( '_name' ),
1293
- 'default' => $this->get_default(),
1294
- 'group' => $this->group_id(),
1295
- 'index' => $this->group ? $this->group->index : null,
1296
- );
1297
- }
1298
-
1299
- /**
1300
- * Returns a unique hash representing this field.
1301
- *
1302
- * @since 2.2.4
1303
- *
1304
- * @return string
1305
- */
1306
- public function hash_id() {
1307
- if ( '' === $this->hash_id ) {
1308
- $this->hash_id = CMB2_Utils::generate_hash( $this->cmb_id . '||' . $this->id() );
1309
- }
1310
-
1311
- return $this->hash_id;
1312
- }
1313
-
1314
- /**
1315
- * Gets the id of the group field if this field is part of a group.
1316
- *
1317
- * @since 2.2.4
1318
- *
1319
- * @return string
1320
- */
1321
- public function group_id() {
1322
- return $this->group ? $this->group->id( true ) : '';
1323
- }
1324
-
1325
- /**
1326
- * Get CMB2_Field default value, either from default param or default_cb param.
1327
- *
1328
- * @since 0.2.2
1329
- *
1330
- * @return mixed Default field value
1331
- */
1332
- public function get_default() {
1333
- $default = $this->args['default'];
1334
-
1335
- if ( null !== $default ) {
1336
- return apply_filters( 'cmb2_default_filter', $default, $this );
1337
- }
1338
-
1339
- $param = is_callable( $this->args['default_cb'] ) ? 'default_cb' : 'default';
1340
- $default = $this->args['default'] = $this->get_param_callback_result( $param );
1341
-
1342
- // Allow a filter override of the default value.
1343
- return apply_filters( 'cmb2_default_filter', $this->args['default'], $this );
1344
- }
1345
-
1346
- /**
1347
- * Fills in empty field parameters with defaults
1348
- *
1349
- * @since 1.1.0
1350
- *
1351
- * @param array $args Field config array.
1352
- * @return array Modified field config array.
1353
- */
1354
- public function _set_field_defaults( $args ) {
1355
- $defaults = $this->get_default_field_args( $args );
1356
-
1357
- /**
1358
- * Filter the CMB2 Field defaults.
1359
- *
1360
- * @since 2.6.0
1361
- * @param array $defaults Metabox field config array defaults.
1362
- * @param string $id Field id for the current field to allow for selective filtering.
1363
- * @param string $type Field type for the current field to allow for selective filtering.
1364
- * @param CMB2_Field object $field This field object.
1365
- */
1366
- $defaults = apply_filters( 'cmb2_field_defaults', $defaults, $args['id'], $args['type'], $this );
1367
-
1368
- // Set up blank or default values for empty ones.
1369
- $args = wp_parse_args( $args, $defaults );
1370
-
1371
- /**
1372
- * Filtering the CMB2 Field arguments once merged with the defaults, but before further processing.
1373
- *
1374
- * @since 2.6.0
1375
- * @param array $args Metabox field config array defaults.
1376
- * @param CMB2_Field object $field This field object.
1377
- */
1378
- $args = apply_filters( 'cmb2_field_arguments_raw', $args, $this );
1379
-
1380
- /*
1381
- * Deprecated usage:
1382
- *
1383
- * 'std' -- use 'default' (no longer works)
1384
- * 'row_classes' -- use 'class', or 'class_cb'
1385
- * 'default' -- as callback (use default_cb)
1386
- */
1387
- $args = $this->convert_deprecated_params( $args );
1388
-
1389
- $args['repeatable'] = $args['repeatable'] && ! $this->repeatable_exception( $args['type'] );
1390
- $args['inline'] = $args['inline'] || false !== stripos( $args['type'], '_inline' );
1391
- $args['_id'] = $args['id'];
1392
- $args['_name'] = $args['id'];
1393
-
1394
- if ( $method = $this->has_args_method( $args['type'] ) ) {
1395
- $args = $this->{$method}( $args );
1396
- }
1397
-
1398
- if ( $this->group ) {
1399
- $args = $this->set_group_sub_field_defaults( $args );
1400
- }
1401
-
1402
- $with_supporting = array(
1403
- // CMB2_Sanitize::_save_file_id_value()/CMB2_Sanitize::_get_group_file_value_array().
1404
- 'file' => '_id',
1405
- // See CMB2_Sanitize::_save_utc_value().
1406
- 'text_datetime_timestamp_timezone' => '_utc',
1407
- );
1408
-
1409
- $args['has_supporting_data'] = isset( $with_supporting[ $args['type'] ] )
1410
- ? $with_supporting[ $args['type'] ]
1411
- : false;
1412
-
1413
- // Repeatable fields require jQuery sortable library.
1414
- if ( ! empty( $args['repeatable'] ) ) {
1415
- CMB2_JS::add_dependencies( 'jquery-ui-sortable' );
1416
- }
1417
-
1418
- /**
1419
- * Filter the CMB2 Field arguments after processing.
1420
- *
1421
- * @since 2.6.0
1422
- * @param array $args Metabox field config array after processing.
1423
- * @param CMB2_Field object $field This field object.
1424
- */
1425
- return apply_filters( 'cmb2_field_arguments', $args, $this );
1426
- }
1427
-
1428
- /**
1429
- * Sets default arguments for the group field types.
1430
- *
1431
- * @since 2.2.6
1432
- *
1433
- * @param array $args Field config array.
1434
- * @return array Modified field config array.
1435
- */
1436
- protected function set_field_defaults_group( $args ) {
1437
- $args['options'] = wp_parse_args( $args['options'], array(
1438
- 'add_button' => esc_html__( 'Add Group', 'cmb2' ),
1439
- 'remove_button' => esc_html__( 'Remove Group', 'cmb2' ),
1440
- 'remove_confirm' => '',
1441
- ) );
1442
-
1443
- return $args;
1444
- }
1445
-
1446
- /**
1447
- * Sets default arguments for the wysiwyg field types.
1448
- *
1449
- * @since 2.2.6
1450
- *
1451
- * @param array $args Field config array.
1452
- * @return array Modified field config array.
1453
- */
1454
- protected function set_field_defaults_wysiwyg( $args ) {
1455
- $args['id'] = strtolower( str_ireplace( '-', '_', $args['id'] ) );
1456
- $args['options']['textarea_name'] = $args['_name'];
1457
-
1458
- return $args;
1459
- }
1460
-
1461
- /**
1462
- * Sets default arguments for the all-or-nothing field types.
1463
- *
1464
- * @since 2.2.6
1465
- *
1466
- * @param array $args Field config array.
1467
- * @return array Modified field config array.
1468
- */
1469
- protected function set_field_defaults_all_or_nothing_types( $args ) {
1470
- $args['show_option_none'] = isset( $args['show_option_none'] ) ? $args['show_option_none'] : null;
1471
- $args['show_option_none'] = true === $args['show_option_none'] ? esc_html__( 'None', 'cmb2' ) : $args['show_option_none'];
1472
-
1473
- if ( null === $args['show_option_none'] ) {
1474
- $off_by_default = in_array( $args['type'], array( 'select', 'radio', 'radio_inline' ), true );
1475
- $args['show_option_none'] = $off_by_default ? false : esc_html__( 'None', 'cmb2' );
1476
- }
1477
-
1478
- return $args;
1479
- }
1480
-
1481
- /**
1482
- * Sets default arguments for group sub-fields.
1483
- *
1484
- * @since 2.2.6
1485
- *
1486
- * @param array $args Field config array.
1487
- * @return array Modified field config array.
1488
- */
1489
- protected function set_group_sub_field_defaults( $args ) {
1490
- $args['id'] = $this->group->args( 'id' ) . '_' . $this->group->index . '_' . $args['id'];
1491
- $args['_name'] = $this->group->args( 'id' ) . '[' . $this->group->index . '][' . $args['_name'] . ']';
1492
-
1493
- return $args;
1494
- }
1495
-
1496
- /**
1497
- * Gets the default arguments for all fields.
1498
- *
1499
- * @since 2.2.6
1500
- *
1501
- * @param array $args Field config array.
1502
- * @return array Field defaults.
1503
- */
1504
- protected function get_default_field_args( $args ) {
1505
- $type = isset( $args['type'] ) ? $args['type'] : '';
1506
-
1507
- return array(
1508
- 'type' => $type,
1509
- 'name' => '',
1510
- 'desc' => '',
1511
- 'before' => '',
1512
- 'after' => '',
1513
- 'options' => array(),
1514
- 'options_cb' => '',
1515
- 'text' => array(),
1516
- 'text_cb' => '',
1517
- 'attributes' => array(),
1518
- 'protocols' => null,
1519
- 'default' => null,
1520
- 'default_cb' => '',
1521
- 'classes' => null,
1522
- 'classes_cb' => '',
1523
- 'select_all_button' => true,
1524
- 'multiple' => false,
1525
- 'repeatable' => 'group' === $type,
1526
- 'inline' => false,
1527
- 'on_front' => true,
1528
- 'show_names' => true,
1529
- 'save_field' => true, // Will not save if false.
1530
- 'date_format' => 'm\/d\/Y',
1531
- 'time_format' => 'h:i A',
1532
- 'description' => isset( $args['desc'] ) ? $args['desc'] : '',
1533
- 'preview_size' => 'file' === $type ? array( 350, 350 ) : array( 50, 50 ),
1534
- 'render_row_cb' => array( $this, 'render_field_callback' ),
1535
- 'display_cb' => array( $this, 'display_value_callback' ),
1536
- 'label_cb' => 'title' !== $type ? array( $this, 'label' ) : '',
1537
- 'column' => false,
1538
- 'js_dependencies' => array(),
1539
- 'show_in_rest' => null,
1540
- 'char_counter' => false,
1541
- 'char_max' => false,
1542
- 'char_max_enforce' => false,
1543
- );
1544
- }
1545
-
1546
- /**
1547
- * Get default field arguments specific to this CMB2 object.
1548
- *
1549
- * @since 2.2.0
1550
- * @param array $field_args Metabox field config array.
1551
- * @param CMB2_Field $field_group (optional) CMB2_Field object (group parent).
1552
- * @return array Array of field arguments.
1553
- */
1554
- protected function get_default_args( $field_args, $field_group = null ) {
1555
- $args = parent::get_default_args( array(), $this->group );
1556
-
1557
- if ( isset( $field_args['field_args'] ) ) {
1558
- $args = wp_parse_args( $field_args, $args );
1559
- } else {
1560
- $args['field_args'] = wp_parse_args( $field_args, $this->args );
1561
- }
1562
-
1563
- return $args;
1564
- }
1565
-
1566
- /**
1567
- * Returns a cloned version of this field object, but with
1568
- * modified/overridden field arguments.
1569
- *
1570
- * @since 2.2.2
1571
- * @param array $field_args Array of field arguments, or entire array of
1572
- * arguments for CMB2_Field.
1573
- *
1574
- * @return CMB2_Field The new CMB2_Field instance.
1575
- */
1576
- public function get_field_clone( $field_args ) {
1577
- return $this->get_new_field( $field_args );
1578
- }
1579
-
1580
- /**
1581
- * Returns the CMB2 instance this field is registered to.
1582
- *
1583
- * @since 2.2.2
1584
- *
1585
- * @return CMB2|WP_Error If new CMB2_Field is called without cmb_id arg, returns error.
1586
- */
1587
- public function get_cmb() {
1588
- if ( ! $this->cmb_id ) {
1589
- return new WP_Error( 'no_cmb_id', esc_html__( 'Sorry, this field does not have a cmb_id specified.', 'cmb2' ) );
1590
- }
1591
-
1592
- return cmb2_get_metabox( $this->cmb_id, $this->object_id, $this->object_type );
1593
- }
1594
-
1595
- /**
1596
- * Converts deprecated field parameters to the current/proper parameter, and throws a deprecation notice.
1597
- *
1598
- * @since 2.2.3
1599
- * @param array $args Metabox field config array.
1600
- * @return array Modified field config array.
1601
- */
1602
- protected function convert_deprecated_params( $args ) {
1603
-
1604
- if ( isset( $args['row_classes'] ) ) {
1605
-
1606
- // We'll let this one be.
1607
- // $this->deprecated_param( __CLASS__ . '::__construct()', '2.2.3', self::DEPRECATED_PARAM, 'row_classes', 'classes' );
1608
- // row_classes param could be a callback. This is definitely deprecated.
1609
- if ( is_callable( $args['row_classes'] ) ) {
1610
-
1611
- $this->deprecated_param( __CLASS__ . '::__construct()', '2.2.3', self::DEPRECATED_CB_PARAM, 'row_classes', 'classes_cb' );
1612
-
1613
- $args['classes_cb'] = $args['row_classes'];
1614
- $args['classes'] = null;
1615
- } else {
1616
-
1617
- $args['classes'] = $args['row_classes'];
1618
- }
1619
-
1620
- unset( $args['row_classes'] );
1621
- }
1622
-
1623
- // default param can be passed a callback as well.
1624
- if ( is_callable( $args['default'] ) ) {
1625
-
1626
- $this->deprecated_param( __CLASS__ . '::__construct()', '2.2.3', self::DEPRECATED_CB_PARAM, 'default', 'default_cb' );
1627
-
1628
- $args['default_cb'] = $args['default'];
1629
- $args['default'] = null;
1630
- }
1631
-
1632
- // options param can be passed a callback as well.
1633
- if ( is_callable( $args['options'] ) ) {
1634
-
1635
- $this->deprecated_param( __CLASS__ . '::__construct()', '2.2.3', self::DEPRECATED_CB_PARAM, 'options', 'options_cb' );
1636
-
1637
- $args['options_cb'] = $args['options'];
1638
- $args['options'] = array();
1639
- }
1640
-
1641
- return $args;
1642
- }
1643
-
1644
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/CMB2_Field_Display.php DELETED
@@ -1,505 +0,0 @@
1
- <?php
2
- /**
3
- * CMB2 field display base.
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Field_Display {
14
-
15
- /**
16
- * A CMB field object
17
- *
18
- * @var CMB2_Field object
19
- * @since 2.2.2
20
- */
21
- public $field;
22
-
23
- /**
24
- * The CMB field object's value.
25
- *
26
- * @var mixed
27
- * @since 2.2.2
28
- */
29
- public $value;
30
-
31
- /**
32
- * Get the corresponding display class for the field type.
33
- *
34
- * @since 2.2.2
35
- * @param CMB2_Field $field Requested field type.
36
- * @return CMB2_Field_Display
37
- */
38
- public static function get( CMB2_Field $field ) {
39
- $fieldtype = $field->type();
40
- $display_class_name = $field->args( 'display_class' );
41
-
42
- if ( empty( $display_class_name ) ) {
43
- switch ( $fieldtype ) {
44
- case 'text_url':
45
- $display_class_name = 'CMB2_Display_Text_Url';
46
- break;
47
- case 'text_money':
48
- $display_class_name = 'CMB2_Display_Text_Money';
49
- break;
50
- case 'colorpicker':
51
- $display_class_name = 'CMB2_Display_Colorpicker';
52
- break;
53
- case 'checkbox':
54
- $display_class_name = 'CMB2_Display_Checkbox';
55
- break;
56
- case 'wysiwyg':
57
- case 'textarea_small':
58
- $display_class_name = 'CMB2_Display_Textarea';
59
- break;
60
- case 'textarea_code':
61
- $display_class_name = 'CMB2_Display_Textarea_Code';
62
- break;
63
- case 'text_time':
64
- $display_class_name = 'CMB2_Display_Text_Time';
65
- break;
66
- case 'text_date':
67
- case 'text_date_timestamp':
68
- case 'text_datetime_timestamp':
69
- $display_class_name = 'CMB2_Display_Text_Date';
70
- break;
71
- case 'text_datetime_timestamp_timezone':
72
- $display_class_name = 'CMB2_Display_Text_Date_Timezone';
73
- break;
74
- case 'select':
75
- case 'radio':
76
- case 'radio_inline':
77
- $display_class_name = 'CMB2_Display_Select';
78
- break;
79
- case 'multicheck':
80
- case 'multicheck_inline':
81
- $display_class_name = 'CMB2_Display_Multicheck';
82
- break;
83
- case 'taxonomy_radio':
84
- case 'taxonomy_radio_inline':
85
- case 'taxonomy_select':
86
- case 'taxonomy_select_hierarchical':
87
- case 'taxonomy_radio_hierarchical':
88
- $display_class_name = 'CMB2_Display_Taxonomy_Radio';
89
- break;
90
- case 'taxonomy_multicheck':
91
- case 'taxonomy_multicheck_inline':
92
- case 'taxonomy_multicheck_hierarchical':
93
- $display_class_name = 'CMB2_Display_Taxonomy_Multicheck';
94
- break;
95
- case 'file':
96
- $display_class_name = 'CMB2_Display_File';
97
- break;
98
- case 'file_list':
99
- $display_class_name = 'CMB2_Display_File_List';
100
- break;
101
- case 'oembed':
102
- $display_class_name = 'CMB2_Display_oEmbed';
103
- break;
104
- default:
105
- $display_class_name = __CLASS__;
106
- break;
107
- }// End switch.
108
- }
109
-
110
- if ( has_action( "cmb2_display_class_{$fieldtype}" ) ) {
111
-
112
- /**
113
- * Filters the custom field display class used for displaying the field. Class is required to extend CMB2_Type_Base.
114
- *
115
- * The dynamic portion of the hook name, $fieldtype, refers to the (custom) field type.
116
- *
117
- * @since 2.2.4
118
- *
119
- * @param string $display_class_name The custom field display class to use.
120
- * @param object $field The `CMB2_Field` object.
121
- */
122
- $display_class_name = apply_filters( "cmb2_display_class_{$fieldtype}", $display_class_name, $field );
123
- }
124
-
125
- return new $display_class_name( $field );
126
- }
127
-
128
- /**
129
- * Setup our class vars
130
- *
131
- * @since 2.2.2
132
- * @param CMB2_Field $field A CMB2 field object.
133
- */
134
- public function __construct( CMB2_Field $field ) {
135
- $this->field = $field;
136
- $this->value = $this->field->value;
137
- }
138
-
139
- /**
140
- * Catchall method if field's 'display_cb' is NOT defined, or field type does
141
- * not have a corresponding display method
142
- *
143
- * @since 2.2.2
144
- */
145
- public function display() {
146
- // If repeatable.
147
- if ( $this->field->args( 'repeatable' ) ) {
148
-
149
- // And has a repeatable value.
150
- if ( is_array( $this->field->value ) ) {
151
-
152
- // Then loop and output.
153
- echo '<ul class="cmb2-' . esc_attr( sanitize_html_class( str_replace( '_', '-', $this->field->type() ) ) ) . '">';
154
- foreach ( $this->field->value as $val ) {
155
- $this->value = $val;
156
- echo '<li>', $this->_display(), '</li>';
157
- ;
158
- }
159
- echo '</ul>';
160
- }
161
- } else {
162
- $this->_display();
163
- }
164
- }
165
-
166
- /**
167
- * Default fallback display method.
168
- *
169
- * @since 2.2.2
170
- */
171
- protected function _display() {
172
- print_r( $this->value );
173
- }
174
- }
175
-
176
- class CMB2_Display_Text_Url extends CMB2_Field_Display {
177
- /**
178
- * Display url value.
179
- *
180
- * @since 2.2.2
181
- */
182
- protected function _display() {
183
- echo make_clickable( esc_url( $this->value ) );
184
- }
185
- }
186
-
187
- class CMB2_Display_Text_Money extends CMB2_Field_Display {
188
- /**
189
- * Display text_money value.
190
- *
191
- * @since 2.2.2
192
- */
193
- protected function _display() {
194
- $this->value = $this->value ? $this->value : '0';
195
- echo ( ! $this->field->get_param_callback_result( 'before_field' ) ? '$' : ' ' ), $this->value;
196
- }
197
- }
198
-
199
- class CMB2_Display_Colorpicker extends CMB2_Field_Display {
200
- /**
201
- * Display color picker value.
202
- *
203
- * @since 2.2.2
204
- */
205
- protected function _display() {
206
- echo '<span class="cmb2-colorpicker-swatch"><span style="background-color:', esc_attr( $this->value ), '"></span> ', esc_html( $this->value ), '</span>';
207
- }
208
- }
209
-
210
- class CMB2_Display_Checkbox extends CMB2_Field_Display {
211
- /**
212
- * Display multicheck value.
213
- *
214
- * @since 2.2.2
215
- */
216
- protected function _display() {
217
- echo $this->value === 'on' ? 'on' : 'off';
218
- }
219
- }
220
-
221
- class CMB2_Display_Select extends CMB2_Field_Display {
222
- /**
223
- * Display select value.
224
- *
225
- * @since 2.2.2
226
- */
227
- protected function _display() {
228
- $options = $this->field->options();
229
-
230
- $fallback = $this->field->args( 'show_option_none' );
231
- if ( ! $fallback && isset( $options[''] ) ) {
232
- $fallback = $options[''];
233
- }
234
- if ( ! $this->value && $fallback ) {
235
- echo $fallback;
236
- } elseif ( isset( $options[ $this->value ] ) ) {
237
- echo $options[ $this->value ];
238
- } else {
239
- echo esc_attr( $this->value );
240
- }
241
- }
242
- }
243
-
244
- class CMB2_Display_Multicheck extends CMB2_Field_Display {
245
- /**
246
- * Display multicheck value.
247
- *
248
- * @since 2.2.2
249
- */
250
- protected function _display() {
251
- if ( empty( $this->value ) || ! is_array( $this->value ) ) {
252
- return;
253
- }
254
-
255
- $options = $this->field->options();
256
-
257
- $output = array();
258
- foreach ( $this->value as $val ) {
259
- if ( isset( $options[ $val ] ) ) {
260
- $output[] = $options[ $val ];
261
- } else {
262
- $output[] = esc_attr( $val );
263
- }
264
- }
265
-
266
- echo implode( ', ', $output );
267
- }
268
- }
269
-
270
- class CMB2_Display_Textarea extends CMB2_Field_Display {
271
- /**
272
- * Display textarea value.
273
- *
274
- * @since 2.2.2
275
- */
276
- protected function _display() {
277
- echo wpautop( wp_kses_post( $this->value ) );
278
- }
279
- }
280
-
281
- class CMB2_Display_Textarea_Code extends CMB2_Field_Display {
282
- /**
283
- * Display textarea_code value.
284
- *
285
- * @since 2.2.2
286
- */
287
- protected function _display() {
288
- echo '<xmp class="cmb2-code">' . print_r( $this->value, true ) . '</xmp>';
289
- }
290
- }
291
-
292
- class CMB2_Display_Text_Time extends CMB2_Field_Display {
293
- /**
294
- * Display text_time value.
295
- *
296
- * @since 2.2.2
297
- */
298
- protected function _display() {
299
- echo $this->field->get_timestamp_format( 'time_format', $this->value );
300
- }
301
- }
302
-
303
- class CMB2_Display_Text_Date extends CMB2_Field_Display {
304
- /**
305
- * Display text_date value.
306
- *
307
- * @since 2.2.2
308
- */
309
- protected function _display() {
310
- echo $this->field->get_timestamp_format( 'date_format', $this->value );
311
- }
312
- }
313
-
314
- class CMB2_Display_Text_Date_Timezone extends CMB2_Field_Display {
315
- /**
316
- * Display text_datetime_timestamp_timezone value.
317
- *
318
- * @since 2.2.2
319
- */
320
- protected function _display() {
321
- $field = $this->field;
322
-
323
- if ( empty( $this->value ) ) {
324
- return;
325
- }
326
-
327
- $datetime = maybe_unserialize( $this->value );
328
- $this->value = $tzstring = '';
329
-
330
- if ( $datetime && $datetime instanceof DateTime ) {
331
- $tz = $datetime->getTimezone();
332
- $tzstring = $tz->getName();
333
- $this->value = $datetime->getTimestamp();
334
- }
335
-
336
- $date = $this->field->get_timestamp_format( 'date_format', $this->value );
337
- $time = $this->field->get_timestamp_format( 'time_format', $this->value );
338
-
339
- echo $date, ( $time ? ' ' . $time : '' ), ( $tzstring ? ', ' . $tzstring : '' );
340
- }
341
- }
342
-
343
- class CMB2_Display_Taxonomy_Radio extends CMB2_Field_Display {
344
- /**
345
- * Display single taxonomy value.
346
- *
347
- * @since 2.2.2
348
- */
349
- protected function _display() {
350
- $taxonomy = $this->field->args( 'taxonomy' );
351
- $types = new CMB2_Types( $this->field );
352
- $type = $types->get_new_render_type( $this->field->type(), 'CMB2_Type_Taxonomy_Radio' );
353
- $terms = $type->get_object_terms();
354
- $term = false;
355
-
356
- if ( is_wp_error( $terms ) || empty( $terms ) && ( $default = $this->field->get_default() ) ) {
357
- $term = get_term_by( 'slug', $default, $taxonomy );
358
- } elseif ( ! empty( $terms ) ) {
359
- $term = $terms[ key( $terms ) ];
360
- }
361
-
362
- if ( $term ) {
363
- $link = get_edit_term_link( $term->term_id, $taxonomy );
364
- echo '<a href="', esc_url( $link ), '">', esc_html( $term->name ), '</a>';
365
- }
366
- }
367
- }
368
-
369
- class CMB2_Display_Taxonomy_Multicheck extends CMB2_Field_Display {
370
- /**
371
- * Display taxonomy values.
372
- *
373
- * @since 2.2.2
374
- */
375
- protected function _display() {
376
- $taxonomy = $this->field->args( 'taxonomy' );
377
- $types = new CMB2_Types( $this->field );
378
- $type = $types->get_new_render_type( $this->field->type(), 'CMB2_Type_Taxonomy_Multicheck' );
379
- $terms = $type->get_object_terms();
380
-
381
- if ( is_wp_error( $terms ) || empty( $terms ) && ( $default = $this->field->get_default() ) ) {
382
- $terms = array();
383
- if ( is_array( $default ) ) {
384
- foreach ( $default as $slug ) {
385
- $terms[] = get_term_by( 'slug', $slug, $taxonomy );
386
- }
387
- } else {
388
- $terms[] = get_term_by( 'slug', $default, $taxonomy );
389
- }
390
- }
391
-
392
- if ( is_array( $terms ) ) {
393
-
394
- $links = array();
395
- foreach ( $terms as $term ) {
396
- $link = get_edit_term_link( $term->term_id, $taxonomy );
397
- $links[] = '<a href="' . esc_url( $link ) . '">' . esc_html( $term->name ) . '</a>';
398
- }
399
- // Then loop and output.
400
- echo '<div class="cmb2-taxonomy-terms-', esc_attr( sanitize_html_class( $taxonomy ) ), '">';
401
- echo implode( ', ', $links );
402
- echo '</div>';
403
- }
404
- }
405
- }
406
-
407
- class CMB2_Display_File extends CMB2_Field_Display {
408
- /**
409
- * Display file value.
410
- *
411
- * @since 2.2.2
412
- */
413
- protected function _display() {
414
- if ( empty( $this->value ) ) {
415
- return;
416
- }
417
-
418
- $this->value = esc_url_raw( $this->value );
419
-
420
- $types = new CMB2_Types( $this->field );
421
- $type = $types->get_new_render_type( $this->field->type(), 'CMB2_Type_File_Base' );
422
-
423
- $id = $this->field->get_field_clone( array(
424
- 'id' => $this->field->_id( '', false ) . '_id',
425
- ) )->escaped_value( 'absint' );
426
-
427
- $this->file_output( $this->value, $id, $type );
428
- }
429
-
430
- protected function file_output( $url_value, $id, CMB2_Type_File_Base $field_type ) {
431
- // If there is no ID saved yet, try to get it from the url.
432
- if ( $url_value && ! $id ) {
433
- $id = CMB2_Utils::image_id_from_url( esc_url_raw( $url_value ) );
434
- }
435
-
436
- if ( $field_type->is_valid_img_ext( $url_value ) ) {
437
- $img_size = $this->field->args( 'preview_size' );
438
-
439
- if ( $id ) {
440
- $image = wp_get_attachment_image( $id, $img_size, null, array(
441
- 'class' => 'cmb-image-display',
442
- ) );
443
- } else {
444
- $size = is_array( $img_size ) ? $img_size[0] : 200;
445
- $image = '<img class="cmb-image-display" style="max-width: ' . absint( $size ) . 'px; width: 100%; height: auto;" src="' . esc_url( $url_value ) . '" alt="" />';
446
- }
447
-
448
- echo $image;
449
-
450
- } else {
451
-
452
- printf( '<div class="file-status"><span>%1$s <strong><a href="%2$s">%3$s</a></strong></span></div>',
453
- esc_html( $field_type->_text( 'file_text', __( 'File:', 'cmb2' ) ) ),
454
- esc_url( $url_value ),
455
- esc_html( CMB2_Utils::get_file_name_from_path( $url_value ) )
456
- );
457
-
458
- }
459
- }
460
- }
461
-
462
- class CMB2_Display_File_List extends CMB2_Display_File {
463
- /**
464
- * Display file_list value.
465
- *
466
- * @since 2.2.2
467
- */
468
- protected function _display() {
469
- if ( empty( $this->value ) || ! is_array( $this->value ) ) {
470
- return;
471
- }
472
-
473
- $types = new CMB2_Types( $this->field );
474
- $type = $types->get_new_render_type( $this->field->type(), 'CMB2_Type_File_Base' );
475
-
476
- echo '<ul class="cmb2-display-file-list">';
477
- foreach ( $this->value as $id => $fullurl ) {
478
- echo '<li>', $this->file_output( esc_url_raw( $fullurl ), $id, $type ), '</li>';
479
- }
480
- echo '</ul>';
481
- }
482
- }
483
-
484
- class CMB2_Display_oEmbed extends CMB2_Field_Display {
485
- /**
486
- * Display oembed value.
487
- *
488
- * @since 2.2.2
489
- */
490
- protected function _display() {
491
- if ( ! $this->value ) {
492
- return;
493
- }
494
-
495
- cmb2_do_oembed( array(
496
- 'url' => $this->value,
497
- 'object_id' => $this->field->object_id,
498
- 'object_type' => $this->field->object_type,
499
- 'oembed_args' => array(
500
- 'width' => '300',
501
- ),
502
- 'field_id' => $this->field->id(),
503
- ) );
504
- }
505
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/CMB2_Hookup_Base.php DELETED
@@ -1,105 +0,0 @@
1
- <?php
2
- /**
3
- * Base class for hooking CMB2 into WordPress.
4
- *
5
- * @since 2.2.0
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- *
13
- * @property-read string $object_type
14
- * @property-read CMB2 $cmb
15
- */
16
- abstract class CMB2_Hookup_Base {
17
-
18
- /**
19
- * CMB2 object.
20
- *
21
- * @var CMB2 object
22
- * @since 2.0.2
23
- */
24
- protected $cmb;
25
-
26
- /**
27
- * The object type we are performing the hookup for
28
- *
29
- * @var string
30
- * @since 2.0.9
31
- */
32
- protected $object_type = 'post';
33
-
34
- /**
35
- * A functionalized constructor, used for the hookup action callbacks.
36
- *
37
- * @since 2.2.6
38
- *
39
- * @throws Exception Failed implementation.
40
- *
41
- * @param CMB2 $cmb The CMB2 object to hookup.
42
- */
43
- public static function maybe_init_and_hookup( CMB2 $cmb ) {
44
- throw new Exception( sprintf( esc_html__( '%1$s should be implemented by the extended class.', 'cmb2' ), __FUNCTION__ ) );
45
- }
46
-
47
- /**
48
- * Constructor
49
- *
50
- * @since 2.0.0
51
- * @param CMB2 $cmb The CMB2 object to hookup.
52
- */
53
- public function __construct( CMB2 $cmb ) {
54
- $this->cmb = $cmb;
55
- $this->object_type = $this->cmb->mb_object_type();
56
- }
57
-
58
- abstract public function universal_hooks();
59
-
60
- /**
61
- * Ensures WordPress hook only gets fired once per object.
62
- *
63
- * @since 2.0.0
64
- * @param string $action The name of the filter to hook the $hook callback to.
65
- * @param callback $hook The callback to be run when the filter is applied.
66
- * @param integer $priority Order the functions are executed.
67
- * @param int $accepted_args The number of arguments the function accepts.
68
- */
69
- public function once( $action, $hook, $priority = 10, $accepted_args = 1 ) {
70
- static $hooks_completed = array();
71
-
72
- $args = func_get_args();
73
-
74
- // Get object hash.. This bypasses issues with serializing closures.
75
- if ( is_object( $hook ) ) {
76
- $args[1] = spl_object_hash( $args[1] );
77
- } elseif ( is_array( $hook ) && is_object( $hook[0] ) ) {
78
- $args[1][0] = spl_object_hash( $hook[0] );
79
- }
80
-
81
- $key = md5( serialize( $args ) );
82
-
83
- if ( ! isset( $hooks_completed[ $key ] ) ) {
84
- $hooks_completed[ $key ] = 1;
85
- add_filter( $action, $hook, $priority, $accepted_args );
86
- }
87
- }
88
-
89
- /**
90
- * Magic getter for our object.
91
- *
92
- * @param string $field Property to return.
93
- * @throws Exception Throws an exception if the field is invalid.
94
- * @return mixed
95
- */
96
- public function __get( $field ) {
97
- switch ( $field ) {
98
- case 'object_type':
99
- case 'cmb':
100
- return $this->{$field};
101
- default:
102
- throw new Exception( sprintf( esc_html__( 'Invalid %1$s property: %2$s', 'cmb2' ), __CLASS__, $field ) );
103
- }
104
- }
105
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/CMB2_JS.php DELETED
@@ -1,257 +0,0 @@
1
- <?php
2
- /**
3
- * Handles the dependencies and enqueueing of the CMB2 JS scripts
4
- *
5
- * @category WordPress_Plugin
6
- * @package CMB2
7
- * @author CMB2 team
8
- * @license GPL-2.0+
9
- * @link https://cmb2.io
10
- */
11
- class CMB2_JS {
12
-
13
- /**
14
- * The CMB2 JS handle
15
- *
16
- * @var string
17
- * @since 2.0.7
18
- */
19
- protected static $handle = 'cmb2-scripts';
20
-
21
- /**
22
- * The CMB2 JS variable name
23
- *
24
- * @var string
25
- * @since 2.0.7
26
- */
27
- protected static $js_variable = 'cmb2_l10';
28
-
29
- /**
30
- * Array of CMB2 JS dependencies
31
- *
32
- * @var array
33
- * @since 2.0.7
34
- */
35
- protected static $dependencies = array(
36
- 'jquery' => 'jquery',
37
- );
38
-
39
- /**
40
- * Array of CMB2 fields model data for JS.
41
- *
42
- * @var array
43
- * @since 2.4.0
44
- */
45
- protected static $fields = array();
46
-
47
- /**
48
- * Add a dependency to the array of CMB2 JS dependencies
49
- *
50
- * @since 2.0.7
51
- * @param array|string $dependencies Array (or string) of dependencies to add.
52
- */
53
- public static function add_dependencies( $dependencies ) {
54
- foreach ( (array) $dependencies as $dependency ) {
55
- self::$dependencies[ $dependency ] = $dependency;
56
- }
57
- }
58
-
59
- /**
60
- * Add field model data to the array for JS.
61
- *
62
- * @since 2.4.0
63
- *
64
- * @param CMB2_Field $field Field object.
65
- */
66
- public static function add_field_data( CMB2_Field $field ) {
67
- $hash = $field->hash_id();
68
- if ( ! isset( self::$fields[ $hash ] ) ) {
69
- self::$fields[ $hash ] = $field->js_data();
70
- }
71
- }
72
-
73
- /**
74
- * Enqueue the CMB2 JS
75
- *
76
- * @since 2.0.7
77
- */
78
- public static function enqueue() {
79
- // Filter required script dependencies.
80
- $dependencies = self::$dependencies = apply_filters( 'cmb2_script_dependencies', self::$dependencies );
81
-
82
- // Only use minified files if SCRIPT_DEBUG is off.
83
- $debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
84
-
85
- $min = $debug ? '' : '.min';
86
-
87
- // if colorpicker.
88
- if ( isset( $dependencies['wp-color-picker'] ) ) {
89
- if ( ! is_admin() ) {
90
- self::colorpicker_frontend();
91
- }
92
-
93
- // Enqueue colorpicker
94
- if ( ! wp_script_is( 'wp-color-picker', 'enqueued' ) ) {
95
- wp_enqueue_script( 'wp-color-picker' );
96
- }
97
-
98
- if ( isset( $dependencies['wp-color-picker-alpha'] ) ) {
99
- self::register_colorpicker_alpha();
100
- }
101
- }
102
-
103
- // if file/file_list.
104
- if ( isset( $dependencies['media-editor'] ) ) {
105
- wp_enqueue_media();
106
- CMB2_Type_File_Base::output_js_underscore_templates();
107
- }
108
-
109
- // if timepicker.
110
- if ( isset( $dependencies['jquery-ui-datetimepicker'] ) ) {
111
- self::register_datetimepicker();
112
- }
113
-
114
- // if cmb2-wysiwyg.
115
- $enqueue_wysiwyg = isset( $dependencies['cmb2-wysiwyg'] ) && $debug;
116
- unset( $dependencies['cmb2-wysiwyg'] );
117
-
118
- // if cmb2-char-counter.
119
- $enqueue_char_counter = isset( $dependencies['cmb2-char-counter'] ) && $debug;
120
- unset( $dependencies['cmb2-char-counter'] );
121
-
122
- // Enqueue cmb JS.
123
- wp_enqueue_script( self::$handle, CMB2_Utils::url( "js/cmb2{$min}.js" ), array_values( $dependencies ), CMB2_VERSION, true );
124
-
125
- // if SCRIPT_DEBUG, we need to enqueue separately.
126
- if ( $enqueue_wysiwyg ) {
127
- wp_enqueue_script( 'cmb2-wysiwyg', CMB2_Utils::url( 'js/cmb2-wysiwyg.js' ), array( 'jquery', 'wp-util' ), CMB2_VERSION );
128
- }
129
- if ( $enqueue_char_counter ) {
130
- wp_enqueue_script( 'cmb2-char-counter', CMB2_Utils::url( 'js/cmb2-char-counter.js' ), array( 'jquery', 'wp-util' ), CMB2_VERSION );
131
- }
132
-
133
- self::localize( $debug );
134
-
135
- do_action( 'cmb2_footer_enqueue' );
136
- }
137
-
138
- /**
139
- * Register or enqueue the wp-color-picker-alpha script.
140
- *
141
- * @since 2.2.7
142
- *
143
- * @param boolean $enqueue Whether or not to enqueue.
144
- *
145
- * @return void
146
- */
147
- public static function register_colorpicker_alpha( $enqueue = false ) {
148
- // Only use minified files if SCRIPT_DEBUG is off.
149
- $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
150
- $func = $enqueue ? 'wp_enqueue_script' : 'wp_register_script';
151
- $func( 'wp-color-picker-alpha', CMB2_Utils::url( "js/wp-color-picker-alpha{$min}.js" ), array( 'wp-color-picker' ), '2.1.4' );
152
- }
153
-
154
- /**
155
- * Register or enqueue the jquery-ui-datetimepicker script.
156
- *
157
- * @since 2.2.7
158
- *
159
- * @param boolean $enqueue Whether or not to enqueue.
160
- *
161
- * @return void
162
- */
163
- public static function register_datetimepicker( $enqueue = false ) {
164
- $func = $enqueue ? 'wp_enqueue_script' : 'wp_register_script';
165
- $func( 'jquery-ui-datetimepicker', CMB2_Utils::url( 'js/jquery-ui-timepicker-addon.min.js' ), array( 'jquery-ui-slider' ), '1.5.0' );
166
- }
167
-
168
- /**
169
- * We need to register colorpicker on the front-end
170
- *
171
- * @since 2.0.7
172
- */
173
- protected static function colorpicker_frontend() {
174
- wp_register_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), CMB2_VERSION );
175
- wp_register_script( 'wp-color-picker', admin_url( 'js/color-picker.min.js' ), array( 'iris' ), CMB2_VERSION );
176
- wp_localize_script( 'wp-color-picker', 'wpColorPickerL10n', array(
177
- 'clear' => esc_html__( 'Clear', 'cmb2' ),
178
- 'defaultString' => esc_html__( 'Default', 'cmb2' ),
179
- 'pick' => esc_html__( 'Select Color', 'cmb2' ),
180
- 'current' => esc_html__( 'Current Color', 'cmb2' ),
181
- ) );
182
- }
183
-
184
- /**
185
- * Localize the php variables for CMB2 JS
186
- *
187
- * @since 2.0.7
188
- *
189
- * @param mixed $debug Whether or not we are debugging.
190
- */
191
- protected static function localize( $debug ) {
192
- static $localized = false;
193
- if ( $localized ) {
194
- return;
195
- }
196
-
197
- $localized = true;
198
- $l10n = array(
199
- 'fields' => self::$fields,
200
- 'ajax_nonce' => wp_create_nonce( 'ajax_nonce' ),
201
- 'ajaxurl' => admin_url( '/admin-ajax.php' ),
202
- 'script_debug' => $debug,
203
- 'up_arrow_class' => 'dashicons dashicons-arrow-up-alt2',
204
- 'down_arrow_class' => 'dashicons dashicons-arrow-down-alt2',
205
- 'user_can_richedit' => user_can_richedit(),
206
- 'defaults' => array(
207
- 'code_editor' => false,
208
- 'color_picker' => false,
209
- 'date_picker' => array(
210
- 'changeMonth' => true,
211
- 'changeYear' => true,
212
- 'dateFormat' => _x( 'mm/dd/yy', 'Valid formatDate string for jquery-ui datepicker', 'cmb2' ),
213
- 'dayNames' => explode( ',', esc_html__( 'Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday', 'cmb2' ) ),
214
- 'dayNamesMin' => explode( ',', esc_html__( 'Su, Mo, Tu, We, Th, Fr, Sa', 'cmb2' ) ),
215
- 'dayNamesShort' => explode( ',', esc_html__( 'Sun, Mon, Tue, Wed, Thu, Fri, Sat', 'cmb2' ) ),
216
- 'monthNames' => explode( ',', esc_html__( 'January, February, March, April, May, June, July, August, September, October, November, December', 'cmb2' ) ),
217
- 'monthNamesShort' => explode( ',', esc_html__( 'Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec', 'cmb2' ) ),
218
- 'nextText' => esc_html__( 'Next', 'cmb2' ),
219
- 'prevText' => esc_html__( 'Prev', 'cmb2' ),
220
- 'currentText' => esc_html__( 'Today', 'cmb2' ),
221
- 'closeText' => esc_html__( 'Done', 'cmb2' ),
222
- 'clearText' => esc_html__( 'Clear', 'cmb2' ),
223
- ),
224
- 'time_picker' => array(
225
- 'timeOnlyTitle' => esc_html__( 'Choose Time', 'cmb2' ),
226
- 'timeText' => esc_html__( 'Time', 'cmb2' ),
227
- 'hourText' => esc_html__( 'Hour', 'cmb2' ),
228
- 'minuteText' => esc_html__( 'Minute', 'cmb2' ),
229
- 'secondText' => esc_html__( 'Second', 'cmb2' ),
230
- 'currentText' => esc_html__( 'Now', 'cmb2' ),
231
- 'closeText' => esc_html__( 'Done', 'cmb2' ),
232
- 'timeFormat' => _x( 'hh:mm TT', 'Valid formatting string, as per http://trentrichardson.com/examples/timepicker/', 'cmb2' ),
233
- 'controlType' => 'select',
234
- 'stepMinute' => 5,
235
- ),
236
- ),
237
- 'strings' => array(
238
- 'upload_file' => esc_html__( 'Use this file', 'cmb2' ),
239
- 'upload_files' => esc_html__( 'Use these files', 'cmb2' ),
240
- 'remove_image' => esc_html__( 'Remove Image', 'cmb2' ),
241
- 'remove_file' => esc_html__( 'Remove', 'cmb2' ),
242
- 'file' => esc_html__( 'File:', 'cmb2' ),
243
- 'download' => esc_html__( 'Download', 'cmb2' ),
244
- 'check_toggle' => esc_html__( 'Select / Deselect All', 'cmb2' ),
245
- ),
246
- );
247
-
248
- if ( isset( self::$dependencies['code-editor'] ) && function_exists( 'wp_enqueue_code_editor' ) ) {
249
- $l10n['defaults']['code_editor'] = wp_enqueue_code_editor( array(
250
- 'type' => 'text/html',
251
- ) );
252
- }
253
-
254
- wp_localize_script( self::$handle, self::$js_variable, apply_filters( 'cmb2_localized_data', $l10n ) );
255
- }
256
-
257
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/CMB2_Options.php DELETED
@@ -1,250 +0,0 @@
1
- <?php
2
- /**
3
- * CMB2 Utility classes for handling multi-dimensional array data for options
4
- *
5
- * @category WordPress_Plugin
6
- * @package CMB2
7
- * @author CMB2 team
8
- * @license GPL-2.0+
9
- * @link https://cmb2.io
10
- */
11
-
12
- /**
13
- * Retrieves an instance of CMB2_Option based on the option key
14
- *
15
- * @package CMB2
16
- * @author CMB2 team
17
- */
18
- class CMB2_Options {
19
- /**
20
- * Array of all CMB2_Option instances
21
- *
22
- * @var array
23
- * @since 1.0.0
24
- */
25
- protected static $option_sets = array();
26
-
27
- public static function get( $option_key ) {
28
-
29
- if ( empty( self::$option_sets ) || empty( self::$option_sets[ $option_key ] ) ) {
30
- self::$option_sets[ $option_key ] = new CMB2_Option( $option_key );
31
- }
32
-
33
- return self::$option_sets[ $option_key ];
34
- }
35
- }
36
-
37
- /**
38
- * Handles getting/setting of values to an option array
39
- * for a specific option key
40
- *
41
- * @package CMB2
42
- * @author CMB2 team
43
- */
44
- class CMB2_Option {
45
-
46
- /**
47
- * Options array
48
- *
49
- * @var array
50
- */
51
- protected $options = array();
52
-
53
- /**
54
- * Current option key
55
- *
56
- * @var string
57
- */
58
- protected $key = '';
59
-
60
- /**
61
- * Initiate option object
62
- *
63
- * @param string $option_key Option key where data will be saved.
64
- * Leave empty for temporary data store.
65
- * @since 2.0.0
66
- */
67
- public function __construct( $option_key = '' ) {
68
- $this->key = ! empty( $option_key ) ? $option_key : '';
69
- }
70
-
71
- /**
72
- * Delete the option from the db
73
- *
74
- * @since 2.0.0
75
- * @return mixed Delete success or failure
76
- */
77
- public function delete_option() {
78
- $deleted = $this->key ? delete_option( $this->key ) : true;
79
- $this->options = $deleted ? array() : $this->options;
80
- return $this->options;
81
- }
82
-
83
- /**
84
- * Removes an option from an option array
85
- *
86
- * @since 1.0.1
87
- * @param string $field_id Option array field key.
88
- * @param bool $resave Whether or not to resave.
89
- * @return array Modified options
90
- */
91
- public function remove( $field_id, $resave = false ) {
92
-
93
- $this->get_options();
94
-
95
- if ( isset( $this->options[ $field_id ] ) ) {
96
- unset( $this->options[ $field_id ] );
97
- }
98
-
99
- if ( $resave ) {
100
- $this->set();
101
- }
102
-
103
- return $this->options;
104
- }
105
-
106
- /**
107
- * Retrieves an option from an option array
108
- *
109
- * @since 1.0.1
110
- * @param string $field_id Option array field key.
111
- * @param mixed $default Fallback value for the option.
112
- * @return array Requested field or default
113
- */
114
- public function get( $field_id, $default = false ) {
115
- $opts = $this->get_options();
116
-
117
- if ( 'all' == $field_id ) {
118
- return $opts;
119
- } elseif ( array_key_exists( $field_id, $opts ) ) {
120
- return false !== $opts[ $field_id ] ? $opts[ $field_id ] : $default;
121
- }
122
-
123
- return $default;
124
- }
125
-
126
- /**
127
- * Updates Option data
128
- *
129
- * @since 1.0.1
130
- * @param string $field_id Option array field key.
131
- * @param mixed $value Value to update data with.
132
- * @param bool $resave Whether to re-save the data.
133
- * @param bool $single Whether data should not be an array.
134
- * @return boolean Return status of update.
135
- */
136
- public function update( $field_id, $value = '', $resave = false, $single = true ) {
137
- $this->get_options();
138
-
139
- if ( true !== $field_id ) {
140
-
141
- if ( ! $single ) {
142
- // If multiple, add to array.
143
- $this->options[ $field_id ][] = $value;
144
- } else {
145
- $this->options[ $field_id ] = $value;
146
- }
147
- }
148
-
149
- if ( $resave || true === $field_id ) {
150
- return $this->set();
151
- }
152
-
153
- return true;
154
- }
155
-
156
- /**
157
- * Saves the option array
158
- * Needs to be run after finished using remove/update_option
159
- *
160
- * @uses apply_filters() Calls 'cmb2_override_option_save_{$this->key}' hook
161
- * to allow overwriting the option value to be stored.
162
- *
163
- * @since 1.0.1
164
- * @param array $options Optional options to override.
165
- * @return bool Success/Failure
166
- */
167
- public function set( $options = array() ) {
168
- if ( ! empty( $options ) || empty( $options ) && empty( $this->key ) ) {
169
- $this->options = $options;
170
- }
171
-
172
- $this->options = wp_unslash( $this->options ); // get rid of those evil magic quotes.
173
-
174
- if ( empty( $this->key ) ) {
175
- return false;
176
- }
177
-
178
- $test_save = apply_filters( "cmb2_override_option_save_{$this->key}", 'cmb2_no_override_option_save', $this->options, $this );
179
-
180
- if ( 'cmb2_no_override_option_save' !== $test_save ) {
181
- // If override, do not proceed to update the option, just return result.
182
- return $test_save;
183
- }
184
-
185
- /**
186
- * Whether to auto-load the option when WordPress starts up.
187
- *
188
- * The dynamic portion of the hook name, $this->key, refers to the option key.
189
- *
190
- * @since 2.4.0
191
- *
192
- * @param bool $autoload Whether to load the option when WordPress starts up.
193
- * @param CMB2_Option $cmb_option This object.
194
- */
195
- $autoload = apply_filters( "cmb2_should_autoload_{$this->key}", true, $this );
196
-
197
- return update_option(
198
- $this->key,
199
- $this->options,
200
- ! $autoload || 'no' === $autoload ? false : true
201
- );
202
- }
203
-
204
- /**
205
- * Retrieve option value based on name of option.
206
- *
207
- * @uses apply_filters() Calls 'cmb2_override_option_get_{$this->key}' hook to allow
208
- * overwriting the option value to be retrieved.
209
- *
210
- * @since 1.0.1
211
- * @param mixed $default Optional. Default value to return if the option does not exist.
212
- * @return mixed Value set for the option.
213
- */
214
- public function get_options( $default = null ) {
215
- if ( empty( $this->options ) && ! empty( $this->key ) ) {
216
-
217
- $test_get = apply_filters( "cmb2_override_option_get_{$this->key}", 'cmb2_no_override_option_get', $default, $this );
218
-
219
- if ( 'cmb2_no_override_option_get' !== $test_get ) {
220
- $this->options = $test_get;
221
- } else {
222
- // If no override, get the option.
223
- $this->options = get_option( $this->key, $default );
224
- }
225
- }
226
-
227
- $this->options = (array) $this->options;
228
-
229
- return $this->options;
230
- }
231
-
232
- /**
233
- * Magic getter for our object.
234
- *
235
- * @since 2.6.0
236
- *
237
- * @param string $field Requested property.
238
- * @throws Exception Throws an exception if the field is invalid.
239
- * @return mixed
240
- */
241
- public function __get( $field ) {
242
- switch ( $field ) {
243
- case 'options':
244
- case 'key':
245
- return $this->{$field};
246
- default:
247
- throw new Exception( sprintf( esc_html__( 'Invalid %1$s property: %2$s', 'cmb2' ), __CLASS__, $field ) );
248
- }
249
- }
250
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/CMB2_Options_Hookup.php DELETED
@@ -1,372 +0,0 @@
1
- <?php
2
- /**
3
- * Handles hooking CMB2 forms/metaboxes into the post/attachement/user screens
4
- * and handles hooking in and saving those fields.
5
- *
6
- * @since 2.0.0
7
- *
8
- * @category WordPress_Plugin
9
- * @package CMB2
10
- * @author CMB2 team
11
- * @license GPL-2.0+
12
- * @link https://cmb2.io
13
- */
14
- class CMB2_Options_Hookup extends CMB2_Hookup {
15
-
16
- /**
17
- * The object type we are performing the hookup for
18
- *
19
- * @var string
20
- * @since 2.0.9
21
- */
22
- protected $object_type = 'options-page';
23
-
24
- /**
25
- * Options page key.
26
- *
27
- * @var string
28
- * @since 2.2.5
29
- */
30
- protected $option_key = '';
31
-
32
- /**
33
- * Constructor
34
- *
35
- * @since 2.0.0
36
- * @param CMB2 $cmb The CMB2 object to hookup.
37
- * @param string $option_key Option key to use.
38
- */
39
- public function __construct( CMB2 $cmb, $option_key ) {
40
- $this->cmb = $cmb;
41
- $this->option_key = $option_key;
42
- }
43
-
44
- public function hooks() {
45
- if ( empty( $this->option_key ) ) {
46
- return;
47
- }
48
-
49
- if ( ! $this->cmb->prop( 'autoload', true ) ) {
50
- // Disable option autoload if requested.
51
- add_filter( "cmb2_should_autoload_{$this->option_key}", '__return_false' );
52
- }
53
-
54
- /**
55
- * For WP < 4.7. Ensure the register_setting function exists.
56
- */
57
- if ( ! CMB2_Utils::wp_at_least( '4.7' ) && ! function_exists( 'register_setting' ) ) {
58
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
59
- }
60
-
61
- // Register setting to cmb2 group.
62
- register_setting( 'cmb2', $this->option_key );
63
-
64
- // Handle saving the data.
65
- add_action( 'admin_post_' . $this->option_key, array( $this, 'save_options' ) );
66
-
67
- // Optionally network_admin_menu.
68
- $hook = $this->cmb->prop( 'admin_menu_hook' );
69
-
70
- // Hook in to add our menu.
71
- add_action( $hook, array( $this, 'options_page_menu_hooks' ), $this->get_priority() );
72
-
73
- // If in the network admin, need to use get/update_site_option.
74
- if ( 'network_admin_menu' === $hook ) {
75
- // Override CMB's getter.
76
- add_filter( "cmb2_override_option_get_{$this->option_key}", array( $this, 'network_get_override' ), 10, 2 );
77
- // Override CMB's setter.
78
- add_filter( "cmb2_override_option_save_{$this->option_key}", array( $this, 'network_update_override' ), 10, 2 );
79
- }
80
- }
81
-
82
- /**
83
- * Hook up our admin menu item and admin page.
84
- *
85
- * @since 2.2.5
86
- *
87
- * @return void
88
- */
89
- public function options_page_menu_hooks() {
90
- $parent_slug = $this->cmb->prop( 'parent_slug' );
91
- $title = $this->cmb->prop( 'title' );
92
- $menu_title = $this->cmb->prop( 'menu_title', $title );
93
- $capability = $this->cmb->prop( 'capability' );
94
- $callback = array( $this, 'options_page_output' );
95
-
96
- if ( $parent_slug ) {
97
- $page_hook = add_submenu_page(
98
- $parent_slug,
99
- $title,
100
- $menu_title,
101
- $capability,
102
- $this->option_key,
103
- $callback
104
- );
105
- } else {
106
- $page_hook = add_menu_page(
107
- $title,
108
- $menu_title,
109
- $capability,
110
- $this->option_key,
111
- $callback,
112
- $this->cmb->prop( 'icon_url' ),
113
- $this->cmb->prop( 'position' )
114
- );
115
- }
116
-
117
- if ( $this->cmb->prop( 'cmb_styles' ) ) {
118
- // Include CMB CSS in the head to avoid FOUC.
119
- add_action( "admin_print_styles-{$page_hook}", array( 'CMB2_Hookup', 'enqueue_cmb_css' ) );
120
- }
121
-
122
- $this->maybe_register_message();
123
- }
124
-
125
- /**
126
- * If there is a message callback, let it determine how to register the message,
127
- * else add a settings message if on this settings page.
128
- *
129
- * @since 2.2.6
130
- *
131
- * @return void
132
- */
133
- public function maybe_register_message() {
134
- $is_options_page = self::is_page( $this->option_key );
135
- $should_notify = ! $this->cmb->prop( 'disable_settings_errors' ) && isset( $_GET['settings-updated'] ) && $is_options_page;
136
- $is_updated = $should_notify && 'true' === $_GET['settings-updated'];
137
- $setting = "{$this->option_key}-notices";
138
- $code = '';
139
- $message = __( 'Nothing to update.', 'cmb2' );
140
- $type = 'notice-warning';
141
-
142
- if ( $is_updated ) {
143
- $message = __( 'Settings updated.', 'cmb2' );
144
- $type = 'updated';
145
- }
146
-
147
- // Check if parameter has registered a callback.
148
- if ( $cb = $this->cmb->maybe_callback( 'message_cb' ) ) {
149
-
150
- /**
151
- * The 'message_cb' callback will receive the following parameters.
152
- * Unless there are other reasons for notifications, the callback should only
153
- * `add_settings_error()` if `$args['should_notify']` is truthy.
154
- *
155
- * @param CMB2 $cmb The CMB2 object.
156
- * @param array $args {
157
- * An array of message arguments
158
- *
159
- * @type bool $is_options_page Whether current page is this options page.
160
- * @type bool $should_notify Whether options were saved and we should be notified.
161
- * @type bool $is_updated Whether options were updated with save (or stayed the same).
162
- * @type string $setting For add_settings_error(), Slug title of the setting to which
163
- * this error applies.
164
- * @type string $code For add_settings_error(), Slug-name to identify the error.
165
- * Used as part of 'id' attribute in HTML output.
166
- * @type string $message For add_settings_error(), The formatted message text to display
167
- * to the user (will be shown inside styled `<div>` and `<p>` tags).
168
- * Will be 'Settings updated.' if $is_updated is true, else 'Nothing to update.'
169
- * @type string $type For add_settings_error(), Message type, controls HTML class.
170
- * Accepts 'error', 'updated', '', 'notice-warning', etc.
171
- * Will be 'updated' if $is_updated is true, else 'notice-warning'.
172
- * }
173
- */
174
- $args = compact( 'is_options_page', 'should_notify', 'is_updated', 'setting', 'code', 'message', 'type' );
175
-
176
- $this->cmb->do_callback( $cb, $args );
177
-
178
- } elseif ( $should_notify ) {
179
-
180
- add_settings_error( $setting, $code, $message, $type );
181
- }
182
- }
183
-
184
- /**
185
- * Display options-page output. To override, set 'display_cb' box property.
186
- *
187
- * @since 2.2.5
188
- */
189
- public function options_page_output() {
190
- $this->maybe_output_settings_notices();
191
-
192
- $callback = $this->cmb->prop( 'display_cb' );
193
- if ( is_callable( $callback ) ) {
194
- return call_user_func( $callback, $this );
195
- }
196
-
197
- ?>
198
- <div class="wrap cmb2-options-page option-<?php echo esc_attr( sanitize_html_class( $this->option_key ) ); ?>">
199
- <?php if ( $this->cmb->prop( 'title' ) ) : ?>
200
- <h2><?php echo wp_kses_post( $this->cmb->prop( 'title' ) ); ?></h2>
201
- <?php endif; ?>
202
- <?php $this->options_page_tab_nav_output(); ?>
203
- <form class="cmb-form" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" method="POST" id="<?php echo $this->cmb->cmb_id; ?>" enctype="multipart/form-data" encoding="multipart/form-data">
204
- <input type="hidden" name="action" value="<?php echo esc_attr( $this->option_key ); ?>">
205
- <?php $this->options_page_metabox(); ?>
206
- <?php submit_button( esc_attr( $this->cmb->prop( 'save_button' ) ), 'primary', 'submit-cmb' ); ?>
207
- </form>
208
- </div>
209
- <?php
210
- }
211
-
212
- /**
213
- * Display options-page Tab Navigation output.
214
- *
215
- * @since 2.9.0
216
- */
217
- public function options_page_tab_nav_output() {
218
- $tabs = $this->get_tab_group_tabs();
219
- if ( empty( $tabs ) ) {
220
- return;
221
- }
222
- ?>
223
- <h2 class="nav-tab-wrapper">
224
- <?php foreach ( $tabs as $option_key => $tab_title ) : ?>
225
- <a class="nav-tab<?php if ( self::is_page( $option_key ) ) : ?> nav-tab-active<?php endif; ?>" href="<?php menu_page_url( $option_key ); ?>"><?php echo wp_kses_post( $tab_title ); ?></a>
226
- <?php endforeach; ?>
227
- </h2>
228
- <?php
229
- }
230
-
231
- /**
232
- * Outputs the settings notices if a) not a sub-page of 'options-general.php'
233
- * (because settings_errors() already called in wp-admin/options-head.php),
234
- * and b) the 'disable_settings_errors' prop is not set or truthy.
235
- *
236
- * @since 2.2.5
237
- * @return void
238
- */
239
- public function maybe_output_settings_notices() {
240
- global $parent_file;
241
-
242
- // The settings sub-pages will already have settings_errors() called in wp-admin/options-head.php.
243
- if ( 'options-general.php' !== $parent_file ) {
244
- settings_errors( "{$this->option_key}-notices" );
245
- }
246
- }
247
-
248
- /**
249
- * Gets navigation tabs array for CMB2 options pages which share the
250
- * same tab_group property.
251
- *
252
- * @since 2.4.0
253
- * @return array Array of tab information ($option_key => $tab_title)
254
- */
255
- public function get_tab_group_tabs() {
256
- $tab_group = $this->cmb->prop( 'tab_group' );
257
- $tabs = array();
258
-
259
- if ( $tab_group ) {
260
- $boxes = CMB2_Boxes::get_by( 'tab_group', $tab_group );
261
-
262
- foreach ( $boxes as $cmb_id => $cmb ) {
263
- $option_key = $cmb->options_page_keys();
264
-
265
- // Must have an option key, must be an options page box.
266
- if ( ! isset( $option_key[0] ) || 'options-page' !== $cmb->mb_object_type() ) {
267
- continue;
268
- }
269
-
270
- $tabs[ $option_key[0] ] = $cmb->prop( 'tab_title', $cmb->prop( 'title' ) );
271
- }
272
- }
273
-
274
- return apply_filters( 'cmb2_tab_group_tabs', $tabs, $tab_group );
275
- }
276
-
277
- /**
278
- * Display metaboxes for an options-page object.
279
- *
280
- * @since 2.2.5
281
- */
282
- public function options_page_metabox() {
283
- $this->show_form_for_type( 'options-page' );
284
- }
285
-
286
- /**
287
- * Save data from options page, then redirects back.
288
- *
289
- * @since 2.2.5
290
- * @return void
291
- */
292
- public function save_options() {
293
- $url = wp_get_referer();
294
- if ( ! $url ) {
295
- $url = admin_url();
296
- }
297
-
298
- if (
299
- $this->can_save( 'options-page' )
300
- // check params.
301
- && isset( $_POST['submit-cmb'], $_POST['action'] )
302
- && $this->option_key === $_POST['action']
303
- ) {
304
-
305
- $updated = $this->cmb
306
- ->save_fields( $this->option_key, $this->cmb->object_type(), $_POST )
307
- ->was_updated(); // Will be false if no values were changed/updated.
308
-
309
- $url = add_query_arg( 'settings-updated', $updated ? 'true' : 'false', $url );
310
- }
311
-
312
- wp_safe_redirect( esc_url_raw( $url ), 303 /* WP_Http::SEE_OTHER */ );
313
- exit;
314
- }
315
-
316
- /**
317
- * Replaces get_option with get_site_option.
318
- *
319
- * @since 2.2.5
320
- *
321
- * @param mixed $test Not used.
322
- * @param mixed $default Default value to use.
323
- * @return mixed Value set for the network option.
324
- */
325
- public function network_get_override( $test, $default = false ) {
326
- return get_site_option( $this->option_key, $default );
327
- }
328
-
329
- /**
330
- * Replaces update_option with update_site_option.
331
- *
332
- * @since 2.2.5
333
- *
334
- * @param mixed $test Not used.
335
- * @param mixed $option_value Value to use.
336
- * @return bool Success/Failure
337
- */
338
- public function network_update_override( $test, $option_value ) {
339
- return update_site_option( $this->option_key, $option_value );
340
- }
341
-
342
- /**
343
- * Determines if given page slug matches the 'page' GET query variable.
344
- *
345
- * @since 2.4.0
346
- *
347
- * @param string $page Page slug.
348
- * @return boolean
349
- */
350
- public static function is_page( $page ) {
351
- return isset( $_GET['page'] ) && $page === $_GET['page'];
352
- }
353
-
354
- /**
355
- * Magic getter for our object.
356
- *
357
- * @param string $field Property to retrieve.
358
- *
359
- * @throws Exception Throws an exception if the field is invalid.
360
- * @return mixed
361
- */
362
- public function __get( $field ) {
363
- switch ( $field ) {
364
- case 'object_type':
365
- case 'option_key':
366
- case 'cmb':
367
- return $this->{$field};
368
- default:
369
- throw new Exception( sprintf( esc_html__( 'Invalid %1$s property: %2$s', 'cmb2' ), __CLASS__, $field ) );
370
- }
371
- }
372
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/CMB2_Sanitize.php DELETED
@@ -1,588 +0,0 @@
1
- <?php
2
- /**
3
- * CMB2 field sanitization
4
- *
5
- * @since 0.0.4
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- *
13
- * @method string _id()
14
- */
15
- class CMB2_Sanitize {
16
-
17
- /**
18
- * A CMB field object
19
- *
20
- * @var CMB2_Field object
21
- */
22
- public $field;
23
-
24
- /**
25
- * Field's value
26
- *
27
- * @var mixed
28
- */
29
- public $value;
30
-
31
- /**
32
- * Setup our class vars
33
- *
34
- * @since 1.1.0
35
- * @param CMB2_Field $field A CMB2 field object.
36
- * @param mixed $value Field value.
37
- */
38
- public function __construct( CMB2_Field $field, $value ) {
39
- $this->field = $field;
40
- $this->value = $value;
41
- }
42
-
43
- /**
44
- * Catchall method if field's 'sanitization_cb' is NOT defined,
45
- * or field type does not have a corresponding validation method.
46
- *
47
- * @since 1.0.0
48
- *
49
- * @param string $name Non-existent method name.
50
- * @param array $arguments All arguments passed to the method.
51
- * @return mixed
52
- */
53
- public function __call( $name, $arguments ) {
54
- return $this->default_sanitization();
55
- }
56
-
57
- /**
58
- * Default fallback sanitization method. Applies filters.
59
- *
60
- * @since 1.0.2
61
- */
62
- public function default_sanitization() {
63
- $field_type = $this->field->type();
64
-
65
- /**
66
- * This exists for back-compatibility, but validation
67
- * is not what happens here.
68
- *
69
- * @deprecated See documentation for "cmb2_sanitize_{$field_type}".
70
- */
71
- if ( function_exists( 'apply_filters_deprecated' ) ) {
72
- $override_value = apply_filters_deprecated( "cmb2_validate_{$field_type}", array( null, $this->value, $this->field->object_id, $this->field->args(), $this ), '2.0.0', "cmb2_sanitize_{$field_type}" );
73
- } else {
74
- $override_value = apply_filters( "cmb2_validate_{$field_type}", null, $this->value, $this->field->object_id, $this->field->args(), $this );
75
- }
76
-
77
- if ( null !== $override_value ) {
78
- return $override_value;
79
- }
80
-
81
- $sanitized_value = '';
82
- switch ( $field_type ) {
83
- case 'wysiwyg':
84
- case 'textarea_small':
85
- case 'oembed':
86
- $sanitized_value = $this->textarea();
87
- break;
88
- case 'taxonomy_select':
89
- case 'taxonomy_select_hierarchical':
90
- case 'taxonomy_radio':
91
- case 'taxonomy_radio_inline':
92
- case 'taxonomy_radio_hierarchical':
93
- case 'taxonomy_multicheck':
94
- case 'taxonomy_multicheck_hierarchical':
95
- case 'taxonomy_multicheck_inline':
96
- $sanitized_value = $this->taxonomy();
97
- break;
98
- case 'multicheck':
99
- case 'multicheck_inline':
100
- case 'file_list':
101
- case 'group':
102
- // no filtering
103
- $sanitized_value = $this->value;
104
- break;
105
- default:
106
- // Handle repeatable fields array
107
- // We'll fallback to 'sanitize_text_field'
108
- $sanitized_value = $this->_default_sanitization();
109
- break;
110
- }
111
-
112
- return $this->_is_empty_array( $sanitized_value ) ? '' : $sanitized_value;
113
- }
114
-
115
- /**
116
- * Default sanitization method, sanitize_text_field. Checks if value is array.
117
- *
118
- * @since 2.2.4
119
- * @return mixed Sanitized value.
120
- */
121
- protected function _default_sanitization() {
122
- // Handle repeatable fields array.
123
- return is_array( $this->value ) ? array_map( 'sanitize_text_field', $this->value ) : sanitize_text_field( $this->value );
124
- }
125
-
126
- /**
127
- * Sets the object terms to the object (if not options-page) and optionally returns the sanitized term values.
128
- *
129
- * @since 2.2.4
130
- * @return mixed Blank value, or sanitized term values if "cmb2_return_taxonomy_values_{$cmb_id}" is true.
131
- */
132
- public function taxonomy() {
133
- $sanitized_value = '';
134
-
135
- if ( ! $this->field->args( 'taxonomy' ) ) {
136
- CMB2_Utils::log_if_debug( __METHOD__, __LINE__, "{$this->field->type()} {$this->field->_id( '', false )} is missing the 'taxonomy' parameter." );
137
- } else {
138
-
139
- if ( in_array( $this->field->object_type, array( 'options-page', 'term' ), true ) ) {
140
- $return_values = true;
141
- } else {
142
- wp_set_object_terms( $this->field->object_id, $this->value, $this->field->args( 'taxonomy' ) );
143
- $return_values = false;
144
- }
145
-
146
- $cmb_id = $this->field->cmb_id;
147
-
148
- /**
149
- * Filter whether 'taxonomy_*' fields should return their value when being sanitized.
150
- *
151
- * By default, these fields do not return a value as we do not want them stored to meta
152
- * (as they are stored as terms). This allows overriding that and is used by CMB2::get_sanitized_values().
153
- *
154
- * The dynamic portion of the hook, $cmb_id, refers to the this field's CMB2 box id.
155
- *
156
- * @since 2.2.4
157
- *
158
- * @param bool $return_values By default, this is only true for 'options-page' boxes. To enable:
159
- * `add_filter( "cmb2_return_taxonomy_values_{$cmb_id}", '__return_true' );`
160
- * @param CMB2_Sanitize $sanitizer This object.
161
- */
162
- if ( apply_filters( "cmb2_return_taxonomy_values_{$cmb_id}", $return_values, $this ) ) {
163
- $sanitized_value = $this->_default_sanitization();
164
- }
165
- }
166
-
167
- return $sanitized_value;
168
- }
169
-
170
- /**
171
- * Simple checkbox validation
172
- *
173
- * @since 1.0.1
174
- * @return string|false 'on' or false
175
- */
176
- public function checkbox() {
177
- return $this->value === 'on' ? 'on' : false;
178
- }
179
-
180
- /**
181
- * Validate url in a meta value.
182
- *
183
- * @since 1.0.1
184
- * @return string Empty string or escaped url
185
- */
186
- public function text_url() {
187
- $protocols = $this->field->args( 'protocols' );
188
- // for repeatable.
189
- if ( is_array( $this->value ) ) {
190
- foreach ( $this->value as $key => $val ) {
191
- $this->value[ $key ] = $val ? esc_url_raw( $val, $protocols ) : $this->field->get_default();
192
- }
193
- } else {
194
- $this->value = $this->value ? esc_url_raw( $this->value, $protocols ) : $this->field->get_default();
195
- }
196
-
197
- return $this->value;
198
- }
199
-
200
- public function colorpicker() {
201
- // for repeatable.
202
- if ( is_array( $this->value ) ) {
203
- $check = $this->value;
204
- $this->value = array();
205
- foreach ( $check as $key => $val ) {
206
- if ( $val && '#' != $val ) {
207
- $this->value[ $key ] = esc_attr( $val );
208
- }
209
- }
210
- } else {
211
- $this->value = ! $this->value || '#' == $this->value ? '' : esc_attr( $this->value );
212
- }
213
- return $this->value;
214
- }
215
-
216
- /**
217
- * Validate email in a meta value
218
- *
219
- * @since 1.0.1
220
- * @return string Empty string or sanitized email
221
- */
222
- public function text_email() {
223
- // for repeatable.
224
- if ( is_array( $this->value ) ) {
225
- foreach ( $this->value as $key => $val ) {
226
- $val = trim( $val );
227
- $this->value[ $key ] = is_email( $val ) ? $val : '';
228
- }
229
- } else {
230
- $this->value = trim( $this->value );
231
- $this->value = is_email( $this->value ) ? $this->value : '';
232
- }
233
-
234
- return $this->value;
235
- }
236
-
237
- /**
238
- * Validate money in a meta value
239
- *
240
- * @since 1.0.1
241
- * @return string Empty string or sanitized money value
242
- */
243
- public function text_money() {
244
- if ( ! $this->value ) {
245
- return '';
246
- }
247
-
248
- global $wp_locale;
249
-
250
- $search = array( $wp_locale->number_format['thousands_sep'], $wp_locale->number_format['decimal_point'] );
251
- $replace = array( '', '.' );
252
-
253
- // Strip slashes. Example: 2\'180.00.
254
- // See https://github.com/CMB2/CMB2/issues/1014.
255
- $this->value = wp_unslash( $this->value );
256
-
257
- // for repeatable.
258
- if ( is_array( $this->value ) ) {
259
- foreach ( $this->value as $key => $val ) {
260
- if ( $val ) {
261
- $this->value[ $key ] = number_format_i18n( (float) str_ireplace( $search, $replace, $val ), 2 );
262
- }
263
- }
264
- } else {
265
- $this->value = number_format_i18n( (float) str_ireplace( $search, $replace, $this->value ), 2 );
266
- }
267
-
268
- return $this->value;
269
- }
270
-
271
- /**
272
- * Converts text date to timestamp
273
- *
274
- * @since 1.0.2
275
- * @return string Timestring
276
- */
277
- public function text_date_timestamp() {
278
- // date_create_from_format if there is a slash in the value.
279
- $this->value = wp_unslash( $this->value );
280
-
281
- return is_array( $this->value )
282
- ? array_map( array( $this->field, 'get_timestamp_from_value' ), $this->value )
283
- : $this->field->get_timestamp_from_value( $this->value );
284
- }
285
-
286
- /**
287
- * Datetime to timestamp
288
- *
289
- * @since 1.0.1
290
- *
291
- * @param bool $repeat Whether or not to repeat.
292
- * @return string|array Timestring
293
- */
294
- public function text_datetime_timestamp( $repeat = false ) {
295
- // date_create_from_format if there is a slash in the value.
296
- $this->value = wp_unslash( $this->value );
297
-
298
- $test = is_array( $this->value ) ? array_filter( $this->value ) : '';
299
- if ( empty( $test ) ) {
300
- return '';
301
- }
302
-
303
- $repeat_value = $this->_check_repeat( __FUNCTION__, $repeat );
304
- if ( false !== $repeat_value ) {
305
- return $repeat_value;
306
- }
307
-
308
- if ( isset( $this->value['date'], $this->value['time'] ) ) {
309
- $this->value = $this->field->get_timestamp_from_value( $this->value['date'] . ' ' . $this->value['time'] );
310
- }
311
-
312
- if ( $tz_offset = $this->field->field_timezone_offset() ) {
313
- $this->value += (int) $tz_offset;
314
- }
315
-
316
- return $this->value;
317
- }
318
-
319
- /**
320
- * Datetime to timestamp with timezone
321
- *
322
- * @since 1.0.1
323
- *
324
- * @param bool $repeat Whether or not to repeat.
325
- * @return string Timestring
326
- */
327
- public function text_datetime_timestamp_timezone( $repeat = false ) {
328
- static $utc_values = array();
329
-
330
- $test = is_array( $this->value ) ? array_filter( $this->value ) : '';
331
- if ( empty( $test ) ) {
332
- return '';
333
- }
334
-
335
- // date_create_from_format if there is a slash in the value.
336
- $this->value = wp_unslash( $this->value );
337
-
338
- $utc_key = $this->field->_id( '', false ) . '_utc';
339
-
340
- $repeat_value = $this->_check_repeat( __FUNCTION__, $repeat );
341
- if ( false !== $repeat_value ) {
342
- if ( ! empty( $utc_values[ $utc_key ] ) ) {
343
- $this->_save_utc_value( $utc_key, $utc_values[ $utc_key ] );
344
- unset( $utc_values[ $utc_key ] );
345
- }
346
-
347
- return $repeat_value;
348
- }
349
-
350
- $tzstring = null;
351
-
352
- if ( is_array( $this->value ) && array_key_exists( 'timezone', $this->value ) ) {
353
- $tzstring = $this->value['timezone'];
354
- }
355
-
356
- if ( empty( $tzstring ) ) {
357
- $tzstring = CMB2_Utils::timezone_string();
358
- }
359
-
360
- $offset = CMB2_Utils::timezone_offset( $tzstring );
361
-
362
- if ( 'UTC' === substr( $tzstring, 0, 3 ) ) {
363
- $tzstring = timezone_name_from_abbr( '', $offset, 0 );
364
- /**
365
- * The timezone_name_from_abbr() returns false if not found based on offset.
366
- * Since there are currently some invalid timezones in wp_timezone_dropdown(),
367
- * fallback to an offset of 0 (UTC+0)
368
- * https://core.trac.wordpress.org/ticket/29205
369
- */
370
- $tzstring = false !== $tzstring ? $tzstring : timezone_name_from_abbr( '', 0, 0 );
371
- }
372
-
373
- $full_format = $this->field->args['date_format'] . ' ' . $this->field->args['time_format'];
374
- $full_date = $this->value['date'] . ' ' . $this->value['time'];
375
-
376
- try {
377
-
378
- $datetime = date_create_from_format( $full_format, $full_date );
379
-
380
- if ( ! is_object( $datetime ) ) {
381
- $this->value = $utc_stamp = '';
382
- } else {
383
- $datetime->setTimezone( new DateTimeZone( $tzstring ) );
384
- $utc_stamp = date_timestamp_get( $datetime ) - $offset;
385
- $this->value = serialize( $datetime );
386
- }
387
-
388
- if ( $this->field->group ) {
389
- $this->value = array(
390
- 'supporting_field_value' => $utc_stamp,
391
- 'supporting_field_id' => $utc_key,
392
- 'value' => $this->value,
393
- );
394
- } else {
395
- // Save the utc timestamp supporting field.
396
- if ( $repeat ) {
397
- $utc_values[ $utc_key ][] = $utc_stamp;
398
- } else {
399
- $this->_save_utc_value( $utc_key, $utc_stamp );
400
- }
401
- }
402
- } catch ( Exception $e ) {
403
- $this->value = '';
404
- CMB2_Utils::log_if_debug( __METHOD__, __LINE__, $e->getMessage() );
405
- }
406
-
407
- return $this->value;
408
- }
409
-
410
- /**
411
- * Sanitize textareas and wysiwyg fields
412
- *
413
- * @since 1.0.1
414
- * @return string Sanitized data
415
- */
416
- public function textarea() {
417
- return is_array( $this->value ) ? array_map( 'wp_kses_post', $this->value ) : wp_kses_post( $this->value );
418
- }
419
-
420
- /**
421
- * Sanitize code textareas
422
- *
423
- * @since 1.0.2
424
- *
425
- * @param bool $repeat Whether or not to repeat.
426
- * @return string Sanitized data
427
- */
428
- public function textarea_code( $repeat = false ) {
429
- $repeat_value = $this->_check_repeat( __FUNCTION__, $repeat );
430
- if ( false !== $repeat_value ) {
431
- return $repeat_value;
432
- }
433
-
434
- return htmlspecialchars_decode( stripslashes( $this->value ) );
435
- }
436
-
437
- /**
438
- * Handles saving of attachment post ID and sanitizing file url
439
- *
440
- * @since 1.1.0
441
- * @return string Sanitized url
442
- */
443
- public function file() {
444
- $file_id_key = $this->field->_id( '', false ) . '_id';
445
-
446
- if ( $this->field->group ) {
447
- // Return an array with url/id if saving a group field.
448
- $this->value = $this->_get_group_file_value_array( $file_id_key );
449
- } else {
450
- $this->_save_file_id_value( $file_id_key );
451
- $this->text_url();
452
- }
453
-
454
- return $this->value;
455
- }
456
-
457
- /**
458
- * Gets the values for the `file` field type from the data being saved.
459
- *
460
- * @since 2.2.0
461
- *
462
- * @param mixed $id_key ID key to use.
463
- * @return array
464
- */
465
- public function _get_group_file_value_array( $id_key ) {
466
- $alldata = $this->field->group->data_to_save;
467
- $base_id = $this->field->group->_id( '', false );
468
- $i = $this->field->group->index;
469
-
470
- // Check group $alldata data.
471
- $id_val = isset( $alldata[ $base_id ][ $i ][ $id_key ] )
472
- ? absint( $alldata[ $base_id ][ $i ][ $id_key ] )
473
- : '';
474
-
475
- // We don't want to save 0 to the DB for file fields.
476
- if ( 0 === $id_val ) {
477
- $id_val = '';
478
- }
479
-
480
- return array(
481
- 'value' => $this->text_url(),
482
- 'supporting_field_value' => $id_val,
483
- 'supporting_field_id' => $id_key,
484
- );
485
- }
486
-
487
- /**
488
- * Peforms saving of `file` attachement's ID
489
- *
490
- * @since 1.1.0
491
- *
492
- * @param mixed $file_id_key ID key to use.
493
- * @return mixed
494
- */
495
- public function _save_file_id_value( $file_id_key ) {
496
- $id_field = $this->_new_supporting_field( $file_id_key );
497
-
498
- // Check standard data_to_save data.
499
- $id_val = isset( $this->field->data_to_save[ $file_id_key ] )
500
- ? $this->field->data_to_save[ $file_id_key ]
501
- : null;
502
-
503
- // If there is no ID saved yet, try to get it from the url.
504
- if ( $this->value && ! $id_val ) {
505
- $id_val = CMB2_Utils::image_id_from_url( $this->value );
506
-
507
- // If there is an ID but user emptied the input value, remove the ID.
508
- } elseif ( ! $this->value && $id_val ) {
509
- $id_val = null;
510
- }
511
-
512
- return $id_field->save_field( $id_val );
513
- }
514
-
515
- /**
516
- * Peforms saving of `text_datetime_timestamp_timezone` utc timestamp
517
- *
518
- * @since 2.2.0
519
- *
520
- * @param mixed $utc_key UTC key.
521
- * @param mixed $utc_stamp UTC timestamp.
522
- * @return mixed
523
- */
524
- public function _save_utc_value( $utc_key, $utc_stamp ) {
525
- return $this->_new_supporting_field( $utc_key )->save_field( $utc_stamp );
526
- }
527
-
528
- /**
529
- * Returns a new, supporting, CMB2_Field object based on a new field id.
530
- *
531
- * @since 2.2.0
532
- *
533
- * @param mixed $new_field_id New field ID.
534
- * @return CMB2_Field
535
- */
536
- public function _new_supporting_field( $new_field_id ) {
537
- return $this->field->get_field_clone( array(
538
- 'id' => $new_field_id,
539
- 'sanitization_cb' => false,
540
- ) );
541
- }
542
-
543
- /**
544
- * If repeating, loop through and re-apply sanitization method
545
- *
546
- * @since 1.1.0
547
- * @param string $method Class method.
548
- * @param bool $repeat Whether repeating or not.
549
- * @return mixed Sanitized value
550
- */
551
- public function _check_repeat( $method, $repeat ) {
552
- if ( $repeat || ! $this->field->args( 'repeatable' ) ) {
553
- return false;
554
- }
555
-
556
- $values_array = $this->value;
557
-
558
- $new_value = array();
559
- foreach ( $values_array as $iterator => $this->value ) {
560
- if ( $this->value ) {
561
- $val = $this->$method( true );
562
- if ( ! empty( $val ) ) {
563
- $new_value[] = $val;
564
- }
565
- }
566
- }
567
-
568
- $this->value = $new_value;
569
-
570
- return empty( $this->value ) ? null : $this->value;
571
- }
572
-
573
- /**
574
- * Determine if passed value is an empty array
575
- *
576
- * @since 2.0.6
577
- * @param mixed $to_check Value to check.
578
- * @return boolean Whether value is an array that's empty
579
- */
580
- public function _is_empty_array( $to_check ) {
581
- if ( is_array( $to_check ) ) {
582
- $cleaned_up = array_filter( $to_check );
583
- return empty( $cleaned_up );
584
- }
585
- return false;
586
- }
587
-
588
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/CMB2_Show_Filters.php DELETED
@@ -1,179 +0,0 @@
1
- <?php
2
- /**
3
- * Show On Filters
4
- * Use the 'cmb2_show_on' filter to further refine the conditions
5
- * under which a metabox is displayed.
6
- * Below you can limit it by ID and page template
7
- *
8
- * All methods in this class are automatically filtered
9
- *
10
- * @since 1.0.0
11
- *
12
- * @category WordPress_Plugin
13
- * @package CMB2
14
- * @author CMB2 team
15
- * @license GPL-2.0+
16
- * @link https://cmb2.io
17
- */
18
- class CMB2_Show_Filters {
19
-
20
- /**
21
- * Get Show_on key. backwards compatible w/ 'key' indexes
22
- *
23
- * @since 2.0.0
24
- *
25
- * @param array $meta_box_args Metabox config array.
26
- *
27
- * @return mixed show_on key or false
28
- */
29
- private static function get_show_on_key( $meta_box_args ) {
30
- $show_on = isset( $meta_box_args['show_on'] ) ? (array) $meta_box_args['show_on'] : false;
31
- if ( $show_on && is_array( $show_on ) ) {
32
-
33
- if ( array_key_exists( 'key', $show_on ) ) {
34
- return $show_on['key'];
35
- }
36
-
37
- $keys = array_keys( $show_on );
38
- return $keys[0];
39
- }
40
-
41
- return false;
42
- }
43
-
44
- /**
45
- * Get Show_on value. backwards compatible w/ 'value' indexes
46
- *
47
- * @since 2.0.0
48
- *
49
- * @param array $meta_box_args Metabox config array.
50
- *
51
- * @return mixed show_on value or false
52
- */
53
- private static function get_show_on_value( $meta_box_args ) {
54
- $show_on = isset( $meta_box_args['show_on'] ) ? (array) $meta_box_args['show_on'] : false;
55
-
56
- if ( $show_on && is_array( $show_on ) ) {
57
-
58
- if ( array_key_exists( 'value', $show_on ) ) {
59
- return $show_on['value'];
60
- }
61
-
62
- $keys = array_keys( $show_on );
63
-
64
- return $show_on[ $keys[0] ];
65
- }
66
-
67
- return array();
68
- }
69
-
70
- /**
71
- * Add metaboxes for an specific ID
72
- *
73
- * @since 1.0.0
74
- * @param bool $display To display or not.
75
- * @param array $meta_box_args Metabox config array.
76
- * @param CMB2 $cmb The CMB2 instance.
77
- * @return bool Whether to display this metabox on the current page.
78
- */
79
- public static function check_id( $display, $meta_box_args, $cmb ) {
80
-
81
- $key = self::get_show_on_key( $meta_box_args );
82
- if ( ! $key || 'id' !== $key ) {
83
- return $display;
84
- }
85
-
86
- $object_id = is_admin() ? $cmb->object_id() : get_the_ID();
87
-
88
- if ( ! $object_id ) {
89
- return false;
90
- }
91
-
92
- // If current page id is in the included array, display the metabox.
93
- return in_array( $object_id, (array) self::get_show_on_value( $meta_box_args ) );
94
- }
95
-
96
- /**
97
- * Add metaboxes for an specific Page Template
98
- *
99
- * @since 1.0.0
100
- * @param bool $display To display or not.
101
- * @param array $meta_box_args Metabox config array.
102
- * @param CMB2 $cmb CMB2 object.
103
- * @return bool Whether to display this metabox on the current page.
104
- */
105
- public static function check_page_template( $display, $meta_box_args, $cmb ) {
106
-
107
- $key = self::get_show_on_key( $meta_box_args );
108
- if ( ! $key || 'page-template' !== $key ) {
109
- return $display;
110
- }
111
-
112
- $object_id = $cmb->object_id();
113
-
114
- if ( ! $object_id || 'post' !== $cmb->object_type() ) {
115
- return false;
116
- }
117
-
118
- // Get current template.
119
- $current_template = get_post_meta( $object_id, '_wp_page_template', true );
120
-
121
- // See if there's a match.
122
- if ( $current_template && in_array( $current_template, (array) self::get_show_on_value( $meta_box_args ) ) ) {
123
- return true;
124
- }
125
-
126
- return false;
127
- }
128
-
129
- /**
130
- * Only show options-page metaboxes on their options page (but only enforce on the admin side)
131
- *
132
- * @since 1.0.0
133
- * @param bool $display To display or not.
134
- * @param array $meta_box_args Metabox config array.
135
- * @return bool Whether to display this metabox on the current page.
136
- */
137
- public static function check_admin_page( $display, $meta_box_args ) {
138
-
139
- $key = self::get_show_on_key( $meta_box_args );
140
- // check if this is a 'options-page' metabox.
141
- if ( ! $key || 'options-page' !== $key ) {
142
- return $display;
143
- }
144
-
145
- // Enforce 'show_on' filter in the admin.
146
- if ( is_admin() ) {
147
-
148
- // If there is no 'page' query var, our filter isn't applicable.
149
- if ( ! isset( $_GET['page'] ) ) {
150
- return $display;
151
- }
152
-
153
- $show_on = self::get_show_on_value( $meta_box_args );
154
-
155
- if ( empty( $show_on ) ) {
156
- return false;
157
- }
158
-
159
- if ( is_array( $show_on ) ) {
160
- foreach ( $show_on as $page ) {
161
- if ( $_GET['page'] == $page ) {
162
- return true;
163
- }
164
- }
165
- } else {
166
- if ( $_GET['page'] == $show_on ) {
167
- return true;
168
- }
169
- }
170
-
171
- return false;
172
-
173
- }
174
-
175
- // Allow options-page metaboxes to be displayed anywhere on the front-end.
176
- return true;
177
- }
178
-
179
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/CMB2_Types.php DELETED
@@ -1,675 +0,0 @@
1
- <?php
2
- /**
3
- * CMB field type objects
4
- *
5
- * @since 1.0.0
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Types {
14
-
15
- /**
16
- * An iterator value for repeatable fields
17
- *
18
- * @var integer
19
- * @since 1.0.0
20
- */
21
- public $iterator = 0;
22
-
23
- /**
24
- * Current CMB2_Field field object
25
- *
26
- * @var CMB2_Field object
27
- * @since 1.0.0
28
- */
29
- public $field;
30
-
31
- /**
32
- * Current CMB2_Type_Base object
33
- *
34
- * @var CMB2_Type_Base object
35
- * @since 2.2.2
36
- */
37
- public $type = null;
38
-
39
- public function __construct( CMB2_Field $field ) {
40
- $this->field = $field;
41
- }
42
-
43
- /**
44
- * Default fallback. Allows rendering fields via "cmb2_render_$fieldtype" hook
45
- *
46
- * @since 1.0.0
47
- * @param string $fieldtype Non-existent field type name
48
- * @param array $arguments All arguments passed to the method
49
- */
50
- public function __call( $fieldtype, $arguments ) {
51
-
52
- // Check for methods to be proxied to the CMB2_Type_Base object.
53
- if ( $exists = $this->maybe_proxy_method( $fieldtype, $arguments ) ) {
54
- return $exists['value'];
55
- }
56
-
57
- // Check for custom field type class.
58
- if ( $object = $this->maybe_custom_field_object( $fieldtype, $arguments ) ) {
59
- return $object->render();
60
- }
61
-
62
- /**
63
- * Pass non-existent field types through an action.
64
- *
65
- * The dynamic portion of the hook name, $fieldtype, refers to the field type.
66
- *
67
- * @param array $field The passed in `CMB2_Field` object
68
- * @param mixed $escaped_value The value of this field escaped.
69
- * It defaults to `sanitize_text_field`.
70
- * If you need the unescaped value, you can access it
71
- * via `$field->value()`
72
- * @param int $object_id The ID of the current object
73
- * @param string $object_type The type of object you are working with.
74
- * Most commonly, `post` (this applies to all post-types),
75
- * but could also be `comment`, `user` or `options-page`.
76
- * @param object $field_type_object This `CMB2_Types` object
77
- */
78
- do_action( "cmb2_render_{$fieldtype}", $this->field, $this->field->escaped_value(), $this->field->object_id, $this->field->object_type, $this );
79
- }
80
-
81
- /**
82
- * Render a field (and handle repeatable)
83
- *
84
- * @since 1.1.0
85
- */
86
- public function render() {
87
- if ( $this->field->args( 'repeatable' ) ) {
88
- $this->render_repeatable_field();
89
- } else {
90
- $this->_render();
91
- }
92
- }
93
-
94
- /**
95
- * Render a field type
96
- *
97
- * @since 1.1.0
98
- */
99
- protected function _render() {
100
- $this->field->peform_param_callback( 'before_field' );
101
- echo $this->{$this->field->type()}();
102
- $this->field->peform_param_callback( 'after_field' );
103
- }
104
-
105
- /**
106
- * Proxies the method call to the CMB2_Type_Base object, if it exists, otherwise returns a default fallback value.
107
- *
108
- * @since 2.2.2
109
- *
110
- * @param string $method Method to call on the CMB2_Type_Base object.
111
- * @param mixed $default Default fallback value if method is not found.
112
- * @param array $args Optional arguments to pass to proxy method.
113
- *
114
- * @return mixed Results from called method.
115
- */
116
- protected function proxy_method( $method, $default, $args = array() ) {
117
- if ( ! is_object( $this->type ) ) {
118
- $this->guess_type_object( $method );
119
- }
120
-
121
- if ( is_object( $this->type ) && method_exists( $this->type, $method ) ) {
122
-
123
- return empty( $args )
124
- ? $this->type->$method()
125
- : call_user_func_array( array( $this->type, $method ), $args );
126
- }
127
-
128
- return $default;
129
- }
130
-
131
- /**
132
- * If no CMB2_Types::$type object is initiated when a proxy method is called, it means
133
- * it's a custom field type (which SHOULD be instantiating a Type), but let's try and
134
- * guess the type object for them and instantiate it.
135
- *
136
- * @since 2.2.3
137
- *
138
- * @param string $method Method attempting to be called on the CMB2_Type_Base object.
139
- * @return bool
140
- */
141
- protected function guess_type_object( $method ) {
142
- $fieldtype = $this->field->type();
143
-
144
- // Try to "guess" the Type object based on the method requested.
145
- switch ( $method ) {
146
- case 'select_option':
147
- case 'list_input':
148
- case 'list_input_checkbox':
149
- case 'concat_items':
150
- $this->get_new_render_type( $fieldtype, 'CMB2_Type_Select' );
151
- break;
152
- case 'is_valid_img_ext':
153
- case 'img_status_output':
154
- case 'file_status_output':
155
- $this->get_new_render_type( $fieldtype, 'CMB2_Type_File_Base' );
156
- break;
157
- case 'parse_picker_options':
158
- $this->get_new_render_type( $fieldtype, 'CMB2_Type_Text_Date' );
159
- break;
160
- case 'get_object_terms':
161
- case 'get_terms':
162
- $this->get_new_render_type( $fieldtype, 'CMB2_Type_Taxonomy_Multicheck' );
163
- break;
164
- case 'date_args':
165
- case 'time_args':
166
- $this->get_new_render_type( $fieldtype, 'CMB2_Type_Text_Datetime_Timestamp' );
167
- break;
168
- case 'parse_args':
169
- $this->get_new_render_type( $fieldtype, 'CMB2_Type_Text' );
170
- break;
171
- }
172
-
173
- return null !== $this->type;
174
- }
175
-
176
- /**
177
- * Check for methods to be proxied to the CMB2_Type_Base object.
178
- *
179
- * @since 2.2.4
180
- * @param string $method The possible method to proxy.
181
- * @param array $arguments All arguments passed to the method.
182
- * @return bool|array False if not proxied, else array with 'value' key being the return of the method.
183
- */
184
- public function maybe_proxy_method( $method, $arguments ) {
185
- $exists = false;
186
-
187
- $proxied = array(
188
- 'get_object_terms' => array(),
189
- 'is_valid_img_ext' => false,
190
- 'parse_args' => array(),
191
- 'concat_items' => '',
192
- 'select_option' => '',
193
- 'list_input' => '',
194
- 'list_input_checkbox' => '',
195
- 'img_status_output' => '',
196
- 'file_status_output' => '',
197
- 'parse_picker_options' => array(),
198
- );
199
- if ( isset( $proxied[ $method ] ) ) {
200
- $exists = array(
201
- // Ok, proxy the method call to the CMB2_Type_Base object.
202
- 'value' => $this->proxy_method( $method, $proxied[ $method ], $arguments ),
203
- );
204
- }
205
-
206
- return $exists;
207
- }
208
-
209
- /**
210
- * Checks for a custom field CMB2_Type_Base class to use for rendering.
211
- *
212
- * @since 2.2.4
213
- *
214
- * @param string $fieldtype Non-existent field type name.
215
- * @param array $args Optional field arguments.
216
- *
217
- * @return bool|CMB2_Type_Base Type object if custom field is an object, false if field was added with
218
- * `cmb2_render_{$field_type}` action.
219
- * @throws Exception if custom field type class does not extend CMB2_Type_Base.
220
- */
221
- public function maybe_custom_field_object( $fieldtype, $args = array() ) {
222
- if ( $render_class_name = $this->get_render_type_class( $fieldtype ) ) {
223
- $this->type = new $render_class_name( $this, $args );
224
-
225
- if ( ! ( $this->type instanceof CMB2_Type_Base ) ) {
226
- throw new Exception( __( 'Custom CMB2 field type classes must extend CMB2_Type_Base.', 'cmb2' ) );
227
- }
228
-
229
- return $this->type;
230
- }
231
-
232
- return false;
233
- }
234
-
235
- /**
236
- * Gets the render type CMB2_Type_Base object to use for rendering the field.
237
- *
238
- * @since 2.2.4
239
- * @param string $fieldtype The type of field being rendered.
240
- * @param string $render_class_name The default field type class to use. Defaults to null.
241
- * @param array $args Optional arguments to pass to type class.
242
- * @param mixed $additional Optional additional argument to pass to type class.
243
- * @return CMB2_Type_Base Type object.
244
- */
245
- public function get_new_render_type( $fieldtype, $render_class_name = null, $args = array(), $additional = '' ) {
246
- $render_class_name = $this->get_render_type_class( $fieldtype, $render_class_name );
247
- $this->type = new $render_class_name( $this, $args, $additional );
248
-
249
- return $this->type;
250
- }
251
-
252
- /**
253
- * Checks for the render type class to use for rendering the field.
254
- *
255
- * @since 2.2.4
256
- * @param string $fieldtype The type of field being rendered.
257
- * @param string $render_class_name The default field type class to use. Defaults to null.
258
- * @return string The field type class to use.
259
- */
260
- public function get_render_type_class( $fieldtype, $render_class_name = null ) {
261
- $render_class_name = $this->field->args( 'render_class' ) ? $this->field->args( 'render_class' ) : $render_class_name;
262
-
263
- if ( has_action( "cmb2_render_class_{$fieldtype}" ) ) {
264
-
265
- /**
266
- * Filters the custom field type class used for rendering the field. Class is required to extend CMB2_Type_Base.
267
- *
268
- * The dynamic portion of the hook name, $fieldtype, refers to the (custom) field type.
269
- *
270
- * @since 2.2.4
271
- *
272
- * @param string $render_class_name The custom field type class to use. Default null.
273
- * @param object $field_type_object This `CMB2_Types` object.
274
- */
275
- $render_class_name = apply_filters( "cmb2_render_class_{$fieldtype}", $render_class_name, $this );
276
- }
277
-
278
- return $render_class_name && class_exists( $render_class_name ) ? $render_class_name : false;
279
- }
280
-
281
- /**
282
- * Retrieve text parameter from field's options array (if it has one), or use fallback text
283
- *
284
- * @since 2.0.0
285
- * @param string $text_key Key in field's options array.
286
- * @param string $fallback Fallback text.
287
- * @return string
288
- */
289
- public function _text( $text_key, $fallback = '' ) {
290
- return $this->field->get_string( $text_key, $fallback );
291
- }
292
-
293
- /**
294
- * Determine a file's extension
295
- *
296
- * @since 1.0.0
297
- * @param string $file File url
298
- * @return string|false File extension or false
299
- */
300
- public function get_file_ext( $file ) {
301
- return CMB2_Utils::get_file_ext( $file );
302
- }
303
-
304
- /**
305
- * Get the file name from a url
306
- *
307
- * @since 2.0.0
308
- * @param string $value File url or path
309
- * @return string File name
310
- */
311
- public function get_file_name_from_path( $value ) {
312
- return CMB2_Utils::get_file_name_from_path( $value );
313
- }
314
-
315
- /**
316
- * Combines attributes into a string for a form element
317
- *
318
- * @since 1.1.0
319
- * @param array $attrs Attributes to concatenate
320
- * @param array $attr_exclude Attributes that should NOT be concatenated
321
- * @return string String of attributes for form element
322
- */
323
- public function concat_attrs( $attrs, $attr_exclude = array() ) {
324
- return CMB2_Utils::concat_attrs( $attrs, $attr_exclude );
325
- }
326
-
327
- /**
328
- * Generates repeatable field table markup
329
- *
330
- * @since 1.0.0
331
- */
332
- public function render_repeatable_field() {
333
- $table_id = $this->field->id() . '_repeat';
334
-
335
- $this->_desc( true, true, true );
336
- ?>
337
-
338
- <div id="<?php echo $table_id; ?>" class="cmb-repeat-table cmb-nested">
339
- <div class="cmb-tbody cmb-field-list">
340
- <?php $this->repeatable_rows(); ?>
341
- </div>
342
- </div>
343
- <p class="cmb-add-row">
344
- <button type="button" data-selector="<?php echo $table_id; ?>" class="cmb-add-row-button button-secondary"><?php echo esc_html( $this->_text( 'add_row_text', esc_html__( 'Add Row', 'cmb2' ) ) ); ?></button>
345
- </p>
346
-
347
- <?php
348
- // reset iterator
349
- $this->iterator = 0;
350
- }
351
-
352
- /**
353
- * Generates repeatable field rows
354
- *
355
- * @since 1.1.0
356
- */
357
- public function repeatable_rows() {
358
- $meta_value = array_filter( (array) $this->field->escaped_value() );
359
- // check for default content
360
- $default = $this->field->get_default();
361
-
362
- // check for saved data
363
- if ( ! empty( $meta_value ) ) {
364
- $meta_value = is_array( $meta_value ) ? array_filter( $meta_value ) : $meta_value;
365
- $meta_value = ! empty( $meta_value ) ? $meta_value : $default;
366
- } else {
367
- $meta_value = $default;
368
- }
369
-
370
- // Loop value array and add a row
371
- if ( ! empty( $meta_value ) ) {
372
- foreach ( (array) $meta_value as $val ) {
373
- $this->field->escaped_value = $val;
374
- $this->repeat_row();
375
- $this->iterator++;
376
- }
377
- } else {
378
-
379
- // If value is empty (including empty array), then clear the value.
380
- $this->field->escaped_value = $this->field->value = null;
381
-
382
- // Otherwise add one row
383
- $this->repeat_row();
384
- }
385
-
386
- // Then add an empty row
387
- $this->field->escaped_value = $default;
388
- $this->iterator = $this->iterator ? $this->iterator : 1;
389
- $this->repeat_row( 'empty-row hidden' );
390
- }
391
-
392
- /**
393
- * Generates a repeatable row's markup
394
- *
395
- * @since 1.1.0
396
- * @param string $classes Repeatable table row's class
397
- */
398
- protected function repeat_row( $classes = 'cmb-repeat-row' ) {
399
- $classes = explode( ' ', $classes );
400
- $classes = array_map( 'sanitize_html_class', $classes );
401
- ?>
402
-
403
- <div class="cmb-row <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
404
- <div class="cmb-td">
405
- <?php $this->_render(); ?>
406
- </div>
407
- <div class="cmb-td cmb-remove-row">
408
- <button type="button" class="button-secondary cmb-remove-row-button" title="<?php echo esc_attr( $this->_text( 'remove_row_button_title', esc_html__( 'Remove Row', 'cmb2' ) ) ); ?>"><?php echo esc_html( $this->_text( 'remove_row_text', esc_html__( 'Remove', 'cmb2' ) ) ); ?></button>
409
- </div>
410
- </div>
411
-
412
- <?php
413
- }
414
-
415
- /**
416
- * Generates description markup.
417
- *
418
- * @since 1.0.0
419
- * @param bool $paragraph Paragraph tag or span.
420
- * @param bool $echo Whether to echo description or only return it.
421
- * @param bool $repeat_group Whether to repeat the group.
422
- * @return string Field's description markup.
423
- */
424
- public function _desc( $paragraph = false, $echo = false, $repeat_group = false ) {
425
- // Prevent description from printing multiple times for repeatable fields
426
- if ( ! $repeat_group && ( $this->field->args( 'repeatable' ) || $this->iterator > 0 ) ) {
427
- return '';
428
- }
429
-
430
- $desc = $this->field->args( 'description' );
431
-
432
- if ( ! $desc ) {
433
- return;
434
- }
435
-
436
- $tag = $paragraph ? 'p' : 'span';
437
- $desc = sprintf( "\n" . '<%1$s class="cmb2-metabox-description">%2$s</%1$s>' . "\n", $tag, $desc );
438
-
439
- if ( $echo ) {
440
- echo $desc;
441
- }
442
-
443
- return $desc;
444
- }
445
-
446
- /**
447
- * Generate field name attribute
448
- *
449
- * @since 1.1.0
450
- * @param string $suffix For multi-part fields
451
- * @return string Name attribute
452
- */
453
- public function _name( $suffix = '' ) {
454
- return $this->field->args( '_name' ) . ( $this->field->args( 'repeatable' ) ? '[' . $this->iterator . ']' : '' ) . $suffix;
455
- }
456
-
457
- /**
458
- * Generate field id attribute
459
- *
460
- * @since 1.1.0
461
- * @param string $suffix For multi-part fields
462
- * @param bool $append_repeatable_iterator Whether to append the iterator attribue if the field is repeatable.
463
- * @return string Id attribute
464
- */
465
- public function _id( $suffix = '', $append_repeatable_iterator = true ) {
466
- $id = $this->field->id() . $suffix . ( $this->field->args( 'repeatable' ) ? '_' . $this->iterator : '' );
467
-
468
- if ( $append_repeatable_iterator && $this->field->args( 'repeatable' ) ) {
469
- $id .= '" data-iterator="' . $this->iterator;
470
- }
471
-
472
- return $id;
473
- }
474
-
475
- /**
476
- * Handles outputting an 'input' element
477
- *
478
- * @since 1.1.0
479
- * @param array $args Override arguments
480
- * @param string $type Field type
481
- * @return string Form input element
482
- */
483
- public function input( $args = array(), $type = __FUNCTION__ ) {
484
- return $this->get_new_render_type( 'text', 'CMB2_Type_Text', $args, $type )->render();
485
- }
486
-
487
- /**
488
- * Handles outputting an 'textarea' element
489
- *
490
- * @since 1.1.0
491
- * @param array $args Override arguments
492
- * @return string Form textarea element
493
- */
494
- public function textarea( $args = array() ) {
495
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Textarea', $args )->render();
496
- }
497
-
498
- /**
499
- * Begin Field Types
500
- */
501
-
502
- public function text() {
503
- return $this->input();
504
- }
505
-
506
- public function hidden() {
507
- $args = array(
508
- 'type' => 'hidden',
509
- 'desc' => '',
510
- 'class' => 'cmb2-hidden',
511
- );
512
- if ( $this->field->group ) {
513
- $args['data-groupid'] = $this->field->group->id();
514
- $args['data-iterator'] = $this->iterator;
515
- }
516
-
517
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Text', $args, 'input' )->render();
518
- }
519
-
520
- public function text_small() {
521
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Text', array(
522
- 'class' => 'cmb2-text-small',
523
- 'desc' => $this->_desc(),
524
- ), 'input' )->render();
525
- }
526
-
527
- public function text_medium() {
528
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Text', array(
529
- 'class' => 'cmb2-text-medium',
530
- 'desc' => $this->_desc(),
531
- ), 'input' )->render();
532
- }
533
-
534
- public function text_email() {
535
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Text', array(
536
- 'class' => 'cmb2-text-email cmb2-text-medium',
537
- 'type' => 'email',
538
- ), 'input' )->render();
539
- }
540
-
541
- public function text_url() {
542
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Text', array(
543
- 'class' => 'cmb2-text-url cmb2-text-medium regular-text',
544
- 'value' => $this->field->escaped_value( 'esc_url' ),
545
- ), 'input' )->render();
546
- }
547
-
548
- public function text_money() {
549
- $input = $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Text', array(
550
- 'class' => 'cmb2-text-money',
551
- 'desc' => $this->_desc(),
552
- ), 'input' )->render();
553
- return ( ! $this->field->get_param_callback_result( 'before_field' ) ? '$ ' : ' ' ) . $input;
554
- }
555
-
556
- public function textarea_small() {
557
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Textarea', array(
558
- 'class' => 'cmb2-textarea-small',
559
- 'rows' => 4,
560
- ) )->render();
561
- }
562
-
563
- public function textarea_code( $args = array() ) {
564
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Textarea_Code', $args )->render();
565
- }
566
-
567
- public function wysiwyg( $args = array() ) {
568
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Wysiwyg', $args )->render();
569
- }
570
-
571
- public function text_date( $args = array() ) {
572
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Text_Date', $args )->render();
573
- }
574
-
575
- // Alias for text_date
576
- public function text_date_timestamp( $args = array() ) {
577
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Text_Date', $args )->render();
578
- }
579
-
580
- public function text_time( $args = array() ) {
581
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Text_Time', $args )->render();
582
- }
583
-
584
- public function text_datetime_timestamp( $args = array() ) {
585
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Text_Datetime_Timestamp', $args )->render();
586
- }
587
-
588
- public function text_datetime_timestamp_timezone( $args = array() ) {
589
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Text_Datetime_Timestamp_Timezone', $args )->render();
590
- }
591
-
592
- public function select_timezone( $args = array() ) {
593
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Select_Timezone', $args )->render();
594
- }
595
-
596
- public function colorpicker( $args = array(), $meta_value = '' ) {
597
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Colorpicker', $args, $meta_value )->render();
598
- }
599
-
600
- public function title( $args = array() ) {
601
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Title', $args )->render();
602
- }
603
-
604
- public function select( $args = array() ) {
605
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Select', $args )->render();
606
- }
607
-
608
- public function taxonomy_select( $args = array() ) {
609
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Taxonomy_Select', $args )->render();
610
- }
611
-
612
- public function taxonomy_select_hierarchical( $args = array() ) {
613
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Taxonomy_Select_Hierarchical', $args )->render();
614
- }
615
-
616
- public function radio( $args = array(), $type = __FUNCTION__ ) {
617
- return $this->get_new_render_type( $type, 'CMB2_Type_Radio', $args, $type )->render();
618
- }
619
-
620
- public function radio_inline( $args = array() ) {
621
- return $this->radio( $args, __FUNCTION__ );
622
- }
623
-
624
- public function multicheck( $type = 'checkbox' ) {
625
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Multicheck', array(), $type )->render();
626
- }
627
-
628
- public function multicheck_inline() {
629
- return $this->multicheck( 'multicheck_inline' );
630
- }
631
-
632
- public function checkbox( $args = array(), $is_checked = null ) {
633
- // Avoid get_new_render_type since we need a different default for the 3rd argument than ''.
634
- $render_class_name = $this->get_render_type_class( __FUNCTION__, 'CMB2_Type_Checkbox' );
635
- $this->type = new $render_class_name( $this, $args, $is_checked );
636
- return $this->type->render();
637
- }
638
-
639
- public function taxonomy_radio( $args = array() ) {
640
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Taxonomy_Radio', $args )->render();
641
- }
642
-
643
- public function taxonomy_radio_hierarchical( $args = array() ) {
644
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Taxonomy_Radio_Hierarchical', $args )->render();
645
- }
646
-
647
- public function taxonomy_radio_inline( $args = array() ) {
648
- return $this->taxonomy_radio( $args );
649
- }
650
-
651
- public function taxonomy_multicheck( $args = array() ) {
652
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Taxonomy_Multicheck', $args )->render();
653
- }
654
-
655
- public function taxonomy_multicheck_hierarchical( $args = array() ) {
656
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Taxonomy_Multicheck_Hierarchical', $args )->render();
657
- }
658
-
659
- public function taxonomy_multicheck_inline( $args = array() ) {
660
- return $this->taxonomy_multicheck( $args );
661
- }
662
-
663
- public function oembed( $args = array() ) {
664
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Oembed', $args )->render();
665
- }
666
-
667
- public function file_list( $args = array() ) {
668
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_File_List', $args )->render();
669
- }
670
-
671
- public function file( $args = array() ) {
672
- return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_File', $args )->render();
673
- }
674
-
675
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/CMB2_Utils.php DELETED
@@ -1,671 +0,0 @@
1
- <?php
2
- /**
3
- * CMB2 Utilities
4
- *
5
- * @since 1.1.0
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Utils {
14
-
15
- /**
16
- * The WordPress ABSPATH constant.
17
- *
18
- * @var string
19
- * @since 2.2.3
20
- */
21
- protected static $ABSPATH = ABSPATH;
22
-
23
- /**
24
- * The url which is used to load local resources.
25
- *
26
- * @var string
27
- * @since 2.0.0
28
- */
29
- protected static $url = '';
30
-
31
- /**
32
- * Utility method that attempts to get an attachment's ID by it's url
33
- *
34
- * @since 1.0.0
35
- * @param string $img_url Attachment url.
36
- * @return int|false Attachment ID or false
37
- */
38
- public static function image_id_from_url( $img_url ) {
39
- $attachment_id = 0;
40
- $dir = wp_upload_dir();
41
-
42
- // Is URL in uploads directory?
43
- if ( false === strpos( $img_url, $dir['baseurl'] . '/' ) ) {
44
- return false;
45
- }
46
-
47
- $file = basename( $img_url );
48
-
49
- $query_args = array(
50
- 'post_type' => 'attachment',
51
- 'post_status' => 'inherit',
52
- 'fields' => 'ids',
53
- 'meta_query' => array(
54
- array(
55
- 'value' => $file,
56
- 'compare' => 'LIKE',
57
- 'key' => '_wp_attachment_metadata',
58
- ),
59
- ),
60
- );
61
-
62
- $query = new WP_Query( $query_args );
63
-
64
- if ( $query->have_posts() ) {
65
-
66
- foreach ( $query->posts as $post_id ) {
67
- $meta = wp_get_attachment_metadata( $post_id );
68
- $original_file = basename( $meta['file'] );
69
- $cropped_image_files = isset( $meta['sizes'] ) ? wp_list_pluck( $meta['sizes'], 'file' ) : array();
70
- if ( $original_file === $file || in_array( $file, $cropped_image_files ) ) {
71
- $attachment_id = $post_id;
72
- break;
73
- }
74
- }
75
- }
76
-
77
- return 0 === $attachment_id ? false : $attachment_id;
78
- }
79
-
80
- /**
81
- * Utility method to get a combined list of default and custom registered image sizes
82
- *
83
- * @since 2.2.4
84
- * @link http://core.trac.wordpress.org/ticket/18947
85
- * @global array $_wp_additional_image_sizes
86
- * @return array The image sizes
87
- */
88
- public static function get_available_image_sizes() {
89
- global $_wp_additional_image_sizes;
90
-
91
- $default_image_sizes = array( 'thumbnail', 'medium', 'large' );
92
- foreach ( $default_image_sizes as $size ) {
93
- $image_sizes[ $size ] = array(
94
- 'height' => intval( get_option( "{$size}_size_h" ) ),
95
- 'width' => intval( get_option( "{$size}_size_w" ) ),
96
- 'crop' => get_option( "{$size}_crop" ) ? get_option( "{$size}_crop" ) : false,
97
- );
98
- }
99
-
100
- if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) ) {
101
- $image_sizes = array_merge( $image_sizes, $_wp_additional_image_sizes );
102
- }
103
-
104
- return $image_sizes;
105
- }
106
-
107
- /**
108
- * Utility method to return the closest named size from an array of values
109
- *
110
- * Based off of WordPress's image_get_intermediate_size()
111
- * If the size matches an existing size then it will be used. If there is no
112
- * direct match, then the nearest image size larger than the specified size
113
- * will be used. If nothing is found, then the function will return false.
114
- * Uses get_available_image_sizes() to get all available sizes.
115
- *
116
- * @since 2.2.4
117
- * @param array|string $size Image size. Accepts an array of width and height (in that order).
118
- * @return false|string Named image size e.g. 'thumbnail'
119
- */
120
- public static function get_named_size( $size ) {
121
- $data = array();
122
-
123
- // Find the best match when '$size' is an array.
124
- if ( is_array( $size ) ) {
125
- $image_sizes = self::get_available_image_sizes();
126
- $candidates = array();
127
-
128
- foreach ( $image_sizes as $_size => $data ) {
129
-
130
- // If there's an exact match to an existing image size, short circuit.
131
- if ( $data['width'] == $size[0] && $data['height'] == $size[1] ) {
132
- $candidates[ $data['width'] * $data['height'] ] = array( $_size, $data );
133
- break;
134
- }
135
-
136
- // If it's not an exact match, consider larger sizes with the same aspect ratio.
137
- if ( $data['width'] >= $size[0] && $data['height'] >= $size[1] ) {
138
-
139
- /**
140
- * To test for varying crops, we constrain the dimensions of the larger image
141
- * to the dimensions of the smaller image and see if they match.
142
- */
143
- if ( $data['width'] > $size[0] ) {
144
- $constrained_size = wp_constrain_dimensions( $data['width'], $data['height'], $size[0] );
145
- $expected_size = array( $size[0], $size[1] );
146
- } else {
147
- $constrained_size = wp_constrain_dimensions( $size[0], $size[1], $data['width'] );
148
- $expected_size = array( $data['width'], $data['height'] );
149
- }
150
-
151
- // If the image dimensions are within 1px of the expected size, we consider it a match.
152
- $matched = ( abs( $constrained_size[0] - $expected_size[0] ) <= 1 && abs( $constrained_size[1] - $expected_size[1] ) <= 1 );
153
-
154
- if ( $matched ) {
155
- $candidates[ $data['width'] * $data['height'] ] = array( $_size, $data );
156
- }
157
- }
158
- }
159
-
160
- if ( ! empty( $candidates ) ) {
161
- // Sort the array by size if we have more than one candidate.
162
- if ( 1 < count( $candidates ) ) {
163
- ksort( $candidates );
164
- }
165
-
166
- $data = array_shift( $candidates );
167
- $data = $data[0];
168
- } elseif ( ! empty( $image_sizes['thumbnail'] ) && $image_sizes['thumbnail']['width'] >= $size[0] && $image_sizes['thumbnail']['width'] >= $size[1] ) {
169
- /*
170
- * When the size requested is smaller than the thumbnail dimensions, we
171
- * fall back to the thumbnail size.
172
- */
173
- $data = 'thumbnail';
174
- } else {
175
- return false;
176
- }
177
- } elseif ( ! empty( $image_sizes[ $size ] ) ) {
178
- $data = $size;
179
- }// End if.
180
-
181
- // If we still don't have a match at this point, return false.
182
- if ( empty( $data ) ) {
183
- return false;
184
- }
185
-
186
- return $data;
187
- }
188
-
189
- /**
190
- * Utility method that returns time string offset by timezone
191
- *
192
- * @since 1.0.0
193
- * @param string $tzstring Time string.
194
- * @return string Offset time string
195
- */
196
- public static function timezone_offset( $tzstring ) {
197
- $tz_offset = 0;
198
-
199
- if ( ! empty( $tzstring ) && is_string( $tzstring ) ) {
200
- if ( 'UTC' === substr( $tzstring, 0, 3 ) ) {
201
- $tzstring = str_replace( array( ':15', ':30', ':45' ), array( '.25', '.5', '.75' ), $tzstring );
202
- return intval( floatval( substr( $tzstring, 3 ) ) * HOUR_IN_SECONDS );
203
- }
204
-
205
- try {
206
- $date_time_zone_selected = new DateTimeZone( $tzstring );
207
- $tz_offset = timezone_offset_get( $date_time_zone_selected, date_create() );
208
- } catch ( Exception $e ) {
209
- self::log_if_debug( __METHOD__, __LINE__, $e->getMessage() );
210
- }
211
- }
212
-
213
- return $tz_offset;
214
- }
215
-
216
- /**
217
- * Utility method that returns a timezone string representing the default timezone for the site.
218
- *
219
- * Roughly copied from WordPress, as get_option('timezone_string') will return
220
- * an empty string if no value has been set on the options page.
221
- * A timezone string is required by the wp_timezone_choice() used by the
222
- * select_timezone field.
223
- *
224
- * @since 1.0.0
225
- * @return string Timezone string
226
- */
227
- public static function timezone_string() {
228
- $current_offset = get_option( 'gmt_offset' );
229
- $tzstring = get_option( 'timezone_string' );
230
-
231
- // Remove old Etc mappings. Fallback to gmt_offset.
232
- if ( false !== strpos( $tzstring, 'Etc/GMT' ) ) {
233
- $tzstring = '';
234
- }
235
-
236
- if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists.
237
- if ( 0 == $current_offset ) {
238
- $tzstring = 'UTC+0';
239
- } elseif ( $current_offset < 0 ) {
240
- $tzstring = 'UTC' . $current_offset;
241
- } else {
242
- $tzstring = 'UTC+' . $current_offset;
243
- }
244
- }
245
-
246
- return $tzstring;
247
- }
248
-
249
- /**
250
- * Returns a timestamp, first checking if value already is a timestamp.
251
- *
252
- * @since 2.0.0
253
- * @param string|int $string Possible timestamp string.
254
- * @return int Time stamp.
255
- */
256
- public static function make_valid_time_stamp( $string ) {
257
- if ( ! $string ) {
258
- return 0;
259
- }
260
-
261
- return self::is_valid_time_stamp( $string )
262
- ? (int) $string :
263
- strtotime( (string) $string );
264
- }
265
-
266
- /**
267
- * Determine if a value is a valid timestamp
268
- *
269
- * @since 2.0.0
270
- * @param mixed $timestamp Value to check.
271
- * @return boolean Whether value is a valid timestamp
272
- */
273
- public static function is_valid_time_stamp( $timestamp ) {
274
- return (string) (int) $timestamp === (string) $timestamp
275
- && $timestamp <= PHP_INT_MAX
276
- && $timestamp >= ~PHP_INT_MAX;
277
- }
278
-
279
- /**
280
- * Checks if a value is 'empty'. Still accepts 0.
281
- *
282
- * @since 2.0.0
283
- * @param mixed $value Value to check.
284
- * @return bool True or false
285
- */
286
- public static function isempty( $value ) {
287
- return null === $value || '' === $value || false === $value || array() === $value;
288
- }
289
-
290
- /**
291
- * Checks if a value is not 'empty'. 0 doesn't count as empty.
292
- *
293
- * @since 2.2.2
294
- * @param mixed $value Value to check.
295
- * @return bool True or false
296
- */
297
- public static function notempty( $value ) {
298
- return null !== $value && '' !== $value && false !== $value && array() !== $value;
299
- }
300
-
301
- /**
302
- * Filters out empty values (not including 0).
303
- *
304
- * @since 2.2.2
305
- * @param mixed $value Value to check.
306
- * @return array True or false.
307
- */
308
- public static function filter_empty( $value ) {
309
- return array_filter( $value, array( __CLASS__, 'notempty' ) );
310
- }
311
-
312
- /**
313
- * Insert a single array item inside another array at a set position
314
- *
315
- * @since 2.0.2
316
- * @param array $array Array to modify. Is passed by reference, and no return is needed. Passed by reference.
317
- * @param array $new New array to insert.
318
- * @param int $position Position in the main array to insert the new array.
319
- */
320
- public static function array_insert( &$array, $new, $position ) {
321
- $before = array_slice( $array, 0, $position - 1 );
322
- $after = array_diff_key( $array, $before );
323
- $array = array_merge( $before, $new, $after );
324
- }
325
-
326
- /**
327
- * Defines the url which is used to load local resources.
328
- * This may need to be filtered for local Window installations.
329
- * If resources do not load, please check the wiki for details.
330
- *
331
- * @since 1.0.1
332
- *
333
- * @param string $path URL path.
334
- * @return string URL to CMB2 resources
335
- */
336
- public static function url( $path = '' ) {
337
- if ( self::$url ) {
338
- return self::$url . $path;
339
- }
340
-
341
- $cmb2_url = self::get_url_from_dir( cmb2_dir() );
342
-
343
- /**
344
- * Filter the CMB location url.
345
- *
346
- * @param string $cmb2_url Currently registered url.
347
- */
348
- self::$url = trailingslashit( apply_filters( 'cmb2_meta_box_url', $cmb2_url, CMB2_VERSION ) );
349
-
350
- return self::$url . $path;
351
- }
352
-
353
- /**
354
- * Converts a system path to a URL
355
- *
356
- * @since 2.2.2
357
- * @param string $dir Directory path to convert.
358
- * @return string Converted URL.
359
- */
360
- public static function get_url_from_dir( $dir ) {
361
- $dir = self::normalize_path( $dir );
362
-
363
- // Let's test if We are in the plugins or mu-plugins dir.
364
- $test_dir = trailingslashit( $dir ) . 'unneeded.php';
365
- if (
366
- 0 === strpos( $test_dir, self::normalize_path( WPMU_PLUGIN_DIR ) )
367
- || 0 === strpos( $test_dir, self::normalize_path( WP_PLUGIN_DIR ) )
368
- ) {
369
- // Ok, then use plugins_url, as it is more reliable.
370
- return trailingslashit( plugins_url( '', $test_dir ) );
371
- }
372
-
373
- // Ok, now let's test if we are in the theme dir.
374
- $theme_root = self::normalize_path( get_theme_root() );
375
- if ( 0 === strpos( $dir, $theme_root ) ) {
376
- // Ok, then use get_theme_root_uri.
377
- return set_url_scheme(
378
- trailingslashit(
379
- str_replace(
380
- untrailingslashit( $theme_root ),
381
- untrailingslashit( get_theme_root_uri() ),
382
- $dir
383
- )
384
- )
385
- );
386
- }
387
-
388
- // Check to see if it's anywhere in the root directory.
389
- $site_dir = self::get_normalized_abspath();
390
- $site_url = trailingslashit( is_multisite() ? network_site_url() : site_url() );
391
-
392
- $url = str_replace(
393
- array( $site_dir, WP_PLUGIN_DIR ),
394
- array( $site_url, WP_PLUGIN_URL ),
395
- $dir
396
- );
397
-
398
- return set_url_scheme( $url );
399
- }
400
-
401
- /**
402
- * Get the normalized absolute path defined by WordPress.
403
- *
404
- * @since 2.2.6
405
- *
406
- * @return string Normalized absolute path.
407
- */
408
- protected static function get_normalized_abspath() {
409
- return self::normalize_path( self::$ABSPATH );
410
- }
411
-
412
- /**
413
- * `wp_normalize_path` wrapper for back-compat. Normalize a filesystem path.
414
- *
415
- * On windows systems, replaces backslashes with forward slashes
416
- * and forces upper-case drive letters.
417
- * Allows for two leading slashes for Windows network shares, but
418
- * ensures that all other duplicate slashes are reduced to a single.
419
- *
420
- * @since 2.2.0
421
- *
422
- * @param string $path Path to normalize.
423
- * @return string Normalized path.
424
- */
425
- protected static function normalize_path( $path ) {
426
- if ( function_exists( 'wp_normalize_path' ) ) {
427
- return wp_normalize_path( $path );
428
- }
429
-
430
- // Replace newer WP's version of wp_normalize_path.
431
- $path = str_replace( '\\', '/', $path );
432
- $path = preg_replace( '|(?<=.)/+|', '/', $path );
433
- if ( ':' === substr( $path, 1, 1 ) ) {
434
- $path = ucfirst( $path );
435
- }
436
-
437
- return $path;
438
- }
439
-
440
- /**
441
- * Get timestamp from text date
442
- *
443
- * @since 2.2.0
444
- * @param string $value Date value.
445
- * @param string $date_format Expected date format.
446
- * @return mixed Unix timestamp representing the date.
447
- */
448
- public static function get_timestamp_from_value( $value, $date_format ) {
449
- $date_object = date_create_from_format( $date_format, $value );
450
- return $date_object ? $date_object->setTime( 0, 0, 0 )->getTimeStamp() : strtotime( $value );
451
- }
452
-
453
- /**
454
- * Takes a php date() format string and returns a string formatted to suit for the date/time pickers
455
- * It will work only with the following subset of date() options:
456
- *
457
- * Formats: d, l, j, z, m, F, n, y, and Y.
458
- *
459
- * A slight effort is made to deal with escaped characters.
460
- *
461
- * Other options are ignored, because they would either bring compatibility problems between PHP and JS, or
462
- * bring even more translation troubles.
463
- *
464
- * @since 2.2.0
465
- * @param string $format PHP date format.
466
- * @return string reformatted string
467
- */
468
- public static function php_to_js_dateformat( $format ) {
469
-
470
- // order is relevant here, since the replacement will be done sequentially.
471
- $supported_options = array(
472
- 'd' => 'dd', // Day, leading 0.
473
- 'j' => 'd', // Day, no 0.
474
- 'z' => 'o', // Day of the year, no leading zeroes.
475
- // 'D' => 'D', // Day name short, not sure how it'll work with translations.
476
- 'l ' => 'DD ', // Day name full, idem before.
477
- 'l, ' => 'DD, ', // Day name full, idem before.
478
- 'm' => 'mm', // Month of the year, leading 0.
479
- 'n' => 'm', // Month of the year, no leading 0.
480
- // 'M' => 'M', // Month, Short name.
481
- 'F ' => 'MM ', // Month, full name.
482
- 'F, ' => 'MM, ', // Month, full name.
483
- 'y' => 'y', // Year, two digit.
484
- 'Y' => 'yy', // Year, full.
485
- 'H' => 'HH', // Hour with leading 0 (24 hour).
486
- 'G' => 'H', // Hour with no leading 0 (24 hour).
487
- 'h' => 'hh', // Hour with leading 0 (12 hour).
488
- 'g' => 'h', // Hour with no leading 0 (12 hour).
489
- 'i' => 'mm', // Minute with leading 0.
490
- 's' => 'ss', // Second with leading 0.
491
- 'a' => 'tt', // am/pm.
492
- 'A' => 'TT', // AM/PM.
493
- );
494
-
495
- foreach ( $supported_options as $php => $js ) {
496
- // replaces every instance of a supported option, but skips escaped characters.
497
- $format = preg_replace( "~(?<!\\\\)$php~", $js, $format );
498
- }
499
-
500
- $supported_options = array(
501
- 'l' => 'DD', // Day name full, idem before.
502
- 'F' => 'MM', // Month, full name.
503
- );
504
-
505
- if ( isset( $supported_options[ $format ] ) ) {
506
- $format = $supported_options[ $format ];
507
- }
508
-
509
- $format = preg_replace_callback( '~(?:\\\.)+~', array( __CLASS__, 'wrap_escaped_chars' ), $format );
510
-
511
- return $format;
512
- }
513
-
514
- /**
515
- * Helper function for CMB_Utils::php_to_js_dateformat().
516
- *
517
- * @since 2.2.0
518
- * @param string $value Value to wrap/escape.
519
- * @return string Modified value
520
- */
521
- public static function wrap_escaped_chars( $value ) {
522
- return '&#39;' . str_replace( '\\', '', $value[0] ) . '&#39;';
523
- }
524
-
525
- /**
526
- * Send to debug.log if WP_DEBUG is defined and true
527
- *
528
- * @since 2.2.0
529
- *
530
- * @param string $function Function name.
531
- * @param int $line Line number.
532
- * @param mixed $msg Message to output.
533
- * @param mixed $debug Variable to print_r.
534
- */
535
- public static function log_if_debug( $function, $line, $msg, $debug = null ) {
536
- if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
537
- error_log( "In $function, $line:" . print_r( $msg, true ) . ( $debug ? print_r( $debug, true ) : '' ) );
538
- }
539
- }
540
-
541
- /**
542
- * Determine a file's extension
543
- *
544
- * @since 1.0.0
545
- * @param string $file File url.
546
- * @return string|false File extension or false
547
- */
548
- public static function get_file_ext( $file ) {
549
- $parsed = parse_url( $file, PHP_URL_PATH );
550
- return $parsed ? strtolower( pathinfo( $parsed, PATHINFO_EXTENSION ) ) : false;
551
- }
552
-
553
- /**
554
- * Get the file name from a url
555
- *
556
- * @since 2.0.0
557
- * @param string $value File url or path.
558
- * @return string File name
559
- */
560
- public static function get_file_name_from_path( $value ) {
561
- $parts = explode( '/', $value );
562
- return is_array( $parts ) ? end( $parts ) : $value;
563
- }
564
-
565
- /**
566
- * Check if WP version is at least $version.
567
- *
568
- * @since 2.2.2
569
- * @param string $version WP version string to compare.
570
- * @return bool Result of comparison check.
571
- */
572
- public static function wp_at_least( $version ) {
573
- return version_compare( get_bloginfo( 'version' ), $version, '>=' );
574
- }
575
-
576
- /**
577
- * Combines attributes into a string for a form element.
578
- *
579
- * @since 1.1.0
580
- * @param array $attrs Attributes to concatenate.
581
- * @param array $attr_exclude Attributes that should NOT be concatenated.
582
- * @return string String of attributes for form element.
583
- */
584
- public static function concat_attrs( $attrs, $attr_exclude = array() ) {
585
- $attr_exclude[] = 'rendered';
586
- $attr_exclude[] = 'js_dependencies';
587
-
588
- $attributes = '';
589
- foreach ( $attrs as $attr => $val ) {
590
- $excluded = in_array( $attr, (array) $attr_exclude, true );
591
- $empty = false === $val && 'value' !== $attr;
592
- if ( ! $excluded && ! $empty ) {
593
- $val = is_array( $val ) ? implode( ',', $val ) : $val;
594
-
595
- // if data attribute, use single quote wraps, else double.
596
- $quotes = self::is_data_attribute( $attr ) ? "'" : '"';
597
- $attributes .= sprintf( ' %1$s=%3$s%2$s%3$s', $attr, $val, $quotes );
598
- }
599
- }
600
- return $attributes;
601
- }
602
-
603
- /**
604
- * Check if given attribute is a data attribute.
605
- *
606
- * @since 2.2.5
607
- *
608
- * @param string $att HTML attribute.
609
- * @return boolean
610
- */
611
- public static function is_data_attribute( $att ) {
612
- return 0 === stripos( $att, 'data-' );
613
- }
614
-
615
- /**
616
- * Ensures value is an array.
617
- *
618
- * @since 2.2.3
619
- *
620
- * @param mixed $value Value to ensure is array.
621
- * @param array $default Default array. Defaults to empty array.
622
- *
623
- * @return array The array.
624
- */
625
- public static function ensure_array( $value, $default = array() ) {
626
- if ( empty( $value ) ) {
627
- return $default;
628
- }
629
-
630
- if ( is_array( $value ) || is_object( $value ) ) {
631
- return (array) $value;
632
- }
633
-
634
- // Not sure anything would be non-scalar that is not an array or object?
635
- if ( ! is_scalar( $value ) ) {
636
- return $default;
637
- }
638
-
639
- return (array) $value;
640
- }
641
-
642
- /**
643
- * If number is numeric, normalize it with floatval or intval, depending on if decimal is found.
644
- *
645
- * @since 2.2.6
646
- *
647
- * @param mixed $value Value to normalize (if numeric).
648
- * @return mixed Possibly normalized value.
649
- */
650
- public static function normalize_if_numeric( $value ) {
651
- if ( is_numeric( $value ) ) {
652
- $value = false !== strpos( $value, '.' ) ? floatval( $value ) : intval( $value );
653
- }
654
-
655
- return $value;
656
- }
657
-
658
- /**
659
- * Generates a 12 character unique hash from a string.
660
- *
661
- * @since 2.4.0
662
- *
663
- * @param string $string String to create a hash from.
664
- *
665
- * @return string
666
- */
667
- public static function generate_hash( $string ) {
668
- return substr( base_convert( md5( $string ), 16, 32 ), 0, 12 );
669
- }
670
-
671
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/CMB2_hookup.php DELETED
@@ -1,1044 +0,0 @@
1
- <?php
2
- /**
3
- * Handles hooking CMB2 forms/metaboxes into the post/attachement/user screens
4
- * and handles hooking in and saving those fields.
5
- *
6
- * @since 2.0.0
7
- *
8
- * @category WordPress_Plugin
9
- * @package CMB2
10
- * @author CMB2 team
11
- * @license GPL-2.0+
12
- * @link https://cmb2.io
13
- */
14
- class CMB2_Hookup extends CMB2_Hookup_Base {
15
-
16
- /**
17
- * Only allow JS registration once
18
- *
19
- * @var bool
20
- * @since 2.0.7
21
- */
22
- protected static $js_registration_done = false;
23
-
24
- /**
25
- * Only allow CSS registration once
26
- *
27
- * @var bool
28
- * @since 2.0.7
29
- */
30
- protected static $css_registration_done = false;
31
-
32
- /**
33
- * CMB taxonomies array for term meta
34
- *
35
- * @var array
36
- * @since 2.2.0
37
- */
38
- protected $taxonomies = array();
39
-
40
- /**
41
- * Custom field columns.
42
- *
43
- * @var array
44
- * @since 2.2.2
45
- */
46
- protected $columns = array();
47
-
48
- /**
49
- * Array of CMB2_Options_Hookup instances if options page metabox.
50
- *
51
- * @var CMB2_Options_Hookup[]|null
52
- * @since 2.2.5
53
- */
54
- protected $options_hookup = null;
55
-
56
- /**
57
- * A functionalized constructor, used for the hookup action callbacks.
58
- *
59
- * @since 2.2.6
60
- *
61
- * @param CMB2 $cmb The CMB2 object to hookup.
62
- *
63
- * @return CMB2_Hookup_Base $hookup The hookup object.
64
- */
65
- public static function maybe_init_and_hookup( CMB2 $cmb ) {
66
- if ( $cmb->prop( 'hookup' ) ) {
67
-
68
- $hookup = new self( $cmb );
69
-
70
- // Hook in the hookup... how meta.
71
- return $hookup->universal_hooks();
72
- }
73
-
74
- return false;
75
- }
76
-
77
- public function universal_hooks() {
78
- foreach ( get_class_methods( 'CMB2_Show_Filters' ) as $filter ) {
79
- add_filter( 'cmb2_show_on', array( 'CMB2_Show_Filters', $filter ), 10, 3 );
80
- }
81
-
82
- if ( is_admin() ) {
83
- // Register our scripts and styles for cmb.
84
- $this->once( 'admin_enqueue_scripts', array( __CLASS__, 'register_scripts' ), 8 );
85
- $this->once( 'admin_enqueue_scripts', array( $this, 'do_scripts' ) );
86
-
87
- $this->maybe_enqueue_column_display_styles();
88
-
89
- switch ( $this->object_type ) {
90
- case 'post':
91
- return $this->post_hooks();
92
- case 'comment':
93
- return $this->comment_hooks();
94
- case 'user':
95
- return $this->user_hooks();
96
- case 'term':
97
- return $this->term_hooks();
98
- case 'options-page':
99
- return $this->options_page_hooks();
100
- }
101
- }
102
-
103
- return $this;
104
- }
105
-
106
- public function post_hooks() {
107
-
108
- // Fetch the context we set in our call.
109
- $context = $this->cmb->prop( 'context' ) ? $this->cmb->prop( 'context' ) : 'normal';
110
-
111
- // Call the proper hook based on the context provided.
112
- switch ( $context ) {
113
-
114
- case 'form_top':
115
- add_action( 'edit_form_top', array( $this, 'add_context_metaboxes' ) );
116
- break;
117
-
118
- case 'before_permalink':
119
- add_action( 'edit_form_before_permalink', array( $this, 'add_context_metaboxes' ) );
120
- break;
121
-
122
- case 'after_title':
123
- add_action( 'edit_form_after_title', array( $this, 'add_context_metaboxes' ) );
124
- break;
125
-
126
- case 'after_editor':
127
- add_action( 'edit_form_after_editor', array( $this, 'add_context_metaboxes' ) );
128
- break;
129
-
130
- default:
131
- add_action( 'add_meta_boxes', array( $this, 'add_metaboxes' ) );
132
- }
133
-
134
- add_action( 'add_meta_boxes', array( $this, 'remove_default_tax_metaboxes' ) );
135
- add_action( 'add_attachment', array( $this, 'save_post' ) );
136
- add_action( 'edit_attachment', array( $this, 'save_post' ) );
137
- add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );
138
-
139
- if ( $this->cmb->has_columns ) {
140
- foreach ( $this->cmb->box_types() as $post_type ) {
141
- add_filter( "manage_{$post_type}_posts_columns", array( $this, 'register_column_headers' ) );
142
- add_action( "manage_{$post_type}_posts_custom_column", array( $this, 'column_display' ), 10, 2 );
143
- add_filter( "manage_edit-{$post_type}_sortable_columns", array( $this, 'columns_sortable' ) );
144
- add_action( 'pre_get_posts', array( $this, 'columns_sortable_orderby' ) );
145
- }
146
- }
147
-
148
- return $this;
149
- }
150
-
151
- public function comment_hooks() {
152
- add_action( 'add_meta_boxes_comment', array( $this, 'add_metaboxes' ) );
153
- add_action( 'edit_comment', array( $this, 'save_comment' ) );
154
-
155
- if ( $this->cmb->has_columns ) {
156
- add_filter( 'manage_edit-comments_columns', array( $this, 'register_column_headers' ) );
157
- add_action( 'manage_comments_custom_column', array( $this, 'column_display' ), 10, 3 );
158
- add_filter( "manage_edit-comments_sortable_columns", array( $this, 'columns_sortable' ) );
159
- add_action( 'pre_get_posts', array( $this, 'columns_sortable_orderby' ) );
160
- }
161
-
162
- return $this;
163
- }
164
-
165
- public function user_hooks() {
166
- $priority = $this->get_priority();
167
-
168
- add_action( 'show_user_profile', array( $this, 'user_metabox' ), $priority );
169
- add_action( 'edit_user_profile', array( $this, 'user_metabox' ), $priority );
170
- add_action( 'user_new_form', array( $this, 'user_new_metabox' ), $priority );
171
-
172
- add_action( 'personal_options_update', array( $this, 'save_user' ) );
173
- add_action( 'edit_user_profile_update', array( $this, 'save_user' ) );
174
- add_action( 'user_register', array( $this, 'save_user' ) );
175
-
176
- if ( $this->cmb->has_columns ) {
177
- add_filter( 'manage_users_columns', array( $this, 'register_column_headers' ) );
178
- add_filter( 'manage_users_custom_column', array( $this, 'return_column_display' ), 10, 3 );
179
- add_filter( "manage_users_sortable_columns", array( $this, 'columns_sortable' ) );
180
- add_action( 'pre_get_posts', array( $this, 'columns_sortable_orderby' ) );
181
- }
182
-
183
- return $this;
184
- }
185
-
186
- public function term_hooks() {
187
- if ( ! function_exists( 'get_term_meta' ) ) {
188
- wp_die( esc_html__( 'Term Metadata is a WordPress 4.4+ feature. Please upgrade your WordPress install.', 'cmb2' ) );
189
- }
190
-
191
- if ( ! $this->cmb->prop( 'taxonomies' ) ) {
192
- wp_die( esc_html__( 'Term metaboxes configuration requires a "taxonomies" parameter.', 'cmb2' ) );
193
- }
194
-
195
- $this->taxonomies = (array) $this->cmb->prop( 'taxonomies' );
196
- $show_on_term_add = $this->cmb->prop( 'new_term_section' );
197
- $priority = $this->get_priority( 8 );
198
-
199
- foreach ( $this->taxonomies as $taxonomy ) {
200
- // Display our form data.
201
- add_action( "{$taxonomy}_edit_form", array( $this, 'term_metabox' ), $priority, 2 );
202
-
203
- $show_on_add = is_array( $show_on_term_add )
204
- ? in_array( $taxonomy, $show_on_term_add )
205
- : (bool) $show_on_term_add;
206
-
207
- /**
208
- * Filter to determine if the term's fields should show in the "Add term" section.
209
- *
210
- * The dynamic portion of the hook name, $cmb_id, is the metabox id.
211
- *
212
- * @param bool $show_on_add Default is the value of the new_term_section cmb parameter.
213
- * @param object $cmb The CMB2 instance
214
- */
215
- $show_on_add = apply_filters( "cmb2_show_on_term_add_form_{$this->cmb->cmb_id}", $show_on_add, $this->cmb );
216
-
217
- // Display form in add-new section (unless specified not to).
218
- if ( $show_on_add ) {
219
- add_action( "{$taxonomy}_add_form_fields", array( $this, 'term_metabox' ), $priority, 2 );
220
- }
221
-
222
- if ( $this->cmb->has_columns ) {
223
- add_filter( "manage_edit-{$taxonomy}_columns", array( $this, 'register_column_headers' ) );
224
- add_filter( "manage_{$taxonomy}_custom_column", array( $this, 'return_column_display' ), 10, 3 );
225
- add_filter( "manage_edit-{$taxonomy}_sortable_columns", array( $this, 'columns_sortable' ) );
226
- add_action( 'pre_get_posts', array( $this, 'columns_sortable_orderby' ) );
227
- }
228
- }
229
-
230
- add_action( 'created_term', array( $this, 'save_term' ), 10, 3 );
231
- add_action( 'edited_terms', array( $this, 'save_term' ), 10, 2 );
232
- add_action( 'delete_term', array( $this, 'delete_term' ), 10, 3 );
233
-
234
- return $this;
235
- }
236
-
237
- public function options_page_hooks() {
238
- $option_keys = $this->cmb->options_page_keys();
239
-
240
- if ( ! empty( $option_keys ) ) {
241
- foreach ( $option_keys as $option_key ) {
242
- $this->options_hookup[ $option_key ] = new CMB2_Options_Hookup( $this->cmb, $option_key );
243
- $this->options_hookup[ $option_key ]->hooks();
244
- }
245
- }
246
-
247
- return $this;
248
- }
249
-
250
- /**
251
- * Registers styles for CMB2
252
- *
253
- * @since 2.0.7
254
- */
255
- protected static function register_styles() {
256
- if ( self::$css_registration_done ) {
257
- return;
258
- }
259
-
260
- // Only use minified files if SCRIPT_DEBUG is off.
261
- $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
262
- $front = is_admin() ? '' : '-front';
263
- $rtl = is_rtl() ? '-rtl' : '';
264
-
265
- /**
266
- * Filters the registered style dependencies for the cmb2 stylesheet.
267
- *
268
- * @param array $dependencies The registered style dependencies for the cmb2 stylesheet.
269
- */
270
- $dependencies = apply_filters( 'cmb2_style_dependencies', array() );
271
- wp_register_style( 'cmb2-styles', CMB2_Utils::url( "css/cmb2{$front}{$rtl}{$min}.css" ), $dependencies );
272
- wp_register_style( 'cmb2-display-styles', CMB2_Utils::url( "css/cmb2-display{$rtl}{$min}.css" ), $dependencies );
273
-
274
- self::$css_registration_done = true;
275
- }
276
-
277
- /**
278
- * Registers scripts for CMB2
279
- *
280
- * @since 2.0.7
281
- */
282
- protected static function register_js() {
283
- if ( self::$js_registration_done ) {
284
- return;
285
- }
286
-
287
- $hook = is_admin() ? 'admin_footer' : 'wp_footer';
288
- add_action( $hook, array( 'CMB2_JS', 'enqueue' ), 8 );
289
-
290
- self::$js_registration_done = true;
291
- }
292
-
293
- /**
294
- * Registers scripts and styles for CMB2
295
- *
296
- * @since 1.0.0
297
- */
298
- public static function register_scripts() {
299
- self::register_styles();
300
- self::register_js();
301
- }
302
-
303
- /**
304
- * Enqueues scripts and styles for CMB2 in admin_head.
305
- *
306
- * @since 1.0.0
307
- *
308
- * @param string $hook Current hook for the admin page.
309
- */
310
- public function do_scripts( $hook ) {
311
- $hooks = array(
312
- 'post.php',
313
- 'post-new.php',
314
- 'page-new.php',
315
- 'page.php',
316
- 'comment.php',
317
- 'edit-tags.php',
318
- 'term.php',
319
- 'user-new.php',
320
- 'profile.php',
321
- 'user-edit.php',
322
- );
323
- // only pre-enqueue our scripts/styles on the proper pages
324
- // show_form_for_type will have us covered if we miss something here.
325
- if ( in_array( $hook, $hooks, true ) ) {
326
- if ( $this->cmb->prop( 'cmb_styles' ) ) {
327
- self::enqueue_cmb_css();
328
- }
329
- if ( $this->cmb->prop( 'enqueue_js' ) ) {
330
- self::enqueue_cmb_js();
331
- }
332
- }
333
- }
334
-
335
- /**
336
- * Register the CMB2 field column headers.
337
- *
338
- * @since 2.2.2
339
- *
340
- * @param array $columns Array of columns available for the admin page.
341
- */
342
- public function register_column_headers( $columns ) {
343
- foreach ( $this->cmb->prop( 'fields' ) as $key => $field ) {
344
- if ( empty( $field['column'] ) ) {
345
- continue;
346
- }
347
-
348
- $column = $field['column'];
349
-
350
- if ( false === $column['position'] ) {
351
- $columns[ $field['id'] ] = $column['name'];
352
- } else {
353
- $before = array_slice( $columns, 0, absint( $column['position'] ) );
354
- $before[ $field['id'] ] = $column['name'];
355
- $columns = $before + $columns;
356
- }
357
-
358
- $column['field'] = $field;
359
- $this->columns[ $field['id'] ] = $column;
360
- }
361
-
362
- return $columns;
363
- }
364
-
365
- /**
366
- * The CMB2 field column display output.
367
- *
368
- * @since 2.2.2
369
- *
370
- * @param string $column_name Current column name.
371
- * @param mixed $object_id Current object ID.
372
- */
373
- public function column_display( $column_name, $object_id ) {
374
- if ( isset( $this->columns[ $column_name ] ) ) {
375
- $field = new CMB2_Field( array(
376
- 'field_args' => $this->columns[ $column_name ]['field'],
377
- 'object_type' => $this->object_type,
378
- 'object_id' => $this->cmb->object_id( $object_id ),
379
- 'cmb_id' => $this->cmb->cmb_id,
380
- ) );
381
-
382
- $this->cmb->get_field( $field )->render_column();
383
- }
384
- }
385
-
386
- /**
387
- * Returns the columns sortable array.
388
- *
389
- * @since 2.6.1
390
- *
391
- * @param array $columns An array of sortable columns.
392
- *
393
- * @return array $columns An array of sortable columns with CMB2 columns.
394
- */
395
- public function columns_sortable( $columns ) {
396
- foreach ( $this->cmb->prop( 'fields' ) as $key => $field ) {
397
- if ( ! empty( $field['column'] ) && empty( $field['column']['disable_sortable'] ) ) {
398
- $columns[ $field['id'] ] = $field['id'];
399
- }
400
- }
401
-
402
- return $columns;
403
- }
404
-
405
- /**
406
- * Return the query object to order by custom columns if selected
407
- *
408
- * @since 2.6.1
409
- *
410
- * @param object $query Object query from WordPress
411
- *
412
- * @return void
413
- */
414
- public function columns_sortable_orderby( $query ) {
415
- if ( ! is_admin() ) {
416
- return;
417
- }
418
-
419
- $orderby = $query->get( 'orderby' );
420
-
421
- foreach ( $this->cmb->prop( 'fields' ) as $key => $field ) {
422
- if (
423
- empty( $field['column'] )
424
- || ! empty( $field['column']['disable_sortable'] )
425
- || $field['id'] !== $orderby
426
- ) {
427
- continue;
428
- }
429
-
430
- $query->set( 'meta_key', $field['id'] );
431
-
432
- $type = $field['type'];
433
-
434
- if ( ! empty( $field['attributes']['type'] ) ) {
435
- switch ( $field['attributes']['type'] ) {
436
- case 'number':
437
- case 'date':
438
- $type = $field['attributes']['type'];
439
- break;
440
- case 'range':
441
- $type = 'number';
442
- break;
443
- }
444
- }
445
-
446
- switch ( $type ) {
447
- case 'number':
448
- case 'text_date_timestamp':
449
- case 'text_datetime_timestamp':
450
- case 'text_money':
451
- $query->set( 'orderby', 'meta_value_num' );
452
- break;
453
- case 'text_time':
454
- $query->set( 'orderby', 'meta_value_time' );
455
- break;
456
- case 'text_date':
457
- $query->set( 'orderby', 'meta_value_date' );
458
- break;
459
-
460
- default:
461
- $query->set( 'orderby', 'meta_value' );
462
- break;
463
- }
464
- }
465
- }
466
-
467
- /**
468
- * Returns the column display.
469
- *
470
- * @since 2.2.2
471
- */
472
- public function return_column_display( $empty, $custom_column, $object_id ) {
473
- ob_start();
474
- $this->column_display( $custom_column, $object_id );
475
- $column = ob_get_clean();
476
-
477
- return $column ? $column : $empty;
478
- }
479
-
480
- /**
481
- * Output the CMB2 box/fields in an alternate context (not in a standard metabox area).
482
- *
483
- * @since 2.2.4
484
- */
485
- public function add_context_metaboxes() {
486
-
487
- if ( ! $this->show_on() ) {
488
- return;
489
- }
490
-
491
- $page = get_current_screen()->id;
492
-
493
- foreach ( $this->cmb->box_types() as $object_type ) {
494
- $screen = convert_to_screen( $object_type );
495
-
496
- // If we're on the right post-type/object...
497
- if ( isset( $screen->id ) && $screen->id === $page ) {
498
-
499
- // Show the box.
500
- $this->output_context_metabox();
501
- }
502
- }
503
- }
504
-
505
- /**
506
- * Output the CMB2 box/fields in an alternate context (not in a standard metabox area).
507
- *
508
- * @since 2.2.4
509
- */
510
- public function output_context_metabox() {
511
- $title = $this->cmb->prop( 'title' );
512
-
513
- /*
514
- * To keep from outputting the open/close markup, do not include
515
- * a 'title' property in your metabox registration array.
516
- *
517
- * To output the fields 'naked' (without a postbox wrapper/style), then
518
- * add a `'remove_box_wrap' => true` to your metabox registration array.
519
- */
520
- $add_wrap = ! empty( $title ) || ! $this->cmb->prop( 'remove_box_wrap' );
521
- $add_handle = $add_wrap && ! empty( $title );
522
-
523
- // Open the context-box wrap.
524
- $this->context_box_title_markup_open( $add_handle );
525
-
526
- // Show the form fields.
527
- $this->cmb->show_form();
528
-
529
- // Close the context-box wrap.
530
- $this->context_box_title_markup_close( $add_handle );
531
- }
532
-
533
- /**
534
- * Output the opening markup for a context box.
535
- *
536
- * @since 2.2.4
537
- * @param bool $add_handle Whether to add the metabox handle and opening div for .inside.
538
- */
539
- public function context_box_title_markup_open( $add_handle = true ) {
540
- $cmb_id = $this->cmb->cmb_id;
541
- $title = $this->cmb->prop( 'title' );
542
- $screen = get_current_screen();
543
- $page = $screen->id;
544
- $is_55 = CMB2_Utils::wp_at_least( '5.5' );
545
-
546
- add_filter( "postbox_classes_{$page}_{$cmb_id}", array( $this, 'postbox_classes' ) );
547
-
548
- $hidden_class = '';
549
-
550
- if ( $is_55 ) {
551
-
552
- // get_hidden_meta_boxes() doesn't apply in the block editor.
553
- $is_hidden = ! $screen->is_block_editor() && in_array( $cmb_id, get_hidden_meta_boxes( $screen ), true );
554
-
555
- $hidden_class = $is_hidden
556
- ? ' hide-if-js'
557
- : '';
558
- }
559
-
560
- $toggle_button = '<button type="button" class="handlediv button-link" aria-expanded="true"><span class="screen-reader-text">' . sprintf( __( 'Toggle panel: %s' ), $title ) . '</span><span class="toggle-indicator" aria-hidden="true"></span></button>';
561
- $title_tag = '<h2 class="hndle"><span>' . esc_attr( $title ) . '</span></h2>' . "\n";
562
-
563
- echo '<div id="' . $cmb_id . '" class="' . postbox_classes( $cmb_id, $page ) . $hidden_class . '">' . "\n";
564
-
565
- if ( $add_handle ) {
566
-
567
- if ( $is_55 ) {
568
- echo '<div class="postbox-header">';
569
- echo $title_tag;
570
-
571
- echo '<div class="handle-actions hide-if-no-js">';
572
- echo $toggle_button;
573
- echo '</div>';
574
-
575
- echo '</div>' . "\n";
576
-
577
- } else {
578
- echo $toggle_button;;
579
- echo $title_tag;
580
- }
581
-
582
- echo '<div class="inside">' . "\n";
583
- }
584
- }
585
-
586
- /**
587
- * Output the closing markup for a context box.
588
- *
589
- * @since 2.2.4
590
- * @param bool $add_inside_close Whether to add closing div for .inside.
591
- */
592
- public function context_box_title_markup_close( $add_inside_close = true ) {
593
-
594
- // Load the closing divs for a title box.
595
- if ( $add_inside_close ) {
596
- echo '</div>' . "\n"; // .inside
597
- }
598
-
599
- echo '</div>' . "\n"; // .context-box
600
- }
601
-
602
- /**
603
- * Add metaboxes (to 'post' or 'comment' object types)
604
- *
605
- * @since 1.0.0
606
- */
607
- public function add_metaboxes() {
608
-
609
- if ( ! $this->show_on() ) {
610
- return;
611
- }
612
-
613
- /*
614
- * To keep from registering an actual post-screen metabox,
615
- * omit the 'title' property from the metabox registration array.
616
- *
617
- * (WordPress will not display metaboxes without titles anyway)
618
- *
619
- * This is a good solution if you want to handle outputting your
620
- * metaboxes/fields elsewhere in the post-screen.
621
- */
622
- if ( ! $this->cmb->prop( 'title' ) ) {
623
- return;
624
- }
625
-
626
- $page = get_current_screen()->id;
627
- add_filter( "postbox_classes_{$page}_{$this->cmb->cmb_id}", array( $this, 'postbox_classes' ) );
628
-
629
- foreach ( $this->cmb->box_types() as $object_type ) {
630
- add_meta_box(
631
- $this->cmb->cmb_id,
632
- $this->cmb->prop( 'title' ),
633
- array( $this, 'metabox_callback' ),
634
- $object_type,
635
- $this->cmb->prop( 'context' ),
636
- $this->cmb->prop( 'priority' ),
637
- $this->cmb->prop( 'mb_callback_args' )
638
- );
639
- }
640
- }
641
-
642
- /**
643
- * Remove the specified default taxonomy metaboxes for a post-type.
644
- *
645
- * @since 2.2.3
646
- *
647
- */
648
- public function remove_default_tax_metaboxes() {
649
- $to_remove = array_filter( (array) $this->cmb->tax_metaboxes_to_remove, 'taxonomy_exists' );
650
- if ( empty( $to_remove ) ) {
651
- return;
652
- }
653
-
654
- foreach ( $this->cmb->box_types() as $post_type ) {
655
- foreach ( $to_remove as $taxonomy ) {
656
- $mb_id = is_taxonomy_hierarchical( $taxonomy ) ? "{$taxonomy}div" : "tagsdiv-{$taxonomy}";
657
- remove_meta_box( $mb_id, $post_type, 'side' );
658
- }
659
- }
660
- }
661
-
662
- /**
663
- * Modify metabox postbox classes.
664
- *
665
- * @since 2.2.4
666
- * @param array $classes Array of classes.
667
- * @return array Modified array of classes
668
- */
669
- public function postbox_classes( $classes ) {
670
- if ( $this->cmb->prop( 'closed' ) && ! in_array( 'closed', $classes ) ) {
671
- $classes[] = 'closed';
672
- }
673
-
674
- if ( $this->cmb->is_alternate_context_box() ) {
675
- $classes = $this->alternate_context_postbox_classes( $classes );
676
- } else {
677
- $classes[] = 'cmb2-postbox';
678
- }
679
-
680
- return $classes;
681
- }
682
-
683
- /**
684
- * Modify metabox altnernate context postbox classes.
685
- *
686
- * @since 2.2.4
687
- * @param array $classes Array of classes.
688
- * @return array Modified array of classes
689
- */
690
- protected function alternate_context_postbox_classes( $classes ) {
691
- $classes[] = 'context-box';
692
- $classes[] = 'context-' . $this->cmb->prop( 'context' ) . '-box';
693
-
694
- if ( in_array( $this->cmb->cmb_id, get_hidden_meta_boxes( get_current_screen() ) ) ) {
695
- $classes[] = 'hide-if-js';
696
- }
697
-
698
- $add_wrap = $this->cmb->prop( 'title' ) || ! $this->cmb->prop( 'remove_box_wrap' );
699
-
700
- if ( $add_wrap ) {
701
- $classes[] = 'cmb2-postbox postbox';
702
- } else {
703
- $classes[] = 'cmb2-no-box-wrap';
704
- }
705
-
706
- return $classes;
707
- }
708
-
709
- /**
710
- * Display metaboxes for a post or comment object.
711
- *
712
- * @since 1.0.0
713
- */
714
- public function metabox_callback() {
715
- $object_id = 'comment' === $this->object_type ? get_comment_ID() : get_the_ID();
716
- $this->cmb->show_form( $object_id, $this->object_type );
717
- }
718
-
719
- /**
720
- * Display metaboxes for new user page.
721
- *
722
- * @since 1.0.0
723
- *
724
- * @param mixed $section User section metabox.
725
- */
726
- public function user_new_metabox( $section ) {
727
- if ( $section === $this->cmb->prop( 'new_user_section' ) ) {
728
- $object_id = $this->cmb->object_id();
729
- $this->cmb->object_id( isset( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : $object_id );
730
- $this->user_metabox();
731
- }
732
- }
733
-
734
- /**
735
- * Display metaboxes for a user object.
736
- *
737
- * @since 1.0.0
738
- */
739
- public function user_metabox() {
740
- $this->show_form_for_type( 'user' );
741
- }
742
-
743
- /**
744
- * Display metaboxes for a taxonomy term object.
745
- *
746
- * @since 2.2.0
747
- */
748
- public function term_metabox() {
749
- $this->show_form_for_type( 'term' );
750
- }
751
-
752
- /**
753
- * Display metaboxes for an object type.
754
- *
755
- * @since 2.2.0
756
- * @param string $type Object type.
757
- * @return void
758
- */
759
- public function show_form_for_type( $type ) {
760
- if ( $type != $this->object_type ) {
761
- return;
762
- }
763
-
764
- if ( ! $this->show_on() ) {
765
- return;
766
- }
767
-
768
- if ( $this->cmb->prop( 'cmb_styles' ) ) {
769
- self::enqueue_cmb_css();
770
- }
771
- if ( $this->cmb->prop( 'enqueue_js' ) ) {
772
- self::enqueue_cmb_js();
773
- }
774
-
775
- $this->cmb->show_form( 0, $type );
776
- }
777
-
778
- /**
779
- * Determines if metabox should be shown in current context.
780
- *
781
- * @since 2.0.0
782
- * @return bool Whether metabox should be added/shown.
783
- */
784
- public function show_on() {
785
- // If metabox is requesting to be conditionally shown.
786
- $show = $this->cmb->should_show();
787
-
788
- /**
789
- * Filter to determine if metabox should show. Default is true.
790
- *
791
- * @param array $show Default is true, show the metabox.
792
- * @param mixed $meta_box_args Array of the metabox arguments.
793
- * @param mixed $cmb The CMB2 instance.
794
- */
795
- $show = (bool) apply_filters( 'cmb2_show_on', $show, $this->cmb->meta_box, $this->cmb );
796
-
797
- return $show;
798
- }
799
-
800
- /**
801
- * Get the CMB priority property set to numeric hook priority.
802
- *
803
- * @since 2.2.0
804
- *
805
- * @param integer $default Default display hook priority.
806
- * @return integer Hook priority.
807
- */
808
- public function get_priority( $default = 10 ) {
809
- $priority = $this->cmb->prop( 'priority' );
810
-
811
- if ( ! is_numeric( $priority ) ) {
812
- switch ( $priority ) {
813
-
814
- case 'high':
815
- $priority = 5;
816
- break;
817
-
818
- case 'low':
819
- $priority = 20;
820
- break;
821
-
822
- default:
823
- $priority = $default;
824
- break;
825
- }
826
- }
827
-
828
- return $priority;
829
- }
830
-
831
- /**
832
- * Save data from post metabox
833
- *
834
- * @since 1.0.0
835
- * @param int $post_id Post ID.
836
- * @param mixed $post Post object.
837
- * @return void
838
- */
839
- public function save_post( $post_id, $post = false ) {
840
-
841
- $post_type = $post ? $post->post_type : get_post_type( $post_id );
842
-
843
- $do_not_pass_go = (
844
- ! $this->can_save( $post_type )
845
- // Check user editing permissions.
846
- || ( 'page' === $post_type && ! current_user_can( 'edit_page', $post_id ) )
847
- || ! current_user_can( 'edit_post', $post_id )
848
- );
849
-
850
- if ( $do_not_pass_go ) {
851
- return;
852
- }
853
-
854
- $this->cmb->save_fields( $post_id, 'post', $_POST );
855
- }
856
-
857
- /**
858
- * Save data from comment metabox.
859
- *
860
- * @since 2.0.9
861
- * @param int $comment_id Comment ID.
862
- * @return void
863
- */
864
- public function save_comment( $comment_id ) {
865
-
866
- $can_edit = current_user_can( 'moderate_comments', $comment_id );
867
-
868
- if ( $this->can_save( get_comment_type( $comment_id ) ) && $can_edit ) {
869
- $this->cmb->save_fields( $comment_id, 'comment', $_POST );
870
- }
871
- }
872
-
873
- /**
874
- * Save data from user fields.
875
- *
876
- * @since 1.0.x
877
- * @param int $user_id User ID.
878
- * @return void
879
- */
880
- public function save_user( $user_id ) {
881
- // check permissions.
882
- if ( $this->can_save( 'user' ) ) {
883
- $this->cmb->save_fields( $user_id, 'user', $_POST );
884
- }
885
- }
886
-
887
- /**
888
- * Save data from term fields
889
- *
890
- * @since 2.2.0
891
- * @param int $term_id Term ID.
892
- * @param int $tt_id Term Taxonomy ID.
893
- * @param string $taxonomy Taxonomy.
894
- * @return void
895
- */
896
- public function save_term( $term_id, $tt_id, $taxonomy = '' ) {
897
- $taxonomy = $taxonomy ? $taxonomy : $tt_id;
898
-
899
- // check permissions.
900
- if ( $this->taxonomy_can_save( $taxonomy ) && $this->can_save( 'term' ) ) {
901
- $this->cmb->save_fields( $term_id, 'term', $_POST );
902
- }
903
- }
904
-
905
- /**
906
- * Delete term meta when a term is deleted.
907
- *
908
- * @since 2.2.0
909
- * @param int $term_id Term ID.
910
- * @param int $tt_id Term Taxonomy ID.
911
- * @param string $taxonomy Taxonomy.
912
- * @return void
913
- */
914
- public function delete_term( $term_id, $tt_id, $taxonomy = '' ) {
915
- if ( $this->taxonomy_can_save( $taxonomy ) ) {
916
-
917
- $data_to_delete = array();
918
- foreach ( $this->cmb->prop( 'fields' ) as $field ) {
919
- $data_to_delete[ $field['id'] ] = '';
920
- }
921
-
922
- $this->cmb->save_fields( $term_id, 'term', $data_to_delete );
923
- }
924
- }
925
-
926
- /**
927
- * Determines if the current object is able to be saved.
928
- *
929
- * @since 2.0.9
930
- * @param string $type Current object type.
931
- * @return bool Whether object can be saved.
932
- */
933
- public function can_save( $type = '' ) {
934
-
935
- $can_save = (
936
- $this->cmb->prop( 'save_fields' )
937
- // check nonce.
938
- && isset( $_POST[ $this->cmb->nonce() ] )
939
- && wp_verify_nonce( $_POST[ $this->cmb->nonce() ], $this->cmb->nonce() )
940
- // check if autosave.
941
- && ! ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
942
- // get the metabox types & compare it to this type.
943
- && ( $type && in_array( $type, $this->cmb->box_types() ) )
944
- // Don't do updates during a switch-to-blog instance.
945
- && ! ( is_multisite() && ms_is_switched() )
946
- );
947
-
948
- /**
949
- * Filter to determine if metabox is allowed to save.
950
- *
951
- * @param bool $can_save Whether the current metabox can save.
952
- * @param object $cmb The CMB2 instance.
953
- */
954
- return apply_filters( 'cmb2_can_save', $can_save, $this->cmb );
955
- }
956
-
957
- /**
958
- * Determine if taxonomy of term being modified is cmb2-editable.
959
- *
960
- * @since 2.2.0
961
- *
962
- * @param string $taxonomy Taxonomy of term being modified.
963
- * @return bool Whether taxonomy is editable.
964
- */
965
- public function taxonomy_can_save( $taxonomy ) {
966
- if ( empty( $this->taxonomies ) || ! in_array( $taxonomy, $this->taxonomies ) ) {
967
- return false;
968
- }
969
-
970
- $taxonomy_object = get_taxonomy( $taxonomy );
971
- // Can the user edit this term?
972
- if ( ! isset( $taxonomy_object->cap ) || ! current_user_can( $taxonomy_object->cap->edit_terms ) ) {
973
- return false;
974
- }
975
-
976
- return true;
977
- }
978
-
979
- /**
980
- * Enqueues the 'cmb2-display-styles' if the conditions match (has columns, on the right page, etc).
981
- *
982
- * @since 2.2.2.1
983
- */
984
- protected function maybe_enqueue_column_display_styles() {
985
- global $pagenow;
986
- if (
987
- $pagenow
988
- && $this->cmb->has_columns
989
- && $this->cmb->prop( 'cmb_styles' )
990
- && in_array( $pagenow, array( 'edit.php', 'users.php', 'edit-comments.php', 'edit-tags.php' ), 1 )
991
- ) {
992
- self::enqueue_cmb_css( 'cmb2-display-styles' );
993
- }
994
- }
995
-
996
- /**
997
- * Includes CMB2 styles.
998
- *
999
- * @since 2.0.0
1000
- *
1001
- * @param string $handle CSS handle.
1002
- * @return mixed
1003
- */
1004
- public static function enqueue_cmb_css( $handle = 'cmb2-styles' ) {
1005
-
1006
- /**
1007
- * Filter to determine if CMB2'S css should be enqueued.
1008
- *
1009
- * @param bool $enqueue_css Default is true.
1010
- */
1011
- if ( ! apply_filters( 'cmb2_enqueue_css', true ) ) {
1012
- return false;
1013
- }
1014
-
1015
- self::register_styles();
1016
-
1017
- /*
1018
- * White list the options as this method can be used as a hook callback
1019
- * and have a different argument passed.
1020
- */
1021
- return wp_enqueue_style( 'cmb2-display-styles' === $handle ? $handle : 'cmb2-styles' );
1022
- }
1023
-
1024
- /**
1025
- * Includes CMB2 JS.
1026
- *
1027
- * @since 2.0.0
1028
- */
1029
- public static function enqueue_cmb_js() {
1030
-
1031
- /**
1032
- * Filter to determine if CMB2'S JS should be enqueued.
1033
- *
1034
- * @param bool $enqueue_js Default is true.
1035
- */
1036
- if ( ! apply_filters( 'cmb2_enqueue_js', true ) ) {
1037
- return false;
1038
- }
1039
-
1040
- self::register_js();
1041
- return true;
1042
- }
1043
-
1044
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/helper-functions.php DELETED
@@ -1,427 +0,0 @@
1
- <?php
2
- /**
3
- * CMB2 Helper Functions
4
- *
5
- * @category WordPress_Plugin
6
- * @package CMB2
7
- * @author CMB2 team
8
- * @license GPL-2.0+
9
- * @link https://cmb2.io
10
- */
11
-
12
- /**
13
- * Helper function to provide directory path to CMB2
14
- *
15
- * @since 2.0.0
16
- * @param string $path Path to append.
17
- * @return string Directory with optional path appended
18
- */
19
- function cmb2_dir( $path = '' ) {
20
- return CMB2_DIR . $path;
21
- }
22
-
23
- /**
24
- * Autoloads files with CMB2 classes when needed
25
- *
26
- * @since 1.0.0
27
- * @param string $class_name Name of the class being requested.
28
- */
29
- function cmb2_autoload_classes( $class_name ) {
30
- if ( 0 !== strpos( $class_name, 'CMB2' ) ) {
31
- return;
32
- }
33
-
34
- $path = 'includes';
35
-
36
- if ( 'CMB2_Type' === $class_name || 0 === strpos( $class_name, 'CMB2_Type_' ) ) {
37
- $path .= '/types';
38
- }
39
-
40
- if ( 'CMB2_REST' === $class_name || 0 === strpos( $class_name, 'CMB2_REST_' ) ) {
41
- $path .= '/rest-api';
42
- }
43
-
44
- include_once( cmb2_dir( "$path/{$class_name}.php" ) );
45
- }
46
-
47
- /**
48
- * Get instance of the CMB2_Utils class
49
- *
50
- * @since 2.0.0
51
- * @return CMB2_Utils object CMB2 utilities class
52
- */
53
- function cmb2_utils() {
54
- static $cmb2_utils;
55
- $cmb2_utils = $cmb2_utils ? $cmb2_utils : new CMB2_Utils();
56
- return $cmb2_utils;
57
- }
58
-
59
- /**
60
- * Get instance of the CMB2_Ajax class
61
- *
62
- * @since 2.0.0
63
- * @return CMB2_Ajax object CMB2 ajax class
64
- */
65
- function cmb2_ajax() {
66
- return CMB2_Ajax::get_instance();
67
- }
68
-
69
- /**
70
- * Get instance of the CMB2_Option class for the passed metabox ID
71
- *
72
- * @since 2.0.0
73
- *
74
- * @param string $key Option key to fetch.
75
- * @return CMB2_Option object Options class for setting/getting options for metabox
76
- */
77
- function cmb2_options( $key ) {
78
- return CMB2_Options::get( $key );
79
- }
80
-
81
- /**
82
- * Get a cmb oEmbed. Handles oEmbed getting for non-post objects
83
- *
84
- * @since 2.0.0
85
- * @param array $args Arguments. Accepts:
86
- *
87
- * 'url' - URL to retrieve the oEmbed from,
88
- * 'object_id' - $post_id,
89
- * 'object_type' - 'post',
90
- * 'oembed_args' - $embed_args, // array containing 'width', etc
91
- * 'field_id' - false,
92
- * 'cache_key' - false,
93
- * 'wp_error' - true/false, // To return a wp_error object if no embed found.
94
- *
95
- * @return string oEmbed string
96
- */
97
- function cmb2_get_oembed( $args = array() ) {
98
- $oembed = cmb2_ajax()->get_oembed_no_edit( $args );
99
-
100
- // Send back our embed.
101
- if ( $oembed['embed'] && $oembed['embed'] != $oembed['fallback'] ) {
102
- return '<div class="cmb2-oembed">' . $oembed['embed'] . '</div>';
103
- }
104
-
105
- $error = sprintf(
106
- /* translators: 1: results for. 2: link to codex.wordpress.org/Embeds */
107
- esc_html__( 'No oEmbed Results Found for %1$s. View more info at %2$s.', 'cmb2' ),
108
- $oembed['fallback'],
109
- '<a href="https://wordpress.org/support/article/embeds/" target="_blank">codex.wordpress.org/Embeds</a>'
110
- );
111
-
112
- if ( isset( $args['wp_error'] ) && $args['wp_error'] ) {
113
- return new WP_Error( 'cmb2_get_oembed_result', $error, compact( 'oembed', 'args' ) );
114
- }
115
-
116
- // Otherwise, send back error info that no oEmbeds were found.
117
- return '<p class="ui-state-error-text">' . $error . '</p>';
118
- }
119
-
120
- /**
121
- * Outputs the return of cmb2_get_oembed.
122
- *
123
- * @since 2.2.2
124
- * @see cmb2_get_oembed
125
- *
126
- * @param array $args oEmbed args.
127
- */
128
- function cmb2_do_oembed( $args = array() ) {
129
- echo cmb2_get_oembed( $args );
130
- }
131
- add_action( 'cmb2_do_oembed', 'cmb2_do_oembed' );
132
-
133
- /**
134
- * A helper function to get an option from a CMB2 options array
135
- *
136
- * @since 1.0.1
137
- * @param string $option_key Option key.
138
- * @param string $field_id Option array field key.
139
- * @param mixed $default Optional default fallback value.
140
- * @return array Options array or specific field
141
- */
142
- function cmb2_get_option( $option_key, $field_id = '', $default = false ) {
143
- return cmb2_options( $option_key )->get( $field_id, $default );
144
- }
145
-
146
- /**
147
- * A helper function to update an option in a CMB2 options array
148
- *
149
- * @since 2.0.0
150
- * @param string $option_key Option key.
151
- * @param string $field_id Option array field key.
152
- * @param mixed $value Value to update data with.
153
- * @param boolean $single Whether data should not be an array.
154
- * @return boolean Success/Failure
155
- */
156
- function cmb2_update_option( $option_key, $field_id, $value, $single = true ) {
157
- if ( cmb2_options( $option_key )->update( $field_id, $value, false, $single ) ) {
158
- return cmb2_options( $option_key )->set();
159
- }
160
-
161
- return false;
162
- }
163
-
164
- /**
165
- * Get a CMB2 field object.
166
- *
167
- * @since 1.1.0
168
- * @param array $meta_box Metabox ID or Metabox config array.
169
- * @param array $field_id Field ID or all field arguments.
170
- * @param int|string $object_id Object ID (string for options-page).
171
- * @param string $object_type Type of object being saved. (e.g., post, user, term, comment, or options-page).
172
- * Defaults to metabox object type.
173
- * @return CMB2_Field|null CMB2_Field object unless metabox config cannot be found
174
- */
175
- function cmb2_get_field( $meta_box, $field_id, $object_id = 0, $object_type = '' ) {
176
-
177
- $object_id = $object_id ? $object_id : get_the_ID();
178
- $cmb = $meta_box instanceof CMB2 ? $meta_box : cmb2_get_metabox( $meta_box, $object_id );
179
-
180
- if ( ! $cmb ) {
181
- return;
182
- }
183
-
184
- $cmb->object_type( $object_type ? $object_type : $cmb->mb_object_type() );
185
-
186
- return $cmb->get_field( $field_id );
187
- }
188
-
189
- /**
190
- * Get a field's value.
191
- *
192
- * @since 1.1.0
193
- * @param array $meta_box Metabox ID or Metabox config array.
194
- * @param array $field_id Field ID or all field arguments.
195
- * @param int|string $object_id Object ID (string for options-page).
196
- * @param string $object_type Type of object being saved. (e.g., post, user, term, comment, or options-page).
197
- * Defaults to metabox object type.
198
- * @return mixed Maybe escaped value
199
- */
200
- function cmb2_get_field_value( $meta_box, $field_id, $object_id = 0, $object_type = '' ) {
201
- $field = cmb2_get_field( $meta_box, $field_id, $object_id, $object_type );
202
- return $field->escaped_value();
203
- }
204
-
205
- /**
206
- * Because OOP can be scary
207
- *
208
- * @since 2.0.2
209
- * @param array $meta_box_config Metabox Config array.
210
- * @return CMB2 object Instantiated CMB2 object
211
- */
212
- function new_cmb2_box( array $meta_box_config ) {
213
- return cmb2_get_metabox( $meta_box_config );
214
- }
215
-
216
- /**
217
- * Retrieve a CMB2 instance by the metabox ID
218
- *
219
- * @since 2.0.0
220
- * @param mixed $meta_box Metabox ID or Metabox config array.
221
- * @param int|string $object_id Object ID (string for options-page).
222
- * @param string $object_type Type of object being saved.
223
- * (e.g., post, user, term, comment, or options-page).
224
- * Defaults to metabox object type.
225
- * @return CMB2 object
226
- */
227
- function cmb2_get_metabox( $meta_box, $object_id = 0, $object_type = '' ) {
228
-
229
- if ( $meta_box instanceof CMB2 ) {
230
- return $meta_box;
231
- }
232
-
233
- if ( is_string( $meta_box ) ) {
234
- $cmb = CMB2_Boxes::get( $meta_box );
235
- } else {
236
- // See if we already have an instance of this metabox.
237
- $cmb = CMB2_Boxes::get( $meta_box['id'] );
238
- // If not, we'll initate a new metabox.
239
- $cmb = $cmb ? $cmb : new CMB2( $meta_box, $object_id );
240
- }
241
-
242
- if ( $cmb && $object_id ) {
243
- $cmb->object_id( $object_id );
244
- }
245
-
246
- if ( $cmb && $object_type ) {
247
- $cmb->object_type( $object_type );
248
- }
249
-
250
- return $cmb;
251
- }
252
-
253
- /**
254
- * Returns array of sanitized field values from a metabox (without saving them)
255
- *
256
- * @since 2.0.3
257
- * @param mixed $meta_box Metabox ID or Metabox config array.
258
- * @param array $data_to_sanitize Array of field_id => value data for sanitizing (likely $_POST data).
259
- * @return mixed Array of sanitized values or false if no CMB2 object found
260
- */
261
- function cmb2_get_metabox_sanitized_values( $meta_box, array $data_to_sanitize ) {
262
- $cmb = cmb2_get_metabox( $meta_box );
263
- return $cmb ? $cmb->get_sanitized_values( $data_to_sanitize ) : false;
264
- }
265
-
266
- /**
267
- * Retrieve a metabox form
268
- *
269
- * @since 2.0.0
270
- * @param mixed $meta_box Metabox config array or Metabox ID.
271
- * @param int|string $object_id Object ID (string for options-page).
272
- * @param array $args Optional arguments array.
273
- * @return string CMB2 html form markup
274
- */
275
- function cmb2_get_metabox_form( $meta_box, $object_id = 0, $args = array() ) {
276
-
277
- $object_id = $object_id ? $object_id : get_the_ID();
278
- $cmb = cmb2_get_metabox( $meta_box, $object_id );
279
-
280
- ob_start();
281
- // Get cmb form.
282
- cmb2_print_metabox_form( $cmb, $object_id, $args );
283
- $form = ob_get_clean();
284
-
285
- return apply_filters( 'cmb2_get_metabox_form', $form, $object_id, $cmb );
286
- }
287
-
288
- /**
289
- * Display a metabox form & save it on submission
290
- *
291
- * @since 1.0.0
292
- * @param mixed $meta_box Metabox config array or Metabox ID.
293
- * @param int|string $object_id Object ID (string for options-page).
294
- * @param array $args Optional arguments array.
295
- */
296
- function cmb2_print_metabox_form( $meta_box, $object_id = 0, $args = array() ) {
297
-
298
- $object_id = $object_id ? $object_id : get_the_ID();
299
- $cmb = cmb2_get_metabox( $meta_box, $object_id );
300
-
301
- // if passing a metabox ID, and that ID was not found.
302
- if ( ! $cmb ) {
303
- return;
304
- }
305
-
306
- $args = wp_parse_args( $args, array(
307
- 'form_format' => '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="object_id" value="%2$s">%3$s<input type="submit" name="submit-cmb" value="%4$s" class="button-primary"></form>',
308
- 'save_button' => esc_html__( 'Save', 'cmb2' ),
309
- 'object_type' => $cmb->mb_object_type(),
310
- 'cmb_styles' => $cmb->prop( 'cmb_styles' ),
311
- 'enqueue_js' => $cmb->prop( 'enqueue_js' ),
312
- ) );
313
-
314
- // Set object type explicitly (rather than trying to guess from context).
315
- $cmb->object_type( $args['object_type'] );
316
-
317
- // Save the metabox if it's been submitted
318
- // check permissions
319
- // @todo more hardening?
320
- if (
321
- $cmb->prop( 'save_fields' )
322
- // check nonce.
323
- && isset( $_POST['submit-cmb'], $_POST['object_id'], $_POST[ $cmb->nonce() ] )
324
- && wp_verify_nonce( $_POST[ $cmb->nonce() ], $cmb->nonce() )
325
- && $object_id && $_POST['object_id'] == $object_id
326
- ) {
327
- $cmb->save_fields( $object_id, $cmb->object_type(), $_POST );
328
- }
329
-
330
- // Enqueue JS/CSS.
331
- if ( $args['cmb_styles'] ) {
332
- CMB2_Hookup::enqueue_cmb_css();
333
- }
334
-
335
- if ( $args['enqueue_js'] ) {
336
- CMB2_Hookup::enqueue_cmb_js();
337
- }
338
-
339
- $form_format = apply_filters( 'cmb2_get_metabox_form_format', $args['form_format'], $object_id, $cmb );
340
-
341
- $format_parts = explode( '%3$s', $form_format );
342
-
343
- // Show cmb form.
344
- printf( $format_parts[0], esc_attr( $cmb->cmb_id ), esc_attr( $object_id ) );
345
- $cmb->show_form();
346
-
347
- if ( isset( $format_parts[1] ) && $format_parts[1] ) {
348
- printf( str_ireplace( '%4$s', '%1$s', $format_parts[1] ), esc_attr( $args['save_button'] ) );
349
- }
350
-
351
- }
352
-
353
- /**
354
- * Display a metabox form (or optionally return it) & save it on submission.
355
- *
356
- * @since 1.0.0
357
- * @param mixed $meta_box Metabox config array or Metabox ID.
358
- * @param int|string $object_id Object ID (string for options-page).
359
- * @param array $args Optional arguments array.
360
- * @return string
361
- */
362
- function cmb2_metabox_form( $meta_box, $object_id = 0, $args = array() ) {
363
- if ( ! isset( $args['echo'] ) || $args['echo'] ) {
364
- cmb2_print_metabox_form( $meta_box, $object_id, $args );
365
- } else {
366
- return cmb2_get_metabox_form( $meta_box, $object_id, $args );
367
- }
368
- }
369
-
370
- if ( ! function_exists( 'date_create_from_format' ) ) {
371
-
372
- /**
373
- * Reimplementation of DateTime::createFromFormat for PHP < 5.3. :(
374
- * Borrowed from http://stackoverflow.com/questions/5399075/php-datetimecreatefromformat-in-5-2
375
- *
376
- * @param string $date_format Date format.
377
- * @param string $date_value Date value.
378
- *
379
- * @return DateTime
380
- */
381
- function date_create_from_format( $date_format, $date_value ) {
382
-
383
- $schedule_format = str_replace(
384
- array( 'M', 'Y', 'm', 'd', 'H', 'i', 'a' ),
385
- array( '%b', '%Y', '%m', '%d', '%H', '%M', '%p' ),
386
- $date_format
387
- );
388
-
389
- /*
390
- * %Y, %m and %d correspond to date()'s Y m and d.
391
- * %I corresponds to H, %M to i and %p to a
392
- */
393
- $parsed_time = strptime( $date_value, $schedule_format );
394
-
395
- $ymd = sprintf(
396
- /**
397
- * This is a format string that takes six total decimal
398
- * arguments, then left-pads them with zeros to either
399
- * 4 or 2 characters, as needed
400
- */
401
- '%04d-%02d-%02d %02d:%02d:%02d',
402
- $parsed_time['tm_year'] + 1900, // This will be "111", so we need to add 1900.
403
- $parsed_time['tm_mon'] + 1, // This will be the month minus one, so we add one.
404
- $parsed_time['tm_mday'],
405
- $parsed_time['tm_hour'],
406
- $parsed_time['tm_min'],
407
- $parsed_time['tm_sec']
408
- );
409
-
410
- return new DateTime( $ymd );
411
- }
412
- }// End if.
413
-
414
- if ( ! function_exists( 'date_timestamp_get' ) ) {
415
-
416
- /**
417
- * Returns the Unix timestamp representing the date.
418
- * Reimplementation of DateTime::getTimestamp for PHP < 5.3. :(
419
- *
420
- * @param DateTime $date DateTime instance.
421
- *
422
- * @return int
423
- */
424
- function date_timestamp_get( DateTime $date ) {
425
- return $date->format( 'U' );
426
- }
427
- }// End if.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/index.php DELETED
@@ -1,2 +0,0 @@
1
- <?php
2
- // Silence is golden
 
 
includes/lib/cmb2/includes/rest-api/CMB2_REST.php DELETED
@@ -1,865 +0,0 @@
1
- <?php
2
- /**
3
- * Handles hooking CMB2 objects/fields into the WordPres REST API
4
- * which can allow fields to be read and/or updated.
5
- *
6
- * @since 2.2.3
7
- *
8
- * @category WordPress_Plugin
9
- * @package CMB2
10
- * @author CMB2 team
11
- * @license GPL-2.0+
12
- * @link https://cmb2.io
13
- *
14
- * @property-read read_fields Array of readable field objects.
15
- * @property-read edit_fields Array of editable field objects.
16
- * @property-read rest_read Whether CMB2 object is readable via the rest api.
17
- * @property-read rest_edit Whether CMB2 object is editable via the rest api.
18
- */
19
- class CMB2_REST extends CMB2_Hookup_Base {
20
-
21
- /**
22
- * The current CMB2 REST endpoint version
23
- *
24
- * @var string
25
- * @since 2.2.3
26
- */
27
- const VERSION = '1';
28
-
29
- /**
30
- * The CMB2 REST base namespace (v should always be followed by $version)
31
- *
32
- * @var string
33
- * @since 2.2.3
34
- */
35
- const NAME_SPACE = 'cmb2/v1';
36
-
37
- /**
38
- * @var CMB2 object
39
- * @since 2.2.3
40
- */
41
- public $cmb;
42
-
43
- /**
44
- * @var CMB2_REST[] objects
45
- * @since 2.2.3
46
- */
47
- protected static $boxes = array();
48
-
49
- /**
50
- * @var array Array of cmb ids for each type.
51
- * @since 2.2.3
52
- */
53
- protected static $type_boxes = array(
54
- 'post' => array(),
55
- 'user' => array(),
56
- 'comment' => array(),
57
- 'term' => array(),
58
- );
59
-
60
- /**
61
- * Array of readable field objects.
62
- *
63
- * @var CMB2_Field[]
64
- * @since 2.2.3
65
- */
66
- protected $read_fields = array();
67
-
68
- /**
69
- * Array of editable field objects.
70
- *
71
- * @var CMB2_Field[]
72
- * @since 2.2.3
73
- */
74
- protected $edit_fields = array();
75
-
76
- /**
77
- * Whether CMB2 object is readable via the rest api.
78
- *
79
- * @var boolean
80
- */
81
- protected $rest_read = false;
82
-
83
- /**
84
- * Whether CMB2 object is editable via the rest api.
85
- *
86
- * @var boolean
87
- */
88
- protected $rest_edit = false;
89
-
90
- /**
91
- * A functionalized constructor, used for the hookup action callbacks.
92
- *
93
- * @since 2.2.6
94
- *
95
- * @param CMB2 $cmb The CMB2 object to hookup
96
- *
97
- * @return CMB2_Hookup_Base $hookup The hookup object.
98
- */
99
- public static function maybe_init_and_hookup( CMB2 $cmb ) {
100
- if ( $cmb->prop( 'show_in_rest' ) && function_exists( 'rest_get_server' ) ) {
101
-
102
- $hookup = new self( $cmb );
103
-
104
- return $hookup->universal_hooks();
105
- }
106
-
107
- return false;
108
- }
109
-
110
- /**
111
- * Constructor
112
- *
113
- * @since 2.2.3
114
- *
115
- * @param CMB2 $cmb The CMB2 object to be registered for the API.
116
- */
117
- public function __construct( CMB2 $cmb ) {
118
- $this->cmb = $cmb;
119
- self::$boxes[ $cmb->cmb_id ] = $this;
120
-
121
- $show_value = $this->cmb->prop( 'show_in_rest' );
122
-
123
- $this->rest_read = self::is_readable( $show_value );
124
- $this->rest_edit = self::is_editable( $show_value );
125
- }
126
-
127
- /**
128
- * Hooks to register on frontend and backend.
129
- *
130
- * @since 2.2.3
131
- *
132
- * @return void
133
- */
134
- public function universal_hooks() {
135
- // hook up the CMB rest endpoint classes
136
- $this->once( 'rest_api_init', array( __CLASS__, 'init_routes' ), 0 );
137
-
138
- if ( function_exists( 'register_rest_field' ) ) {
139
- $this->once( 'rest_api_init', array( __CLASS__, 'register_cmb2_fields' ), 50 );
140
- }
141
-
142
- $this->declare_read_edit_fields();
143
-
144
- add_filter( 'is_protected_meta', array( $this, 'is_protected_meta' ), 10, 3 );
145
-
146
- return $this;
147
- }
148
-
149
- /**
150
- * Initiate the CMB2 Boxes and Fields routes
151
- *
152
- * @since 2.2.3
153
- *
154
- * @return void
155
- */
156
- public static function init_routes() {
157
- $wp_rest_server = rest_get_server();
158
-
159
- $boxes_controller = new CMB2_REST_Controller_Boxes( $wp_rest_server );
160
- $boxes_controller->register_routes();
161
-
162
- $fields_controller = new CMB2_REST_Controller_Fields( $wp_rest_server );
163
- $fields_controller->register_routes();
164
- }
165
-
166
- /**
167
- * Loop through REST boxes and call register_rest_field for each object type.
168
- *
169
- * @since 2.2.3
170
- *
171
- * @return void
172
- */
173
- public static function register_cmb2_fields() {
174
- $alltypes = $taxonomies = array();
175
-
176
- foreach ( self::$boxes as $cmb_id => $rest_box ) {
177
-
178
- // Hook box specific filter callbacks.
179
- $callback = $rest_box->cmb->prop( 'register_rest_field_cb' );
180
- if ( is_callable( $callback ) ) {
181
- call_user_func( $callback, $rest_box );
182
- continue;
183
- }
184
-
185
- $types = array_flip( $rest_box->cmb->box_types( array( 'post' ) ) );
186
-
187
- if ( isset( $types['user'] ) ) {
188
- unset( $types['user'] );
189
- self::$type_boxes['user'][ $cmb_id ] = $cmb_id;
190
- }
191
-
192
- if ( isset( $types['comment'] ) ) {
193
- unset( $types['comment'] );
194
- self::$type_boxes['comment'][ $cmb_id ] = $cmb_id;
195
- }
196
-
197
- if ( isset( $types['term'] ) ) {
198
- unset( $types['term'] );
199
-
200
- $taxonomies = array_merge(
201
- $taxonomies,
202
- CMB2_Utils::ensure_array( $rest_box->cmb->prop( 'taxonomies' ) )
203
- );
204
-
205
- self::$type_boxes['term'][ $cmb_id ] = $cmb_id;
206
- }
207
-
208
- if ( ! empty( $types ) ) {
209
- $alltypes = array_merge( $alltypes, array_flip( $types ) );
210
- self::$type_boxes['post'][ $cmb_id ] = $cmb_id;
211
- }
212
- }
213
-
214
- $alltypes = array_unique( $alltypes );
215
-
216
- if ( ! empty( $alltypes ) ) {
217
- self::register_rest_field( $alltypes, 'post' );
218
- }
219
-
220
- if ( ! empty( self::$type_boxes['user'] ) ) {
221
- self::register_rest_field( 'user', 'user' );
222
- }
223
-
224
- if ( ! empty( self::$type_boxes['comment'] ) ) {
225
- self::register_rest_field( 'comment', 'comment' );
226
- }
227
-
228
- if ( ! empty( self::$type_boxes['term'] ) ) {
229
- self::register_rest_field( $taxonomies, 'term' );
230
- }
231
- }
232
-
233
- /**
234
- * Wrapper for register_rest_field.
235
- *
236
- * @since 2.2.3
237
- *
238
- * @param string|array $object_types Object(s) the field is being registered
239
- * to, "post"|"term"|"comment" etc.
240
- * @param string $object_types Canonical object type for callbacks.
241
- *
242
- * @return void
243
- */
244
- protected static function register_rest_field( $object_types, $object_type ) {
245
- register_rest_field( $object_types, 'cmb2', array(
246
- 'get_callback' => array( __CLASS__, "get_{$object_type}_rest_values" ),
247
- 'update_callback' => array( __CLASS__, "update_{$object_type}_rest_values" ),
248
- 'schema' => null, // @todo add schema
249
- ) );
250
- }
251
-
252
- /**
253
- * Setup readable and editable fields.
254
- *
255
- * @since 2.2.3
256
- *
257
- * @return void
258
- */
259
- protected function declare_read_edit_fields() {
260
- foreach ( $this->cmb->prop( 'fields' ) as $field ) {
261
- $show_in_rest = isset( $field['show_in_rest'] ) ? $field['show_in_rest'] : null;
262
-
263
- if ( false === $show_in_rest ) {
264
- continue;
265
- }
266
-
267
- if ( $this->can_read( $show_in_rest ) ) {
268
- $this->read_fields[] = $field['id'];
269
- }
270
-
271
- if ( $this->can_edit( $show_in_rest ) ) {
272
- $this->edit_fields[] = $field['id'];
273
- }
274
- }
275
- }
276
-
277
- /**
278
- * Determines if a field is readable based on it's show_in_rest value
279
- * and the box's show_in_rest value.
280
- *
281
- * @since 2.2.3
282
- *
283
- * @param bool $show_in_rest Field's show_in_rest value. Default null.
284
- *
285
- * @return bool Whether field is readable.
286
- */
287
- protected function can_read( $show_in_rest ) {
288
- // if 'null', then use default box value.
289
- if ( null === $show_in_rest ) {
290
- return $this->rest_read;
291
- }
292
-
293
- // Else check if the value represents readable.
294
- return self::is_readable( $show_in_rest );
295
- }
296
-
297
- /**
298
- * Determines if a field is editable based on it's show_in_rest value
299
- * and the box's show_in_rest value.
300
- *
301
- * @since 2.2.3
302
- *
303
- * @param bool $show_in_rest Field's show_in_rest value. Default null.
304
- *
305
- * @return bool Whether field is editable.
306
- */
307
- protected function can_edit( $show_in_rest ) {
308
- // if 'null', then use default box value.
309
- if ( null === $show_in_rest ) {
310
- return $this->rest_edit;
311
- }
312
-
313
- // Else check if the value represents editable.
314
- return self::is_editable( $show_in_rest );
315
- }
316
-
317
- /**
318
- * Handler for getting post custom field data.
319
- *
320
- * @since 2.2.3
321
- *
322
- * @param array $object The object data from the response
323
- * @param string $field_name Name of field
324
- * @param WP_REST_Request $request Current request
325
- * @param string $object_type The request object type
326
- *
327
- * @return mixed
328
- */
329
- public static function get_post_rest_values( $object, $field_name, $request, $object_type ) {
330
- if ( 'cmb2' === $field_name ) {
331
- return self::get_rest_values( $object, $request, $object_type, 'post' );
332
- }
333
- }
334
-
335
- /**
336
- * Handler for getting user custom field data.
337
- *
338
- * @since 2.2.3
339
- *
340
- * @param array $object The object data from the response
341
- * @param string $field_name Name of field
342
- * @param WP_REST_Request $request Current request
343
- * @param string $object_type The request object type
344
- *
345
- * @return mixed
346
- */
347
- public static function get_user_rest_values( $object, $field_name, $request, $object_type ) {
348
- if ( 'cmb2' === $field_name ) {
349
- return self::get_rest_values( $object, $request, $object_type, 'user' );
350
- }
351
- }
352
-
353
- /**
354
- * Handler for getting comment custom field data.
355
- *
356
- * @since 2.2.3
357
- *
358
- * @param array $object The object data from the response
359
- * @param string $field_name Name of field
360
- * @param WP_REST_Request $request Current request
361
- * @param string $object_type The request object type
362
- *
363
- * @return mixed
364
- */
365
- public static function get_comment_rest_values( $object, $field_name, $request, $object_type ) {
366
- if ( 'cmb2' === $field_name ) {
367
- return self::get_rest_values( $object, $request, $object_type, 'comment' );
368
- }
369
- }
370
-
371
- /**
372
- * Handler for getting term custom field data.
373
- *
374
- * @since 2.2.3
375
- *
376
- * @param array $object The object data from the response
377
- * @param string $field_name Name of field
378
- * @param WP_REST_Request $request Current request
379
- * @param string $object_type The request object type
380
- *
381
- * @return mixed
382
- */
383
- public static function get_term_rest_values( $object, $field_name, $request, $object_type ) {
384
- if ( 'cmb2' === $field_name ) {
385
- return self::get_rest_values( $object, $request, $object_type, 'term' );
386
- }
387
- }
388
-
389
- /**
390
- * Handler for getting custom field data.
391
- *
392
- * @since 2.2.3
393
- *
394
- * @param array $object The object data from the response
395
- * @param WP_REST_Request $request Current request
396
- * @param string $object_type The request object type
397
- * @param string $main_object_type The cmb main object type
398
- *
399
- * @return mixed
400
- */
401
- protected static function get_rest_values( $object, $request, $object_type, $main_object_type = 'post' ) {
402
- if ( ! isset( $object['id'] ) ) {
403
- return;
404
- }
405
-
406
- $values = array();
407
-
408
- if ( ! empty( self::$type_boxes[ $main_object_type ] ) ) {
409
- foreach ( self::$type_boxes[ $main_object_type ] as $cmb_id ) {
410
- $rest_box = self::$boxes[ $cmb_id ];
411
-
412
- if ( ! $rest_box->cmb->is_box_type( $object_type ) ) {
413
- continue;
414
- }
415
-
416
- $result = self::get_box_rest_values( $rest_box, $object['id'], $main_object_type );
417
- if ( ! empty( $result ) ) {
418
- if ( empty( $values[ $cmb_id ] ) ) {
419
- $values[ $cmb_id ] = $result;
420
- } else {
421
- $values[ $cmb_id ] = array_merge( $values[ $cmb_id ], $result );
422
- }
423
- }
424
- }
425
- }
426
-
427
- return $values;
428
- }
429
-
430
- /**
431
- * Get box rest values.
432
- *
433
- * @since 2.7.0
434
- *
435
- * @param CMB2_REST $rest_box The CMB2_REST object.
436
- * @param integer $object_id The object ID.
437
- * @param string $main_object_type The object type (post, user, term, etc)
438
- *
439
- * @return array Array of box rest values.
440
- */
441
- public static function get_box_rest_values( $rest_box, $object_id = 0, $main_object_type = 'post' ) {
442
-
443
- $rest_box->cmb->object_id( $object_id );
444
- $rest_box->cmb->object_type( $main_object_type );
445
-
446
- $values = array();
447
-
448
- foreach ( $rest_box->read_fields as $field_id ) {
449
- $field = $rest_box->cmb->get_field( $field_id );
450
- $field->object_id( $object_id );
451
- $field->object_type( $main_object_type );
452
-
453
- $values[ $field->id( true ) ] = $field->get_rest_value();
454
-
455
- if ( $field->args( 'has_supporting_data' ) ) {
456
- $field = $field->get_supporting_field();
457
- $values[ $field->id( true ) ] = $field->get_rest_value();
458
- }
459
- }
460
-
461
- return $values;
462
- }
463
-
464
- /**
465
- * Handler for updating post custom field data.
466
- *
467
- * @since 2.2.3
468
- *
469
- * @param mixed $values The value of the field
470
- * @param object $object The object from the response
471
- * @param string $field_name Name of field
472
- * @param WP_REST_Request $request Current request
473
- * @param string $object_type The request object type
474
- *
475
- * @return bool|int
476
- */
477
- public static function update_post_rest_values( $values, $object, $field_name, $request, $object_type ) {
478
- if ( 'cmb2' === $field_name ) {
479
- return self::update_rest_values( $values, $object, $request, $object_type, 'post' );
480
- }
481
- }
482
-
483
- /**
484
- * Handler for updating user custom field data.
485
- *
486
- * @since 2.2.3
487
- *
488
- * @param mixed $values The value of the field
489
- * @param object $object The object from the response
490
- * @param string $field_name Name of field
491
- * @param WP_REST_Request $request Current request
492
- * @param string $object_type The request object type
493
- *
494
- * @return bool|int
495
- */
496
- public static function update_user_rest_values( $values, $object, $field_name, $request, $object_type ) {
497
- if ( 'cmb2' === $field_name ) {
498
- return self::update_rest_values( $values, $object, $request, $object_type, 'user' );
499
- }
500
- }
501
-
502
- /**
503
- * Handler for updating comment custom field data.
504
- *
505
- * @since 2.2.3
506
- *
507
- * @param mixed $values The value of the field
508
- * @param object $object The object from the response
509
- * @param string $field_name Name of field
510
- * @param WP_REST_Request $request Current request
511
- * @param string $object_type The request object type
512
- *
513
- * @return bool|int
514
- */
515
- public static function update_comment_rest_values( $values, $object, $field_name, $request, $object_type ) {
516
- if ( 'cmb2' === $field_name ) {
517
- return self::update_rest_values( $values, $object, $request, $object_type, 'comment' );
518
- }
519
- }
520
-
521
- /**
522
- * Handler for updating term custom field data.
523
- *
524
- * @since 2.2.3
525
- *
526
- * @param mixed $values The value of the field
527
- * @param object $object The object from the response
528
- * @param string $field_name Name of field
529
- * @param WP_REST_Request $request Current request
530
- * @param string $object_type The request object type
531
- *
532
- * @return bool|int
533
- */
534
- public static function update_term_rest_values( $values, $object, $field_name, $request, $object_type ) {
535
- if ( 'cmb2' === $field_name ) {
536
- return self::update_rest_values( $values, $object, $request, $object_type, 'term' );
537
- }
538
- }
539
-
540
- /**
541
- * Handler for updating custom field data.
542
- *
543
- * @since 2.2.3
544
- *
545
- * @param mixed $values The value of the field
546
- * @param object $object The object from the response
547
- * @param WP_REST_Request $request Current request
548
- * @param string $object_type The request object type
549
- * @param string $main_object_type The cmb main object type
550
- *
551
- * @return bool|int
552
- */
553
- protected static function update_rest_values( $values, $object, $request, $object_type, $main_object_type = 'post' ) {
554
- if ( empty( $values ) || ! is_array( $values ) ) {
555
- return;
556
- }
557
-
558
- $object_id = self::get_object_id( $object, $main_object_type );
559
-
560
- if ( ! $object_id ) {
561
- return;
562
- }
563
-
564
- $updated = array();
565
-
566
- if ( ! empty( self::$type_boxes[ $main_object_type ] ) ) {
567
- foreach ( self::$type_boxes[ $main_object_type ] as $cmb_id ) {
568
- $result = self::santize_box_rest_values( $values, self::$boxes[ $cmb_id ], $object_id, $main_object_type );
569
- if ( ! empty( $result ) ) {
570
- $updated[ $cmb_id ] = $result;
571
- }
572
- }
573
- }
574
-
575
- return $updated;
576
- }
577
-
578
- /**
579
- * Updates box rest values.
580
- *
581
- * @since 2.7.0
582
- *
583
- * @param array $values Array of values.
584
- * @param CMB2_REST $rest_box The CMB2_REST object.
585
- * @param integer $object_id The object ID.
586
- * @param string $main_object_type The object type (post, user, term, etc)
587
- *
588
- * @return mixed|bool Array of updated statuses if successful.
589
- */
590
- public static function santize_box_rest_values( $values, $rest_box, $object_id = 0, $main_object_type = 'post' ) {
591
-
592
- if ( ! array_key_exists( $rest_box->cmb->cmb_id, $values ) ) {
593
- return false;
594
- }
595
-
596
- $rest_box->cmb->object_id( $object_id );
597
- $rest_box->cmb->object_type( $main_object_type );
598
-
599
- return $rest_box->sanitize_box_values( $values );
600
- }
601
-
602
- /**
603
- * Loop through box fields and sanitize the values.
604
- *
605
- * @since 2.2.o
606
- *
607
- * @param array $values Array of values being provided.
608
- * @return array Array of updated/sanitized values.
609
- */
610
- public function sanitize_box_values( array $values ) {
611
- $updated = array();
612
-
613
- $this->cmb->pre_process();
614
-
615
- foreach ( $this->edit_fields as $field_id ) {
616
- $updated[ $field_id ] = $this->sanitize_field_value( $values, $field_id );
617
- }
618
-
619
- $this->cmb->after_save();
620
-
621
- return $updated;
622
- }
623
-
624
- /**
625
- * Handles returning a sanitized field value.
626
- *
627
- * @since 2.2.3
628
- *
629
- * @param array $values Array of values being provided.
630
- * @param string $field_id The id of the field to update.
631
- *
632
- * @return mixed The results of saving/sanitizing a field value.
633
- */
634
- protected function sanitize_field_value( array $values, $field_id ) {
635
- if ( ! array_key_exists( $field_id, $values[ $this->cmb->cmb_id ] ) ) {
636
- return;
637
- }
638
-
639
- $field = $this->cmb->get_field( $field_id );
640
-
641
- if ( 'title' == $field->type() ) {
642
- return;
643
- }
644
-
645
- $field->object_id( $this->cmb->object_id() );
646
- $field->object_type( $this->cmb->object_type() );
647
-
648
- if ( 'group' == $field->type() ) {
649
- return $this->sanitize_group_value( $values, $field );
650
- }
651
-
652
- return $field->save_field( $values[ $this->cmb->cmb_id ][ $field_id ] );
653
- }
654
-
655
- /**
656
- * Handles returning a sanitized group field value.
657
- *
658
- * @since 2.2.3
659
- *
660
- * @param array $values Array of values being provided.
661
- * @param CMB2_Field $field CMB2_Field object.
662
- *
663
- * @return mixed The results of saving/sanitizing the group field value.
664
- */
665
- protected function sanitize_group_value( array $values, CMB2_Field $field ) {
666
- $fields = $field->fields();
667
- if ( empty( $fields ) ) {
668
- return;
669
- }
670
-
671
- $this->cmb->data_to_save[ $field->_id( '', false ) ] = $values[ $this->cmb->cmb_id ][ $field->_id( '', false ) ];
672
-
673
- return $this->cmb->save_group_field( $field );
674
- }
675
-
676
- /**
677
- * Filter whether a meta key is protected.
678
- *
679
- * @since 2.2.3
680
- *
681
- * @param bool $protected Whether the key is protected. Default false.
682
- * @param string $meta_key Meta key.
683
- * @param string $meta_type Meta type.
684
- */
685
- public function is_protected_meta( $protected, $meta_key, $meta_type ) {
686
- if ( $this->field_can_edit( $meta_key ) ) {
687
- return false;
688
- }
689
-
690
- return $protected;
691
- }
692
-
693
- /**
694
- * Get the object ID for the given object/type.
695
- *
696
- * @since 2.2.3
697
- *
698
- * @param mixed $object The object to get the ID for.
699
- * @param string $object_type The object type we are looking for.
700
- *
701
- * @return int The object ID if found.
702
- */
703
- public static function get_object_id( $object, $object_type = 'post' ) {
704
- switch ( $object_type ) {
705
- case 'user':
706
- case 'post':
707
- if ( isset( $object->ID ) ) {
708
- return intval( $object->ID );
709
- }
710
- case 'comment':
711
- if ( isset( $object->comment_ID ) ) {
712
- return intval( $object->comment_ID );
713
- }
714
- case 'term':
715
- if ( is_array( $object ) && isset( $object['term_id'] ) ) {
716
- return intval( $object['term_id'] );
717
- } elseif ( isset( $object->term_id ) ) {
718
- return intval( $object->term_id );
719
- }
720
- }
721
-
722
- return 0;
723
- }
724
-
725
- /**
726
- * Checks if a given field can be read.
727
- *
728
- * @since 2.2.3
729
- *
730
- * @param string|CMB2_Field $field_id Field ID or CMB2_Field object.
731
- * @param boolean $return_object Whether to return the Field object.
732
- *
733
- * @return mixed False if field can't be read or true|CMB2_Field object.
734
- */
735
- public function field_can_read( $field_id, $return_object = false ) {
736
- return $this->field_can( 'read_fields', $field_id, $return_object );
737
- }
738
-
739
- /**
740
- * Checks if a given field can be edited.
741
- *
742
- * @since 2.2.3
743
- *
744
- * @param string|CMB2_Field $field_id Field ID or CMB2_Field object.
745
- * @param boolean $return_object Whether to return the Field object.
746
- *
747
- * @return mixed False if field can't be edited or true|CMB2_Field object.
748
- */
749
- public function field_can_edit( $field_id, $return_object = false ) {
750
- return $this->field_can( 'edit_fields', $field_id, $return_object );
751
- }
752
-
753
- /**
754
- * Checks if a given field can be read or edited.
755
- *
756
- * @since 2.2.3
757
- *
758
- * @param string $type Whether we are checking for read or edit fields.
759
- * @param string|CMB2_Field $field_id Field ID or CMB2_Field object.
760
- * @param boolean $return_object Whether to return the Field object.
761
- *
762
- * @return mixed False if field can't be read or edited or true|CMB2_Field object.
763
- */
764
- protected function field_can( $type, $field_id, $return_object = false ) {
765
- if ( ! in_array( $field_id instanceof CMB2_Field ? $field_id->id() : $field_id, $this->{$type}, true ) ) {
766
- return false;
767
- }
768
-
769
- return $return_object ? $this->cmb->get_field( $field_id ) : true;
770
- }
771
-
772
- /**
773
- * Get a CMB2_REST instance object from the registry by a CMB2 id.
774
- *
775
- * @since 2.2.3
776
- *
777
- * @param string $cmb_id CMB2 config id
778
- *
779
- * @return CMB2_REST|false The CMB2_REST object or false.
780
- */
781
- public static function get_rest_box( $cmb_id ) {
782
- return isset( self::$boxes[ $cmb_id ] ) ? self::$boxes[ $cmb_id ] : false;
783
- }
784
-
785
- /**
786
- * Remove a CMB2_REST instance object from the registry.
787
- *
788
- * @since 2.2.3
789
- *
790
- * @param string $cmb_id A CMB2 instance id.
791
- */
792
- public static function remove( $cmb_id ) {
793
- if ( array_key_exists( $cmb_id, self::$boxes ) ) {
794
- unset( self::$boxes[ $cmb_id ] );
795
- }
796
- }
797
-
798
- /**
799
- * Retrieve all CMB2_REST instances from the registry.
800
- *
801
- * @since 2.2.3
802
- * @return CMB2[] Array of all registered CMB2_REST instances.
803
- */
804
- public static function get_all() {
805
- return self::$boxes;
806
- }
807
-
808
- /**
809
- * Checks if given value is readable.
810
- *
811
- * Value is considered readable if it is not empty and if it does not match the editable blacklist.
812
- *
813
- * @since 2.2.3
814
- *
815
- * @param mixed $value Value to check.
816
- *
817
- * @return boolean Whether value is considered readable.
818
- */
819
- public static function is_readable( $value ) {
820
- return ! empty( $value ) && ! in_array( $value, array(
821
- WP_REST_Server::CREATABLE,
822
- WP_REST_Server::EDITABLE,
823
- WP_REST_Server::DELETABLE,
824
- ), true );
825
- }
826
-
827
- /**
828
- * Checks if given value is editable.
829
- *
830
- * Value is considered editable if matches the editable whitelist.
831
- *
832
- * @since 2.2.3
833
- *
834
- * @param mixed $value Value to check.
835
- *
836
- * @return boolean Whether value is considered editable.
837
- */
838
- public static function is_editable( $value ) {
839
- return in_array( $value, array(
840
- WP_REST_Server::EDITABLE,
841
- WP_REST_Server::ALLMETHODS,
842
- ), true );
843
- }
844
-
845
- /**
846
- * Magic getter for our object.
847
- *
848
- * @param string $field
849
- * @throws Exception Throws an exception if the field is invalid.
850
- *
851
- * @return mixed
852
- */
853
- public function __get( $field ) {
854
- switch ( $field ) {
855
- case 'read_fields':
856
- case 'edit_fields':
857
- case 'rest_read':
858
- case 'rest_edit':
859
- return $this->{$field};
860
- default:
861
- throw new Exception( 'Invalid ' . __CLASS__ . ' property: ' . $field );
862
- }
863
- }
864
-
865
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/rest-api/CMB2_REST_Controller.php DELETED
@@ -1,448 +0,0 @@
1
- <?php
2
- if ( ! class_exists( 'WP_REST_Controller' ) ) {
3
- // Shim the WP_REST_Controller class if wp-api plugin not installed, & not in core.
4
- require_once cmb2_dir( 'includes/shim/WP_REST_Controller.php' );
5
- }
6
-
7
- /**
8
- * Creates CMB2 objects/fields endpoint for WordPres REST API.
9
- * Allows access to fields registered to a specific post type and more.
10
- *
11
- * @todo Add better documentation.
12
- * @todo Research proper schema.
13
- *
14
- * @since 2.2.3
15
- *
16
- * @category WordPress_Plugin
17
- * @package CMB2
18
- * @author CMB2 team
19
- * @license GPL-2.0+
20
- * @link https://cmb2.io
21
- */
22
- abstract class CMB2_REST_Controller extends WP_REST_Controller {
23
-
24
- /**
25
- * The namespace of this controller's route.
26
- *
27
- * @var string
28
- */
29
- protected $namespace = CMB2_REST::NAME_SPACE;
30
-
31
- /**
32
- * The base of this controller's route.
33
- *
34
- * @var string
35
- */
36
- protected $rest_base;
37
-
38
- /**
39
- * The current request object
40
- *
41
- * @var WP_REST_Request $request
42
- * @since 2.2.3
43
- */
44
- public $request;
45
-
46
- /**
47
- * The current server object
48
- *
49
- * @var WP_REST_Server $server
50
- * @since 2.2.3
51
- */
52
- public $server;
53
-
54
- /**
55
- * Box object id
56
- *
57
- * @var mixed
58
- * @since 2.2.3
59
- */
60
- public $object_id = null;
61
-
62
- /**
63
- * Box object type
64
- *
65
- * @var string
66
- * @since 2.2.3
67
- */
68
- public $object_type = '';
69
-
70
- /**
71
- * CMB2 Instance
72
- *
73
- * @var CMB2_REST
74
- */
75
- protected $rest_box;
76
-
77
- /**
78
- * CMB2_Field Instance
79
- *
80
- * @var CMB2_Field
81
- */
82
- protected $field;
83
-
84
- /**
85
- * The initial route
86
- *
87
- * @var string
88
- * @since 2.2.3
89
- */
90
- protected static $route = '';
91
-
92
- /**
93
- * Defines which endpoint the initial request is.
94
- *
95
- * @var string $request_type
96
- * @since 2.2.3
97
- */
98
- protected static $request_type = '';
99
-
100
- /**
101
- * Constructor
102
- *
103
- * @since 2.2.3
104
- */
105
- public function __construct( WP_REST_Server $wp_rest_server ) {
106
- $this->server = $wp_rest_server;
107
- }
108
-
109
- /**
110
- * A wrapper for `apply_filters` which checks for box/field properties to hook to the filter.
111
- *
112
- * Checks if a CMB object callback property exists, and if it does,
113
- * hook it to the permissions filter.
114
- *
115
- * @since 2.2.3
116
- *
117
- * @param string $filter The name of the filter to apply.
118
- * @param bool $default_access The default access for this request.
119
- *
120
- * @return void
121
- */
122
- public function maybe_hook_callback_and_apply_filters( $filter, $default_access ) {
123
- if ( ! $this->rest_box && $this->request->get_param( 'cmb_id' ) ) {
124
- $this->rest_box = CMB2_REST::get_rest_box( $this->request->get_param( 'cmb_id' ) );
125
- }
126
-
127
- $default_access = $this->maybe_hook_registered_callback( $filter, $default_access );
128
-
129
- /**
130
- * Apply the permissions check filter.
131
- *
132
- * @since 2.2.3
133
- *
134
- * @param bool $default_access Whether this CMB2 endpoint can be accessed.
135
- * @param object $controller This CMB2_REST_Controller object.
136
- */
137
- $default_access = apply_filters( $filter, $default_access, $this );
138
-
139
- $this->maybe_unhook_registered_callback( $filter );
140
-
141
- return $default_access;
142
- }
143
-
144
- /**
145
- * Checks if the CMB2 box has any registered callback parameters for the given filter.
146
- *
147
- * The registered handlers will have a property name which matches the filter, except:
148
- * - The 'cmb2_api' prefix will be removed
149
- * - A '_cb' suffix will be added (to stay inline with other '*_cb' parameters).
150
- *
151
- * @since 2.2.3
152
- *
153
- * @param string $filter The filter name.
154
- * @param bool $default_val The default filter value.
155
- *
156
- * @return bool The possibly-modified filter value (if the '*_cb' param is non-callable).
157
- */
158
- public function maybe_hook_registered_callback( $filter, $default_val ) {
159
- if ( ! $this->rest_box || is_wp_error( $this->rest_box ) ) {
160
- return $default_val;
161
- }
162
-
163
- // Hook box specific filter callbacks.
164
- $val = $this->rest_box->cmb->maybe_hook_parameter( $filter, $default_val );
165
- if ( null !== $val ) {
166
- $default_val = $val;
167
- }
168
-
169
- return $default_val;
170
- }
171
-
172
- /**
173
- * Unhooks any CMB2 box registered callback parameters for the given filter.
174
- *
175
- * @since 2.2.3
176
- *
177
- * @param string $filter The filter name.
178
- *
179
- * @return void
180
- */
181
- public function maybe_unhook_registered_callback( $filter ) {
182
- if ( ! $this->rest_box || is_wp_error( $this->rest_box ) ) {
183
- return;
184
- }
185
-
186
- // Unhook box specific filter callbacks.
187
- $this->rest_box->cmb->maybe_hook_parameter( $filter, null, 'remove_filter' );
188
- }
189
-
190
- /**
191
- * Prepare a CMB2 object for serialization
192
- *
193
- * @since 2.2.3
194
- *
195
- * @param mixed $data
196
- * @return array $data
197
- */
198
- public function prepare_item( $data ) {
199
- return $this->prepare_item_for_response( $data, $this->request );
200
- }
201
-
202
- /**
203
- * Output buffers a callback and returns the results.
204
- *
205
- * @since 2.2.3
206
- *
207
- * @param mixed $cb Callable function/method.
208
- * @return mixed Results of output buffer after calling function/method.
209
- */
210
- public function get_cb_results( $cb ) {
211
- $args = func_get_args();
212
- array_shift( $args ); // ignore $cb
213
- ob_start();
214
- call_user_func_array( $cb, $args );
215
-
216
- return ob_get_clean();
217
- }
218
-
219
- /**
220
- * Prepare the CMB2 item for the REST response.
221
- *
222
- * @since 2.2.3
223
- *
224
- * @param mixed $item WordPress representation of the item.
225
- * @param WP_REST_Request $request Request object.
226
- * @return WP_REST_Response $response
227
- */
228
- public function prepare_item_for_response( $data, $request = null ) {
229
- $data = $this->filter_response_by_context( $data, $this->request['context'] );
230
-
231
- /**
232
- * Filter the prepared CMB2 item response.
233
- *
234
- * @since 2.2.3
235
- *
236
- * @param mixed $data Prepared data
237
- * @param object $request The WP_REST_Request object
238
- * @param object $cmb2_endpoints This endpoints object
239
- */
240
- return apply_filters( 'cmb2_rest_prepare', rest_ensure_response( $data ), $this->request, $this );
241
- }
242
-
243
- /**
244
- * Initiates the request property and the rest_box property if box is readable.
245
- *
246
- * @since 2.2.3
247
- *
248
- * @param WP_REST_Request $request Request object.
249
- * @param string $request_type A description of the type of request being made.
250
- *
251
- * @return void
252
- */
253
- protected function initiate_rest_read_box( $request, $request_type ) {
254
- $this->initiate_rest_box( $request, $request_type );
255
-
256
- if ( ! is_wp_error( $this->rest_box ) && ! $this->rest_box->rest_read ) {
257
- $this->rest_box = new WP_Error( 'cmb2_rest_no_read_error', __( 'This box does not have read permissions.', 'cmb2' ), array(
258
- 'status' => 403,
259
- ) );
260
- }
261
- }
262
-
263
- /**
264
- * Initiates the request property and the rest_box property if box is writeable.
265
- *
266
- * @since 2.2.3
267
- *
268
- * @param WP_REST_Request $request Request object.
269
- * @param string $request_type A description of the type of request being made.
270
- *
271
- * @return void
272
- */
273
- protected function initiate_rest_edit_box( $request, $request_type ) {
274
- $this->initiate_rest_box( $request, $request_type );
275
-
276
- if ( ! is_wp_error( $this->rest_box ) && ! $this->rest_box->rest_edit ) {
277
- $this->rest_box = new WP_Error( 'cmb2_rest_no_write_error', __( 'This box does not have write permissions.', 'cmb2' ), array(
278
- 'status' => 403,
279
- ) );
280
- }
281
- }
282
-
283
- /**
284
- * Initiates the request property and the rest_box property.
285
- *
286
- * @since 2.2.3
287
- *
288
- * @param WP_REST_Request $request Request object.
289
- * @param string $request_type A description of the type of request being made.
290
- *
291
- * @return void
292
- */
293
- protected function initiate_rest_box( $request, $request_type ) {
294
- $this->initiate_request( $request, $request_type );
295
-
296
- $this->rest_box = CMB2_REST::get_rest_box( $this->request->get_param( 'cmb_id' ) );
297
-
298
- if ( ! $this->rest_box ) {
299
-
300
- $this->rest_box = new WP_Error( 'cmb2_rest_box_not_found_error', __( 'No box found by that id. A box needs to be registered with the "show_in_rest" parameter configured.', 'cmb2' ), array(
301
- 'status' => 403,
302
- ) );
303
-
304
- } else {
305
-
306
- if ( isset( $this->request['object_id'] ) ) {
307
- $this->rest_box->cmb->object_id( sanitize_text_field( $this->request['object_id'] ) );
308
- }
309
-
310
- if ( isset( $this->request['object_type'] ) ) {
311
- $this->rest_box->cmb->object_type( sanitize_text_field( $this->request['object_type'] ) );
312
- }
313
- }
314
- }
315
-
316
- /**
317
- * Initiates the request property and sets up the initial static properties.
318
- *
319
- * @since 2.2.3
320
- *
321
- * @param WP_REST_Request $request Request object.
322
- * @param string $request_type A description of the type of request being made.
323
- *
324
- * @return void
325
- */
326
- public function initiate_request( $request, $request_type ) {
327
- $this->request = $request;
328
-
329
- if ( ! isset( $this->request['context'] ) || empty( $this->request['context'] ) ) {
330
- $this->request['context'] = 'view';
331
- }
332
-
333
- if ( ! self::$request_type ) {
334
- self::$request_type = $request_type;
335
- }
336
-
337
- if ( ! self::$route ) {
338
- self::$route = $this->request->get_route();
339
- }
340
- }
341
-
342
- /**
343
- * Useful when getting `_embed`-ed items
344
- *
345
- * @since 2.2.3
346
- *
347
- * @return string Initial requested type.
348
- */
349
- public static function get_intial_request_type() {
350
- return self::$request_type;
351
- }
352
-
353
- /**
354
- * Useful when getting `_embed`-ed items
355
- *
356
- * @since 2.2.3
357
- *
358
- * @return string Initial requested route.
359
- */
360
- public static function get_intial_route() {
361
- return self::$route;
362
- }
363
-
364
- /**
365
- * Get CMB2 fields schema, conforming to JSON Schema
366
- *
367
- * @since 2.2.3
368
- *
369
- * @return array
370
- */
371
- public function get_item_schema() {
372
- $schema = array(
373
- '$schema' => 'http://json-schema.org/draft-04/schema#',
374
- 'title' => 'CMB2',
375
- 'type' => 'object',
376
- 'properties' => array(
377
- 'description' => array(
378
- 'description' => __( 'A human-readable description of the object.', 'cmb2' ),
379
- 'type' => 'string',
380
- 'context' => array(
381
- 'view',
382
- ),
383
- ),
384
- 'name' => array(
385
- 'description' => __( 'The id for the object.', 'cmb2' ),
386
- 'type' => 'integer',
387
- 'context' => array(
388
- 'view',
389
- ),
390
- ),
391
- 'name' => array(
392
- 'description' => __( 'The title for the object.', 'cmb2' ),
393
- 'type' => 'string',
394
- 'context' => array(
395
- 'view',
396
- ),
397
- ),
398
- ),
399
- );
400
-
401
- return $this->add_additional_fields_schema( $schema );
402
- }
403
-
404
- /**
405
- * Return an array of contextual links for endpoint/object
406
- *
407
- * @link http://v2.wp-api.org/extending/linking/
408
- * @link http://www.iana.org/assignments/link-relations/link-relations.xhtml
409
- *
410
- * @since 2.2.3
411
- *
412
- * @param mixed $object Object to build links from.
413
- *
414
- * @return array Array of links
415
- */
416
- abstract protected function prepare_links( $object );
417
-
418
- /**
419
- * Get whitelisted query strings from URL for appending to link URLS.
420
- *
421
- * @since 2.2.3
422
- *
423
- * @return string URL query stringl
424
- */
425
- public function get_query_string() {
426
- $defaults = array(
427
- 'object_id' => 0,
428
- 'object_type' => '',
429
- '_rendered' => '',
430
- // '_embed' => '',
431
- );
432
-
433
- $query_string = '';
434
-
435
- foreach ( $defaults as $key => $value ) {
436
- if ( isset( $this->request[ $key ] ) ) {
437
- $query_string .= $query_string ? '&' : '?';
438
- $query_string .= $key;
439
- if ( $value = sanitize_text_field( $this->request[ $key ] ) ) {
440
- $query_string .= '=' . $value;
441
- }
442
- }
443
- }
444
-
445
- return $query_string;
446
- }
447
-
448
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php DELETED
@@ -1,270 +0,0 @@
1
- <?php
2
- /**
3
- * CMB2 objects/boxes endpoint for WordPres REST API.
4
- * Allows access to boxes configuration data.
5
- *
6
- * @todo Add better documentation.
7
- * @todo Research proper schema.
8
- *
9
- * @since 2.2.3
10
- *
11
- * @category WordPress_Plugin
12
- * @package CMB2
13
- * @author CMB2 team
14
- * @license GPL-2.0+
15
- * @link https://cmb2.io
16
- */
17
- class CMB2_REST_Controller_Boxes extends CMB2_REST_Controller {
18
-
19
- /**
20
- * The base of this controller's route.
21
- *
22
- * @var string
23
- */
24
- protected $rest_base = 'boxes';
25
-
26
- /**
27
- * The combined $namespace and $rest_base for these routes.
28
- *
29
- * @var string
30
- */
31
- protected $namespace_base = '';
32
-
33
- /**
34
- * Constructor
35
- *
36
- * @since 2.2.3
37
- */
38
- public function __construct( WP_REST_Server $wp_rest_server ) {
39
- $this->namespace_base = $this->namespace . '/' . $this->rest_base;
40
- parent::__construct( $wp_rest_server );
41
- }
42
-
43
- /**
44
- * Register the routes for the objects of the controller.
45
- *
46
- * @since 2.2.3
47
- */
48
- public function register_routes() {
49
- $args = array(
50
- '_embed' => array(
51
- 'description' => __( 'Includes the registered fields for the box in the response.', 'cmb2' ),
52
- ),
53
- );
54
-
55
- // @todo determine what belongs in the context param.
56
- // $args['context'] = $this->get_context_param();
57
- // $args['context']['required'] = false;
58
- // $args['context']['default'] = 'view';
59
- // $args['context']['enum'] = array( 'view', 'embed' );
60
- // Returns all boxes data.
61
- register_rest_route( $this->namespace, '/' . $this->rest_base, array(
62
- array(
63
- 'methods' => WP_REST_Server::READABLE,
64
- 'permission_callback' => array( $this, 'get_items_permissions_check' ),
65
- 'callback' => array( $this, 'get_items' ),
66
- 'args' => $args,
67
- ),
68
- 'schema' => array( $this, 'get_item_schema' ),
69
- ) );
70
-
71
- $args['_rendered'] = array(
72
- 'description' => __( 'Includes the fully rendered attributes, \'form_open\', \'form_close\', as well as the enqueued \'js_dependencies\' script handles, and \'css_dependencies\' stylesheet handles.', 'cmb2' ),
73
- );
74
-
75
- // Returns specific box's data.
76
- register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<cmb_id>[\w-]+)', array(
77
- array(
78
- 'methods' => WP_REST_Server::READABLE,
79
- 'permission_callback' => array( $this, 'get_item_permissions_check' ),
80
- 'callback' => array( $this, 'get_item' ),
81
- 'args' => $args,
82
- ),
83
- 'schema' => array( $this, 'get_item_schema' ),
84
- ) );
85
- }
86
-
87
- /**
88
- * Check if a given request has access to get boxes.
89
- *
90
- * @since 2.2.3
91
- *
92
- * @param WP_REST_Request $request Full data about the request.
93
- * @return WP_Error|boolean
94
- */
95
- public function get_items_permissions_check( $request ) {
96
- $this->initiate_request( $request, __FUNCTION__ );
97
-
98
- /**
99
- * By default, no special permissions needed.
100
- *
101
- * @since 2.2.3
102
- *
103
- * @param bool $can_access Whether this CMB2 endpoint can be accessed.
104
- * @param object $controller This CMB2_REST_Controller object.
105
- */
106
- return apply_filters( 'cmb2_api_get_boxes_permissions_check', true, $this );
107
- }
108
-
109
- /**
110
- * Get all public CMB2 boxes.
111
- *
112
- * @since 2.2.3
113
- *
114
- * @param WP_REST_Request $request Full data about the request.
115
- * @return WP_Error|WP_REST_Response
116
- */
117
- public function get_items( $request ) {
118
- $this->initiate_request( $request, 'boxes_read' );
119
-
120
- $boxes = CMB2_REST::get_all();
121
- if ( empty( $boxes ) ) {
122
- return new WP_Error( 'cmb2_rest_no_boxes', __( 'No boxes found.', 'cmb2' ), array(
123
- 'status' => 403,
124
- ) );
125
- }
126
-
127
- $boxes_data = array();
128
-
129
- // Loop and prepare boxes data.
130
- foreach ( $boxes as $this->rest_box ) {
131
- if (
132
- // Make sure this box can be read
133
- $this->rest_box->rest_read
134
- // And make sure current user can view this box.
135
- && $this->get_item_permissions_check_filter( $this->request )
136
- ) {
137
- $boxes_data[] = $this->server->response_to_data(
138
- $this->get_rest_box(),
139
- isset( $this->request['_embed'] )
140
- );
141
- }
142
- }
143
-
144
- return $this->prepare_item( $boxes_data );
145
- }
146
-
147
- /**
148
- * Check if a given request has access to a box.
149
- * By default, no special permissions needed, but filtering return value.
150
- *
151
- * @since 2.2.3
152
- *
153
- * @param WP_REST_Request $request Full details about the request.
154
- * @return WP_Error|boolean
155
- */
156
- public function get_item_permissions_check( $request ) {
157
- $this->initiate_rest_read_box( $request, 'box_read' );
158
-
159
- return $this->get_item_permissions_check_filter();
160
- }
161
-
162
- /**
163
- * Check by filter if a given request has access to a box.
164
- * By default, no special permissions needed, but filtering return value.
165
- *
166
- * @since 2.2.3
167
- *
168
- * @param bool $can_access Whether the current request has access to view the box by default.
169
- * @return WP_Error|boolean
170
- */
171
- public function get_item_permissions_check_filter( $can_access = true ) {
172
- /**
173
- * By default, no special permissions needed.
174
- *
175
- * @since 2.2.3
176
- *
177
- * @param bool $can_access Whether this CMB2 endpoint can be accessed.
178
- * @param object $controller This CMB2_REST_Controller object.
179
- */
180
- return $this->maybe_hook_callback_and_apply_filters( 'cmb2_api_get_box_permissions_check', $can_access );
181
- }
182
-
183
- /**
184
- * Get one CMB2 box from the collection.
185
- *
186
- * @since 2.2.3
187
- *
188
- * @param WP_REST_Request $request Full data about the request.
189
- * @return WP_Error|WP_REST_Response
190
- */
191
- public function get_item( $request ) {
192
- $this->initiate_rest_read_box( $request, 'box_read' );
193
-
194
- if ( is_wp_error( $this->rest_box ) ) {
195
- return $this->rest_box;
196
- }
197
-
198
- return $this->prepare_item( $this->get_rest_box() );
199
- }
200
-
201
- /**
202
- * Get a CMB2 box prepared for REST
203
- *
204
- * @since 2.2.3
205
- *
206
- * @return array
207
- */
208
- public function get_rest_box() {
209
- $cmb = $this->rest_box->cmb;
210
-
211
- $boxes_data = $cmb->meta_box;
212
-
213
- if ( isset( $this->request['_rendered'] ) && $this->namespace_base !== ltrim( CMB2_REST_Controller::get_intial_route(), '/' ) ) {
214
- $boxes_data['form_open'] = $this->get_cb_results( array( $cmb, 'render_form_open' ) );
215
- $boxes_data['form_close'] = $this->get_cb_results( array( $cmb, 'render_form_close' ) );
216
-
217
- global $wp_scripts, $wp_styles;
218
- $before_css = $wp_styles->queue;
219
- $before_js = $wp_scripts->queue;
220
-
221
- CMB2_JS::enqueue();
222
-
223
- $boxes_data['js_dependencies'] = array_values( array_diff( $wp_scripts->queue, $before_js ) );
224
- $boxes_data['css_dependencies'] = array_values( array_diff( $wp_styles->queue, $before_css ) );
225
- }
226
-
227
- // TODO: look into 'embed' parameter.
228
- // http://demo.wp-api.org/wp-json/wp/v2/posts?_embed
229
- unset( $boxes_data['fields'] );
230
- // Handle callable properties.
231
- unset( $boxes_data['show_on_cb'] );
232
-
233
- $response = rest_ensure_response( $boxes_data );
234
-
235
- $response->add_links( $this->prepare_links( $cmb ) );
236
-
237
- return $response;
238
- }
239
-
240
- /**
241
- * Return an array of contextual links for box/boxes.
242
- *
243
- * @since 2.2.3
244
- *
245
- * @param CMB2_REST $cmb CMB2_REST object to build links from.
246
- *
247
- * @return array Array of links
248
- */
249
- protected function prepare_links( $cmb ) {
250
- $boxbase = $this->namespace_base . '/' . $cmb->cmb_id;
251
- $query_string = $this->get_query_string();
252
-
253
- return array(
254
- // Standard Link Relations -- http://v2.wp-api.org/extending/linking/
255
- 'self' => array(
256
- 'href' => rest_url( $boxbase . $query_string ),
257
- ),
258
- 'collection' => array(
259
- 'href' => rest_url( $this->namespace_base . $query_string ),
260
- ),
261
- // Custom Link Relations -- http://v2.wp-api.org/extending/linking/
262
- // TODO URL should document relationship.
263
- 'https://cmb2.io/fields' => array(
264
- 'href' => rest_url( trailingslashit( $boxbase ) . 'fields' . $query_string ),
265
- 'embeddable' => true,
266
- ),
267
- );
268
- }
269
-
270
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/rest-api/CMB2_REST_Controller_Fields.php DELETED
@@ -1,534 +0,0 @@
1
- <?php
2
- /**
3
- * CMB2 objects/fields endpoint for WordPres REST API.
4
- * Allows access to fields registered to a specific box.
5
- *
6
- * @todo Add better documentation.
7
- * @todo Research proper schema.
8
- *
9
- * @since 2.2.3
10
- *
11
- * @category WordPress_Plugin
12
- * @package CMB2
13
- * @author CMB2 team
14
- * @license GPL-2.0+
15
- * @link https://cmb2.io
16
- */
17
- class CMB2_REST_Controller_Fields extends CMB2_REST_Controller_Boxes {
18
-
19
- /**
20
- * Register the routes for the objects of the controller.
21
- *
22
- * @since 2.2.3
23
- */
24
- public function register_routes() {
25
- $args = array(
26
- '_embed' => array(
27
- 'description' => __( 'Includes the box object which the fields are registered to in the response.', 'cmb2' ),
28
- ),
29
- '_rendered' => array(
30
- 'description' => __( 'When the \'_rendered\' argument is passed, the renderable field attributes will be returned fully rendered. By default, the names of the callback handers for the renderable attributes will be returned.', 'cmb2' ),
31
- ),
32
- 'object_id' => array(
33
- 'description' => __( 'To view or modify the field\'s value, the \'object_id\' and \'object_type\' arguments are required.', 'cmb2' ),
34
- ),
35
- 'object_type' => array(
36
- 'description' => __( 'To view or modify the field\'s value, the \'object_id\' and \'object_type\' arguments are required.', 'cmb2' ),
37
- ),
38
- );
39
-
40
- // Returns specific box's fields.
41
- register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<cmb_id>[\w-]+)/fields/', array(
42
- array(
43
- 'methods' => WP_REST_Server::READABLE,
44
- 'permission_callback' => array( $this, 'get_items_permissions_check' ),
45
- 'callback' => array( $this, 'get_items' ),
46
- 'args' => $args,
47
- ),
48
- 'schema' => array( $this, 'get_item_schema' ),
49
- ) );
50
-
51
- $delete_args = $args;
52
- $delete_args['object_id']['required'] = true;
53
- $delete_args['object_type']['required'] = true;
54
-
55
- // Returns specific field data.
56
- register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<cmb_id>[\w-]+)/fields/(?P<field_id>[\w-]+)', array(
57
- array(
58
- 'methods' => WP_REST_Server::READABLE,
59
- 'permission_callback' => array( $this, 'get_item_permissions_check' ),
60
- 'callback' => array( $this, 'get_item' ),
61
- 'args' => $args,
62
- ),
63
- array(
64
- 'methods' => WP_REST_Server::EDITABLE,
65
- 'permission_callback' => array( $this, 'update_item_permissions_check' ),
66
- 'callback' => array( $this, 'update_item' ),
67
- 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
68
- 'args' => $args,
69
- ),
70
- array(
71
- 'methods' => WP_REST_Server::DELETABLE,
72
- 'permission_callback' => array( $this, 'delete_item_permissions_check' ),
73
- 'callback' => array( $this, 'delete_item' ),
74
- 'args' => $delete_args,
75
- ),
76
- 'schema' => array( $this, 'get_item_schema' ),
77
- ) );
78
- }
79
-
80
- /**
81
- * Check if a given request has access to get fields.
82
- * By default, no special permissions needed, but filtering return value.
83
- *
84
- * @since 2.2.3
85
- *
86
- * @param WP_REST_Request $request Full data about the request.
87
- * @return WP_Error|boolean
88
- */
89
- public function get_items_permissions_check( $request ) {
90
- $this->initiate_rest_read_box( $request, 'fields_read' );
91
- $can_access = true;
92
-
93
- /**
94
- * By default, no special permissions needed.
95
- *
96
- * @since 2.2.3
97
- *
98
- * @param bool $can_access Whether this CMB2 endpoint can be accessed.
99
- * @param object $controller This CMB2_REST_Controller object.
100
- */
101
- return $this->maybe_hook_callback_and_apply_filters( 'cmb2_api_get_fields_permissions_check', $can_access );
102
- }
103
-
104
- /**
105
- * Get all public CMB2 box fields.
106
- *
107
- * @since 2.2.3
108
- *
109
- * @param WP_REST_Request $request Full data about the request.
110
- * @return WP_Error|WP_REST_Response
111
- */
112
- public function get_items( $request ) {
113
- if ( ! $this->rest_box ) {
114
- $this->initiate_rest_read_box( $request, 'fields_read' );
115
- }
116
-
117
- if ( is_wp_error( $this->rest_box ) ) {
118
- return $this->rest_box;
119
- }
120
-
121
- $fields = array();
122
- foreach ( $this->rest_box->cmb->prop( 'fields', array() ) as $field ) {
123
-
124
- // Make sure this field can be read.
125
- $this->field = $this->rest_box->field_can_read( $field['id'], true );
126
-
127
- // And make sure current user can view this box.
128
- if ( $this->field && $this->get_item_permissions_check_filter() ) {
129
- $fields[ $field['id'] ] = $this->server->response_to_data(
130
- $this->prepare_field_response(),
131
- isset( $this->request['_embed'] )
132
- );
133
- }
134
- }
135
-
136
- return $this->prepare_item( $fields );
137
- }
138
-
139
- /**
140
- * Check if a given request has access to a field.
141
- * By default, no special permissions needed, but filtering return value.
142
- *
143
- * @since 2.2.3
144
- *
145
- * @param WP_REST_Request $request Full details about the request.
146
- * @return WP_Error|boolean
147
- */
148
- public function get_item_permissions_check( $request ) {
149
- $this->initiate_rest_read_box( $request, 'field_read' );
150
- if ( ! is_wp_error( $this->rest_box ) ) {
151
- $this->field = $this->rest_box->field_can_read( $this->request->get_param( 'field_id' ), true );
152
- }
153
-
154
- return $this->get_item_permissions_check_filter();
155
- }
156
-
157
- /**
158
- * Check by filter if a given request has access to a field.
159
- * By default, no special permissions needed, but filtering return value.
160
- *
161
- * @since 2.2.3
162
- *
163
- * @param bool $can_access Whether the current request has access to view the field by default.
164
- * @return WP_Error|boolean
165
- */
166
- public function get_item_permissions_check_filter( $can_access = true ) {
167
- /**
168
- * By default, no special permissions needed.
169
- *
170
- * @since 2.2.3
171
- *
172
- * @param bool $can_access Whether this CMB2 endpoint can be accessed.
173
- * @param object $controller This CMB2_REST_Controller object.
174
- */
175
- return $this->maybe_hook_callback_and_apply_filters( 'cmb2_api_get_field_permissions_check', $can_access );
176
- }
177
-
178
- /**
179
- * Get one CMB2 field from the collection.
180
- *
181
- * @since 2.2.3
182
- *
183
- * @param WP_REST_Request $request Full data about the request.
184
- * @return WP_Error|WP_REST_Response
185
- */
186
- public function get_item( $request ) {
187
- $this->initiate_rest_read_box( $request, 'field_read' );
188
-
189
- if ( is_wp_error( $this->rest_box ) ) {
190
- return $this->rest_box;
191
- }
192
-
193
- return $this->prepare_read_field( $this->request->get_param( 'field_id' ) );
194
- }
195
-
196
- /**
197
- * Check if a given request has access to update a field value.
198
- * By default, requires 'edit_others_posts' capability, but filtering return value.
199
- *
200
- * @since 2.2.3
201
- *
202
- * @param WP_REST_Request $request Full details about the request.
203
- * @return WP_Error|boolean
204
- */
205
- public function update_item_permissions_check( $request ) {
206
- $this->initiate_rest_read_box( $request, 'field_value_update' );
207
- if ( ! is_wp_error( $this->rest_box ) ) {
208
- $this->field = $this->rest_box->field_can_edit( $this->request->get_param( 'field_id' ), true );
209
- }
210
-
211
- $can_update = current_user_can( 'edit_others_posts' );
212
-
213
- /**
214
- * By default, 'edit_others_posts' is required capability.
215
- *
216
- * @since 2.2.3
217
- *
218
- * @param bool $can_update Whether this CMB2 endpoint can be accessed.
219
- * @param object $controller This CMB2_REST_Controller object.
220
- */
221
- return $this->maybe_hook_callback_and_apply_filters( 'cmb2_api_update_field_value_permissions_check', $can_update );
222
- }
223
-
224
- /**
225
- * Update CMB2 field value.
226
- *
227
- * @since 2.2.3
228
- *
229
- * @param WP_REST_Request $request Full data about the request.
230
- * @return WP_Error|WP_REST_Response
231
- */
232
- public function update_item( $request ) {
233
- $this->initiate_rest_read_box( $request, 'field_value_update' );
234
-
235
- if ( ! $this->request['value'] ) {
236
- return new WP_Error( 'cmb2_rest_update_field_error', __( 'CMB2 Field value cannot be updated without the value parameter specified.', 'cmb2' ), array(
237
- 'status' => 400,
238
- ) );
239
- }
240
-
241
- return $this->modify_field_value( 'updated' );
242
- }
243
-
244
- /**
245
- * Check if a given request has access to delete a field value.
246
- * By default, requires 'delete_others_posts' capability, but filtering return value.
247
- *
248
- * @since 2.2.3
249
- *
250
- * @param WP_REST_Request $request Full details about the request.
251
- * @return WP_Error|boolean
252
- */
253
- public function delete_item_permissions_check( $request ) {
254
- $this->initiate_rest_read_box( $request, 'field_value_delete' );
255
- if ( ! is_wp_error( $this->rest_box ) ) {
256
- $this->field = $this->rest_box->field_can_edit( $this->request->get_param( 'field_id' ), true );
257
- }
258
-
259
- $can_delete = current_user_can( 'delete_others_posts' );
260
-
261
- /**
262
- * By default, 'delete_others_posts' is required capability.
263
- *
264
- * @since 2.2.3
265
- *
266
- * @param bool $can_delete Whether this CMB2 endpoint can be accessed.
267
- * @param object $controller This CMB2_REST_Controller object.
268
- */
269
- return $this->maybe_hook_callback_and_apply_filters( 'cmb2_api_delete_field_value_permissions_check', $can_delete );
270
- }
271
-
272
- /**
273
- * Delete CMB2 field value.
274
- *
275
- * @since 2.2.3
276
- *
277
- * @param WP_REST_Request $request Full data about the request.
278
- * @return WP_Error|WP_REST_Response
279
- */
280
- public function delete_item( $request ) {
281
- $this->initiate_rest_read_box( $request, 'field_value_delete' );
282
-
283
- return $this->modify_field_value( 'deleted' );
284
- }
285
-
286
- /**
287
- * Modify CMB2 field value.
288
- *
289
- * @since 2.2.3
290
- *
291
- * @param string $activity The modification activity (updated or deleted).
292
- * @return WP_Error|WP_REST_Response
293
- */
294
- public function modify_field_value( $activity ) {
295
-
296
- if ( ! $this->request['object_id'] || ! $this->request['object_type'] ) {
297
- return new WP_Error( 'cmb2_rest_modify_field_value_error', __( 'CMB2 Field value cannot be modified without the object_id and object_type parameters specified.', 'cmb2' ), array(
298
- 'status' => 400,
299
- ) );
300
- }
301
-
302
- if ( is_wp_error( $this->rest_box ) ) {
303
- return $this->rest_box;
304
- }
305
-
306
- $this->field = $this->rest_box->field_can_edit(
307
- $this->field ? $this->field : $this->request->get_param( 'field_id' ),
308
- true
309
- );
310
-
311
- if ( ! $this->field ) {
312
- return new WP_Error( 'cmb2_rest_no_field_by_id_error', __( 'No field found by that id.', 'cmb2' ), array(
313
- 'status' => 403,
314
- ) );
315
- }
316
-
317
- $this->field->args[ "value_{$activity}" ] = (bool) 'deleted' === $activity
318
- ? $this->field->remove_data()
319
- : $this->field->save_field( $this->request['value'] );
320
-
321
- // If options page, save the $activity options
322
- if ( 'options-page' == $this->request['object_type'] ) {
323
- $this->field->args[ "value_{$activity}" ] = cmb2_options( $this->request['object_id'] )->set();
324
- }
325
-
326
- return $this->prepare_read_field( $this->field );
327
- }
328
-
329
- /**
330
- * Get a response object for a specific field ID.
331
- *
332
- * @since 2.2.3
333
- *
334
- * @param string\CMB2_Field Field id or Field object.
335
- * @return WP_Error|WP_REST_Response
336
- */
337
- public function prepare_read_field( $field ) {
338
- $this->field = $this->rest_box->field_can_read( $field, true );
339
-
340
- if ( ! $this->field ) {
341
- return new WP_Error( 'cmb2_rest_no_field_by_id_error', __( 'No field found by that id.', 'cmb2' ), array(
342
- 'status' => 403,
343
- ) );
344
- }
345
-
346
- return $this->prepare_item( $this->prepare_field_response() );
347
- }
348
-
349
- /**
350
- * Get a specific field response.
351
- *
352
- * @since 2.2.3
353
- *
354
- * @param CMB2_Field Field object.
355
- * @return array Response array.
356
- */
357
- public function prepare_field_response() {
358
- $field_data = $this->prepare_field_data( $this->field );
359
- $response = rest_ensure_response( $field_data );
360
-
361
- $response->add_links( $this->prepare_links( $this->field ) );
362
-
363
- return $response;
364
- }
365
-
366
- /**
367
- * Prepare the field data array for JSON.
368
- *
369
- * @since 2.2.3
370
- *
371
- * @param CMB2_Field $field field object.
372
- *
373
- * @return array Array of field data.
374
- */
375
- protected function prepare_field_data( CMB2_Field $field ) {
376
- $field_data = array();
377
- $params_to_ignore = array( 'show_in_rest', 'options' );
378
- $params_to_rename = array(
379
- 'label_cb' => 'label',
380
- 'options_cb' => 'options',
381
- );
382
-
383
- // Run this first so the js_dependencies arg is populated.
384
- $rendered = ( $cb = $field->maybe_callback( 'render_row_cb' ) )
385
- // Ok, callback is good, let's run it.
386
- ? $this->get_cb_results( $cb, $field->args(), $field )
387
- : false;
388
-
389
- $field_args = $field->args();
390
-
391
- foreach ( $field_args as $key => $value ) {
392
- if ( in_array( $key, $params_to_ignore, true ) ) {
393
- continue;
394
- }
395
-
396
- if ( 'options_cb' === $key ) {
397
- $value = $field->options();
398
- } elseif ( in_array( $key, CMB2_Field::$callable_fields, true ) ) {
399
-
400
- if ( isset( $this->request['_rendered'] ) ) {
401
- $value = $key === 'render_row_cb' ? $rendered : $field->get_param_callback_result( $key );
402
- } elseif ( is_array( $value ) ) {
403
- // We need to rewrite callbacks as string as they will cause
404
- // JSON recursion errors.
405
- $class = is_string( $value[0] ) ? $value[0] : get_class( $value[0] );
406
- $value = $class . '::' . $value[1];
407
- }
408
- }
409
-
410
- $key = isset( $params_to_rename[ $key ] ) ? $params_to_rename[ $key ] : $key;
411
-
412
- if ( empty( $value ) || is_scalar( $value ) || is_array( $value ) ) {
413
- $field_data[ $key ] = $value;
414
- } else {
415
- $field_data[ $key ] = sprintf( __( 'Value Error for %s', 'cmb2' ), $key );
416
- }
417
- }
418
-
419
- if ( $field->args( 'has_supporting_data' ) ) {
420
- $field_data = $this->get_supporting_data( $field_data, $field );
421
- }
422
-
423
- if ( $this->request['object_id'] && $this->request['object_type'] ) {
424
- $field_data['value'] = $field->get_rest_value();
425
- }
426
-
427
- return $field_data;
428
- }
429
-
430
- /**
431
- * Gets field supporting data (field id and value).
432
- *
433
- * @since 2.7.0
434
- *
435
- * @param CMB2_Field $field Field object.
436
- * @param array $field_data Array of field data.
437
- *
438
- * @return array Array of field data.
439
- */
440
- public function get_supporting_data( $field_data, $field ) {
441
-
442
- // Reset placement of this property.
443
- unset( $field_data['has_supporting_data'] );
444
- $field_data['has_supporting_data'] = true;
445
-
446
- $field = $field->get_supporting_field();
447
- $field_data['supporting_data'] = array(
448
- 'id' => $field->_id( '', false ),
449
- );
450
-
451
- if ( $this->request['object_id'] && $this->request['object_type'] ) {
452
- $field_data['supporting_data']['value'] = $field->get_rest_value();
453
- }
454
-
455
- return $field_data;
456
- }
457
-
458
- /**
459
- * Return an array of contextual links for field/fields.
460
- *
461
- * @since 2.2.3
462
- *
463
- * @param CMB2_Field $field Field object to build links from.
464
- *
465
- * @return array Array of links
466
- */
467
- protected function prepare_links( $field ) {
468
- $boxbase = $this->namespace_base . '/' . $this->rest_box->cmb->cmb_id;
469
- $query_string = $this->get_query_string();
470
-
471
- $links = array(
472
- 'self' => array(
473
- 'href' => rest_url( trailingslashit( $boxbase ) . 'fields/' . $field->_id( '', false ) . $query_string ),
474
- ),
475
- 'collection' => array(
476
- 'href' => rest_url( trailingslashit( $boxbase ) . 'fields' . $query_string ),
477
- ),
478
- 'up' => array(
479
- 'embeddable' => true,
480
- 'href' => rest_url( $boxbase . $query_string ),
481
- ),
482
- );
483
-
484
- return $links;
485
- }
486
-
487
- /**
488
- * Checks if the CMB2 box or field has any registered callback parameters for the given filter.
489
- *
490
- * The registered handlers will have a property name which matches the filter, except:
491
- * - The 'cmb2_api' prefix will be removed
492
- * - A '_cb' suffix will be added (to stay inline with other '*_cb' parameters).
493
- *
494
- * @since 2.2.3
495
- *
496
- * @param string $filter The filter name.
497
- * @param bool $default_val The default filter value.
498
- *
499
- * @return bool The possibly-modified filter value (if the _cb param is a non-callable).
500
- */
501
- public function maybe_hook_registered_callback( $filter, $default_val ) {
502
- $default_val = parent::maybe_hook_registered_callback( $filter, $default_val );
503
-
504
- if ( $this->field ) {
505
-
506
- // Hook field specific filter callbacks.
507
- $val = $this->field->maybe_hook_parameter( $filter, $default_val );
508
- if ( null !== $val ) {
509
- $default_val = $val;
510
- }
511
- }
512
-
513
- return $default_val;
514
- }
515
-
516
- /**
517
- * Unhooks any CMB2 box or field registered callback parameters for the given filter.
518
- *
519
- * @since 2.2.3
520
- *
521
- * @param string $filter The filter name.
522
- *
523
- * @return void
524
- */
525
- public function maybe_unhook_registered_callback( $filter ) {
526
- parent::maybe_unhook_registered_callback( $filter );
527
-
528
- if ( $this->field ) {
529
- // Unhook field specific filter callbacks.
530
- $this->field->maybe_hook_parameter( $filter, null, 'remove_filter' );
531
- }
532
- }
533
-
534
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/shim/WP_REST_Controller.php DELETED
@@ -1,541 +0,0 @@
1
- <?php
2
-
3
-
4
- abstract class WP_REST_Controller {
5
-
6
- /**
7
- * The namespace of this controller's route.
8
- *
9
- * @var string
10
- */
11
- protected $namespace;
12
-
13
- /**
14
- * The base of this controller's route.
15
- *
16
- * @var string
17
- */
18
- protected $rest_base;
19
-
20
- /**
21
- * Register the routes for the objects of the controller.
22
- */
23
- public function register_routes() {
24
- /* translators: %s: register_routes() */
25
- _doing_it_wrong( 'WP_REST_Controller::register_routes', sprintf( __( "Method '%s' must be overridden." ), __METHOD__ ), '4.7' );
26
- }
27
-
28
- /**
29
- * Check if a given request has access to get items.
30
- *
31
- * @param WP_REST_Request $request Full data about the request.
32
- * @return WP_Error|boolean
33
- */
34
- public function get_items_permissions_check( $request ) {
35
- return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
36
- 'status' => 405,
37
- ) );
38
- }
39
-
40
- /**
41
- * Get a collection of items.
42
- *
43
- * @param WP_REST_Request $request Full data about the request.
44
- * @return WP_Error|WP_REST_Response
45
- */
46
- public function get_items( $request ) {
47
- return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
48
- 'status' => 405,
49
- ) );
50
- }
51
-
52
- /**
53
- * Check if a given request has access to get a specific item.
54
- *
55
- * @param WP_REST_Request $request Full data about the request.
56
- * @return WP_Error|boolean
57
- */
58
- public function get_item_permissions_check( $request ) {
59
- return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
60
- 'status' => 405,
61
- ) );
62
- }
63
-
64
- /**
65
- * Get one item from the collection.
66
- *
67
- * @param WP_REST_Request $request Full data about the request.
68
- * @return WP_Error|WP_REST_Response
69
- */
70
- public function get_item( $request ) {
71
- return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
72
- 'status' => 405,
73
- ) );
74
- }
75
-
76
- /**
77
- * Check if a given request has access to create items.
78
- *
79
- * @param WP_REST_Request $request Full data about the request.
80
- * @return WP_Error|boolean
81
- */
82
- public function create_item_permissions_check( $request ) {
83
- return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
84
- 'status' => 405,
85
- ) );
86
- }
87
-
88
- /**
89
- * Create one item from the collection.
90
- *
91
- * @param WP_REST_Request $request Full data about the request.
92
- * @return WP_Error|WP_REST_Response
93
- */
94
- public function create_item( $request ) {
95
- return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
96
- 'status' => 405,
97
- ) );
98
- }
99
-
100
- /**
101
- * Check if a given request has access to update a specific item.
102
- *
103
- * @param WP_REST_Request $request Full data about the request.
104
- * @return WP_Error|boolean
105
- */
106
- public function update_item_permissions_check( $request ) {
107
- return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
108
- 'status' => 405,
109
- ) );
110
- }
111
-
112
- /**
113
- * Update one item from the collection.
114
- *
115
- * @param WP_REST_Request $request Full data about the request.
116
- * @return WP_Error|WP_REST_Response
117
- */
118
- public function update_item( $request ) {
119
- return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
120
- 'status' => 405,
121
- ) );
122
- }
123
-
124
- /**
125
- * Check if a given request has access to delete a specific item.
126
- *
127
- * @param WP_REST_Request $request Full data about the request.
128
- * @return WP_Error|boolean
129
- */
130
- public function delete_item_permissions_check( $request ) {
131
- return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
132
- 'status' => 405,
133
- ) );
134
- }
135
-
136
- /**
137
- * Delete one item from the collection.
138
- *
139
- * @param WP_REST_Request $request Full data about the request.
140
- * @return WP_Error|WP_REST_Response
141
- */
142
- public function delete_item( $request ) {
143
- return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
144
- 'status' => 405,
145
- ) );
146
- }
147
-
148
- /**
149
- * Prepare the item for create or update operation.
150
- *
151
- * @param WP_REST_Request $request Request object.
152
- * @return WP_Error|object $prepared_item
153
- */
154
- protected function prepare_item_for_database( $request ) {
155
- return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
156
- 'status' => 405,
157
- ) );
158
- }
159
-
160
- /**
161
- * Prepare the item for the REST response.
162
- *
163
- * @param mixed $item WordPress representation of the item.
164
- * @param WP_REST_Request $request Request object.
165
- * @return WP_REST_Response $response
166
- */
167
- public function prepare_item_for_response( $item, $request ) {
168
- return new WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array(
169
- 'status' => 405,
170
- ) );
171
- }
172
-
173
- /**
174
- * Prepare a response for inserting into a collection.
175
- *
176
- * @param WP_REST_Response $response Response object.
177
- * @return array Response data, ready for insertion into collection data.
178
- */
179
- public function prepare_response_for_collection( $response ) {
180
- if ( ! ( $response instanceof WP_REST_Response ) ) {
181
- return $response;
182
- }
183
-
184
- $data = (array) $response->get_data();
185
- $server = rest_get_server();
186
-
187
- if ( method_exists( $server, 'get_compact_response_links' ) ) {
188
- $links = call_user_func( array( $server, 'get_compact_response_links' ), $response );
189
- } else {
190
- $links = call_user_func( array( $server, 'get_response_links' ), $response );
191
- }
192
-
193
- if ( ! empty( $links ) ) {
194
- $data['_links'] = $links;
195
- }
196
-
197
- return $data;
198
- }
199
-
200
- /**
201
- * Filter a response based on the context defined in the schema.
202
- *
203
- * @param array $data
204
- * @param string $context
205
- * @return array
206
- */
207
- public function filter_response_by_context( $data, $context ) {
208
-
209
- $schema = $this->get_item_schema();
210
- foreach ( $data as $key => $value ) {
211
- if ( empty( $schema['properties'][ $key ] ) || empty( $schema['properties'][ $key ]['context'] ) ) {
212
- continue;
213
- }
214
-
215
- if ( ! in_array( $context, $schema['properties'][ $key ]['context'] ) ) {
216
- unset( $data[ $key ] );
217
- continue;
218
- }
219
-
220
- if ( 'object' === $schema['properties'][ $key ]['type'] && ! empty( $schema['properties'][ $key ]['properties'] ) ) {
221
- foreach ( $schema['properties'][ $key ]['properties'] as $attribute => $details ) {
222
- if ( empty( $details['context'] ) ) {
223
- continue;
224
- }
225
- if ( ! in_array( $context, $details['context'] ) ) {
226
- if ( isset( $data[ $key ][ $attribute ] ) ) {
227
- unset( $data[ $key ][ $attribute ] );
228
- }
229
- }
230
- }
231
- }
232
- }
233
-
234
- return $data;
235
- }
236
-
237
- /**
238
- * Get the item's schema, conforming to JSON Schema.
239
- *
240
- * @return array
241
- */
242
- public function get_item_schema() {
243
- return $this->add_additional_fields_schema( array() );
244
- }
245
-
246
- /**
247
- * Get the item's schema for display / public consumption purposes.
248
- *
249
- * @return array
250
- */
251
- public function get_public_item_schema() {
252
-
253
- $schema = $this->get_item_schema();
254
-
255
- foreach ( $schema['properties'] as &$property ) {
256
- if ( isset( $property['arg_options'] ) ) {
257
- unset( $property['arg_options'] );
258
- }
259
- }
260
-
261
- return $schema;
262
- }
263
-
264
- /**
265
- * Get the query params for collections.
266
- *
267
- * @return array
268
- */
269
- public function get_collection_params() {
270
- return array(
271
- 'context' => $this->get_context_param(),
272
- 'page' => array(
273
- 'description' => __( 'Current page of the collection.' ),
274
- 'type' => 'integer',
275
- 'default' => 1,
276
- 'sanitize_callback' => 'absint',
277
- 'validate_callback' => 'rest_validate_request_arg',
278
- 'minimum' => 1,
279
- ),
280
- 'per_page' => array(
281
- 'description' => __( 'Maximum number of items to be returned in result set.' ),
282
- 'type' => 'integer',
283
- 'default' => 10,
284
- 'minimum' => 1,
285
- 'maximum' => 100,
286
- 'sanitize_callback' => 'absint',
287
- 'validate_callback' => 'rest_validate_request_arg',
288
- ),
289
- 'search' => array(
290
- 'description' => __( 'Limit results to those matching a string.' ),
291
- 'type' => 'string',
292
- 'sanitize_callback' => 'sanitize_text_field',
293
- 'validate_callback' => 'rest_validate_request_arg',
294
- ),
295
- );
296
- }
297
-
298
- /**
299
- * Get the magical context param.
300
- *
301
- * Ensures consistent description between endpoints, and populates enum from schema.
302
- *
303
- * @param array $args
304
- * @return array
305
- */
306
- public function get_context_param( $args = array() ) {
307
- $param_details = array(
308
- 'description' => __( 'Scope under which the request is made; determines fields present in response.' ),
309
- 'type' => 'string',
310
- 'sanitize_callback' => 'sanitize_key',
311
- 'validate_callback' => 'rest_validate_request_arg',
312
- );
313
- $schema = $this->get_item_schema();
314
- if ( empty( $schema['properties'] ) ) {
315
- return array_merge( $param_details, $args );
316
- }
317
- $contexts = array();
318
- foreach ( $schema['properties'] as $attributes ) {
319
- if ( ! empty( $attributes['context'] ) ) {
320
- $contexts = array_merge( $contexts, $attributes['context'] );
321
- }
322
- }
323
- if ( ! empty( $contexts ) ) {
324
- $param_details['enum'] = array_unique( $contexts );
325
- rsort( $param_details['enum'] );
326
- }
327
- return array_merge( $param_details, $args );
328
- }
329
-
330
- /**
331
- * Add the values from additional fields to a data object.
332
- *
333
- * @param array $object
334
- * @param WP_REST_Request $request
335
- * @return array modified object with additional fields.
336
- */
337
- protected function add_additional_fields_to_object( $object, $request ) {
338
-
339
- $additional_fields = $this->get_additional_fields();
340
-
341
- foreach ( $additional_fields as $field_name => $field_options ) {
342
-
343
- if ( ! $field_options['get_callback'] ) {
344
- continue;
345
- }
346
-
347
- $object[ $field_name ] = call_user_func( $field_options['get_callback'], $object, $field_name, $request, $this->get_object_type() );
348
- }
349
-
350
- return $object;
351
- }
352
-
353
- /**
354
- * Update the values of additional fields added to a data object.
355
- *
356
- * @param array $object
357
- * @param WP_REST_Request $request
358
- */
359
- protected function update_additional_fields_for_object( $object, $request ) {
360
-
361
- $additional_fields = $this->get_additional_fields();
362
-
363
- foreach ( $additional_fields as $field_name => $field_options ) {
364
-
365
- if ( ! $field_options['update_callback'] ) {
366
- continue;
367
- }
368
-
369
- // Don't run the update callbacks if the data wasn't passed in the request.
370
- if ( ! isset( $request[ $field_name ] ) ) {
371
- continue;
372
- }
373
-
374
- call_user_func( $field_options['update_callback'], $request[ $field_name ], $object, $field_name, $request, $this->get_object_type() );
375
- }
376
- }
377
-
378
- /**
379
- * Add the schema from additional fields to an schema array.
380
- *
381
- * The type of object is inferred from the passed schema.
382
- *
383
- * @param array $schema Schema array.
384
- */
385
- protected function add_additional_fields_schema( $schema ) {
386
- if ( empty( $schema['title'] ) ) {
387
- return $schema;
388
- }
389
-
390
- /**
391
- * Can't use $this->get_object_type otherwise we cause an inf loop.
392
- */
393
- $object_type = $schema['title'];
394
-
395
- $additional_fields = $this->get_additional_fields( $object_type );
396
-
397
- foreach ( $additional_fields as $field_name => $field_options ) {
398
- if ( ! $field_options['schema'] ) {
399
- continue;
400
- }
401
-
402
- $schema['properties'][ $field_name ] = $field_options['schema'];
403
- }
404
-
405
- return $schema;
406
- }
407
-
408
- /**
409
- * Get all the registered additional fields for a given object-type.
410
- *
411
- * @param string $object_type
412
- * @return array
413
- */
414
- protected function get_additional_fields( $object_type = null ) {
415
-
416
- if ( ! $object_type ) {
417
- $object_type = $this->get_object_type();
418
- }
419
-
420
- if ( ! $object_type ) {
421
- return array();
422
- }
423
-
424
- global $wp_rest_additional_fields;
425
-
426
- if ( ! $wp_rest_additional_fields || ! isset( $wp_rest_additional_fields[ $object_type ] ) ) {
427
- return array();
428
- }
429
-
430
- return $wp_rest_additional_fields[ $object_type ];
431
- }
432
-
433
- /**
434
- * Get the object type this controller is responsible for managing.
435
- *
436
- * @return string
437
- */
438
- protected function get_object_type() {
439
- $schema = $this->get_item_schema();
440
-
441
- if ( ! $schema || ! isset( $schema['title'] ) ) {
442
- return null;
443
- }
444
-
445
- return $schema['title'];
446
- }
447
-
448
- /**
449
- * Get an array of endpoint arguments from the item schema for the controller.
450
- *
451
- * @param string $method HTTP method of the request. The arguments
452
- * for `CREATABLE` requests are checked for required
453
- * values and may fall-back to a given default, this
454
- * is not done on `EDITABLE` requests. Default is
455
- * WP_REST_Server::CREATABLE.
456
- * @return array $endpoint_args
457
- */
458
- public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
459
-
460
- $schema = $this->get_item_schema();
461
- $schema_properties = ! empty( $schema['properties'] ) ? $schema['properties'] : array();
462
- $endpoint_args = array();
463
-
464
- foreach ( $schema_properties as $field_id => $params ) {
465
-
466
- // Arguments specified as `readonly` are not allowed to be set.
467
- if ( ! empty( $params['readonly'] ) ) {
468
- continue;
469
- }
470
-
471
- $endpoint_args[ $field_id ] = array(
472
- 'validate_callback' => 'rest_validate_request_arg',
473
- 'sanitize_callback' => 'rest_sanitize_request_arg',
474
- );
475
-
476
- if ( isset( $params['description'] ) ) {
477
- $endpoint_args[ $field_id ]['description'] = $params['description'];
478
- }
479
-
480
- if ( WP_REST_Server::CREATABLE === $method && isset( $params['default'] ) ) {
481
- $endpoint_args[ $field_id ]['default'] = $params['default'];
482
- }
483
-
484
- if ( WP_REST_Server::CREATABLE === $method && ! empty( $params['required'] ) ) {
485
- $endpoint_args[ $field_id ]['required'] = true;
486
- }
487
-
488
- foreach ( array( 'type', 'format', 'enum' ) as $schema_prop ) {
489
- if ( isset( $params[ $schema_prop ] ) ) {
490
- $endpoint_args[ $field_id ][ $schema_prop ] = $params[ $schema_prop ];
491
- }
492
- }
493
-
494
- // Merge in any options provided by the schema property.
495
- if ( isset( $params['arg_options'] ) ) {
496
-
497
- // Only use required / default from arg_options on CREATABLE endpoints.
498
- if ( WP_REST_Server::CREATABLE !== $method ) {
499
- $params['arg_options'] = array_diff_key( $params['arg_options'], array(
500
- 'required' => '',
501
- 'default' => '',
502
- ) );
503
- }
504
-
505
- $endpoint_args[ $field_id ] = array_merge( $endpoint_args[ $field_id ], $params['arg_options'] );
506
- }
507
- }// End foreach().
508
-
509
- return $endpoint_args;
510
- }
511
-
512
- /**
513
- * Retrieves post data given a post ID or post object.
514
- *
515
- * This is a subset of the functionality of the `get_post()` function, with
516
- * the additional functionality of having `the_post` action done on the
517
- * resultant post object. This is done so that plugins may manipulate the
518
- * post that is used in the REST API.
519
- *
520
- * @see get_post()
521
- * @global WP_Query $wp_query
522
- *
523
- * @param int|WP_Post $post Post ID or post object. Defaults to global $post.
524
- * @return WP_Post|null A `WP_Post` object when successful.
525
- */
526
- public function get_post( $post ) {
527
- $post_obj = get_post( $post );
528
-
529
- /**
530
- * Filter the post.
531
- *
532
- * Allows plugins to filter the post object as returned by `\WP_REST_Controller::get_post()`.
533
- *
534
- * @param WP_Post|null $post_obj The post object as returned by `get_post()`.
535
- * @param int|WP_Post $post The original value used to obtain the post object.
536
- */
537
- $post = apply_filters( 'rest_the_post', $post_obj, $post );
538
-
539
- return $post;
540
- }
541
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Base.php DELETED
@@ -1,177 +0,0 @@
1
- <?php
2
- /**
3
- * CMB base field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- abstract class CMB2_Type_Base {
14
-
15
- /**
16
- * The CMB2_Types object
17
- *
18
- * @var CMB2_Types
19
- */
20
- public $types;
21
-
22
- /**
23
- * Arguments for use in the render method
24
- *
25
- * @var array
26
- */
27
- public $args;
28
-
29
- /**
30
- * Rendered output (if 'rendered' argument is set to false)
31
- *
32
- * @var string
33
- */
34
- protected $rendered = '';
35
-
36
- /**
37
- * Constructor
38
- *
39
- * @since 2.2.2
40
- * @param CMB2_Types $types Object for the field type.
41
- * @param array $args Array of arguments for the type.
42
- */
43
- public function __construct( CMB2_Types $types, $args = array() ) {
44
- $this->types = $types;
45
- $args['rendered'] = isset( $args['rendered'] ) ? (bool) $args['rendered'] : true;
46
- $this->args = $args;
47
- }
48
-
49
- /**
50
- * Handles rendering this field type.
51
- *
52
- * @since 2.2.2
53
- * @return string Rendered field type.
54
- */
55
- abstract public function render();
56
-
57
- /**
58
- * Stores the rendered field output.
59
- *
60
- * @since 2.2.2
61
- * @param string|CMB2_Type_Base $rendered Rendered output.
62
- * @return string|CMB2_Type_Base Rendered output or this object.
63
- */
64
- public function rendered( $rendered ) {
65
- $this->field->register_js_data();
66
-
67
- if ( $this->args['rendered'] ) {
68
- return is_a( $rendered, __CLASS__ ) ? $rendered->rendered : $rendered;
69
- }
70
-
71
- $this->rendered = is_a( $rendered, __CLASS__ ) ? $rendered->rendered : $rendered;
72
-
73
- return $this;
74
- }
75
-
76
- /**
77
- * Returns the stored rendered field output.
78
- *
79
- * @since 2.2.2
80
- * @return string Stored rendered output (if 'rendered' argument is set to false).
81
- */
82
- public function get_rendered() {
83
- return $this->rendered;
84
- }
85
-
86
- /**
87
- * Handles parsing and filtering attributes while preserving any passed in via field config.
88
- *
89
- * @since 1.1.0
90
- * @param string $element Element for filter.
91
- * @param array $type_defaults Type default arguments.
92
- * @param array $type_overrides Type override arguments.
93
- * @return array Parsed and filtered arguments.
94
- */
95
- public function parse_args( $element, $type_defaults, $type_overrides = array() ) {
96
- $args = $this->parse_args_from_overrides( $type_overrides );
97
-
98
- /**
99
- * Filter attributes for a field type.
100
- * The dynamic portion of the hook name, $element, refers to the field type.
101
- *
102
- * @since 1.1.0
103
- * @param array $args The array of attribute arguments.
104
- * @param array $type_defaults The array of default values.
105
- * @param array $field The `CMB2_Field` object.
106
- * @param object $field_type_object This `CMB2_Types` object.
107
- */
108
- $args = apply_filters( "cmb2_{$element}_attributes", $args, $type_defaults, $this->field, $this->types );
109
-
110
- $args = wp_parse_args( $args, $type_defaults );
111
-
112
- if ( ! empty( $args['js_dependencies'] ) ) {
113
- $this->field->add_js_dependencies( $args['js_dependencies'] );
114
- }
115
-
116
- return $args;
117
- }
118
-
119
- /**
120
- * Handles parsing and filtering attributes while preserving any passed in via field config.
121
- *
122
- * @since 2.2.4
123
- * @param array $type_overrides Type override arguments.
124
- * @return array Parsed arguments
125
- */
126
- protected function parse_args_from_overrides( $type_overrides = array() ) {
127
- $type_overrides = empty( $type_overrides ) ? $this->args : $type_overrides;
128
-
129
- if ( true !== $this->field->args( 'disable_hash_data_attribute' ) ) {
130
- $type_overrides['data-hash'] = $this->field->hash_id();
131
- }
132
-
133
- $field_overrides = $this->field->args( 'attributes' );
134
-
135
- return ! empty( $field_overrides )
136
- ? wp_parse_args( $field_overrides, $type_overrides )
137
- : $type_overrides;
138
- }
139
-
140
- /**
141
- * Fall back to CMB2_Types methods
142
- *
143
- * @param string $method Method name being invoked.
144
- * @param array $arguments Arguments passed for the method.
145
- * @throws Exception Throws an exception if the field is invalid.
146
- * @return mixed
147
- */
148
- public function __call( $method, $arguments ) {
149
- switch ( $method ) {
150
- case '_id':
151
- case '_name':
152
- case '_desc':
153
- case '_text':
154
- case 'concat_attrs':
155
- return call_user_func_array( array( $this->types, $method ), $arguments );
156
- default:
157
- throw new Exception( sprintf( esc_html__( 'Invalid %1$s method: %2$s', 'cmb2' ), __CLASS__, $method ) );
158
- }
159
- }
160
-
161
- /**
162
- * Magic getter for our object.
163
- *
164
- * @param string $field Property being requested.
165
- * @throws Exception Throws an exception if the field is invalid.
166
- * @return mixed
167
- */
168
- public function __get( $field ) {
169
- switch ( $field ) {
170
- case 'field':
171
- return $this->types->field;
172
- default:
173
- throw new Exception( sprintf( esc_html__( 'Invalid %1$s property: %2$s', 'cmb2' ), __CLASS__, $field ) );
174
- }
175
- }
176
-
177
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Checkbox.php DELETED
@@ -1,74 +0,0 @@
1
- <?php
2
- /**
3
- * CMB checkbox field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Checkbox extends CMB2_Type_Text {
14
-
15
- /**
16
- * If checkbox is checked
17
- *
18
- * @var mixed
19
- */
20
- public $is_checked = null;
21
-
22
- /**
23
- * Constructor
24
- *
25
- * @since 2.2.2
26
- *
27
- * @param CMB2_Types $types Object for the field type.
28
- * @param array $args Array of arguments for the type.
29
- * @param mixed $is_checked Whether or not the field is checked, or default value.
30
- */
31
- public function __construct( CMB2_Types $types, $args = array(), $is_checked = null ) {
32
- parent::__construct( $types, $args );
33
- $this->is_checked = $is_checked;
34
- }
35
-
36
- /**
37
- * Render the field for the field type.
38
- *
39
- * @since 2.2.2
40
- *
41
- * @param array $args Array of arguments for the rendering.
42
- * @return CMB2_Type_Base|string
43
- */
44
- public function render( $args = array() ) {
45
- $defaults = array(
46
- 'type' => 'checkbox',
47
- 'class' => 'cmb2-option cmb2-list',
48
- 'value' => 'on',
49
- 'desc' => '',
50
- );
51
-
52
- $meta_value = $this->field->escaped_value();
53
-
54
- $is_checked = null === $this->is_checked
55
- ? ! empty( $meta_value )
56
- : $this->is_checked;
57
-
58
- if ( $is_checked ) {
59
- $defaults['checked'] = 'checked';
60
- }
61
-
62
- $args = $this->parse_args( 'checkbox', $defaults );
63
-
64
- return $this->rendered(
65
- sprintf(
66
- '%s <label for="%s">%s</label>',
67
- parent::render( $args ),
68
- $this->_id( '', false ),
69
- $this->_desc()
70
- )
71
- );
72
- }
73
-
74
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Colorpicker.php DELETED
@@ -1,120 +0,0 @@
1
- <?php
2
- /**
3
- * CMB colorpicker field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Colorpicker extends CMB2_Type_Text {
14
-
15
- /**
16
- * The optional value for the colorpicker field
17
- *
18
- * @var string
19
- */
20
- public $value = '';
21
-
22
- /**
23
- * Constructor
24
- *
25
- * @since 2.2.2
26
- *
27
- * @param CMB2_Types $types Object for the field type.
28
- * @param array $args Array of arguments for the type.
29
- * @param string $value Value that the field type is currently set to, or default value.
30
- */
31
- public function __construct( CMB2_Types $types, $args = array(), $value = '' ) {
32
- parent::__construct( $types, $args );
33
- $this->value = $value ? $value : $this->value;
34
- }
35
-
36
- /**
37
- * Render the field for the field type.
38
- *
39
- * @since 2.2.2
40
- *
41
- * @param array $args Array of arguments for the rendering.
42
- *
43
- * @return CMB2_Type_Base|string
44
- */
45
- public function render( $args = array() ) {
46
- $meta_value = $this->value ? $this->value : $this->field->escaped_value();
47
-
48
- $meta_value = self::sanitize_color( $meta_value );
49
-
50
- wp_enqueue_style( 'wp-color-picker' );
51
-
52
- $args = wp_parse_args( $args, array(
53
- 'class' => 'cmb2-text-small',
54
- ) );
55
-
56
- $args['class'] .= ' cmb2-colorpicker';
57
- $args['value'] = $meta_value;
58
- $args['js_dependencies'] = array( 'wp-color-picker' );
59
-
60
- if ( $this->field->options( 'alpha' ) ) {
61
- $args['js_dependencies'][] = 'wp-color-picker-alpha';
62
- $args['data-alpha'] = 'true';
63
- }
64
-
65
- $args = wp_parse_args( $this->args, $args );
66
-
67
- return parent::render( $args );
68
- }
69
-
70
- /**
71
- * Sanitizes the given color, or array of colors.
72
- *
73
- * @since 2.9.0
74
- *
75
- * @param string|array $color The color or array of colors to sanitize.
76
- *
77
- * @return string|array The color or array of colors, sanitized.
78
- */
79
- public static function sanitize_color( $color ) {
80
-
81
- if ( is_array( $color ) ) {
82
-
83
- $color = array_map( array( 'CMB2_Type_Colorpicker', 'sanitize_color' ), $color );
84
-
85
- } else {
86
-
87
- // Regexp for hexadecimal colors
88
- $hex_color = '(([a-fA-F0-9]){3}){1,2}$';
89
-
90
- if ( preg_match( '/^' . $hex_color . '/i', $color ) ) {
91
- // Value is just 123abc, so prepend #
92
- $color = '#' . $color;
93
- } elseif (
94
- // If value doesn't match #123abc...
95
- ! preg_match( '/^#' . $hex_color . '/i', $color )
96
- // And value doesn't match rgba()...
97
- && 0 !== strpos( trim( $color ), 'rgba' )
98
- ) {
99
- // Then sanitize to just #.
100
- $color = '#';
101
- }
102
-
103
- }
104
-
105
- return $color;
106
- }
107
-
108
- /**
109
- * Provide the option to use a rgba colorpicker.
110
- *
111
- * @since 2.2.6.2
112
- */
113
- public static function dequeue_rgba_colorpicker_script() {
114
- if ( wp_script_is( 'jw-cmb2-rgba-picker-js', 'enqueued' ) ) {
115
- wp_dequeue_script( 'jw-cmb2-rgba-picker-js' );
116
- CMB2_JS::register_colorpicker_alpha( true );
117
- }
118
- }
119
-
120
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Counter_Base.php DELETED
@@ -1,138 +0,0 @@
1
- <?php
2
- /**
3
- * CMB base field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- abstract class CMB2_Type_Counter_Base extends CMB2_Type_Base {
14
-
15
- /**
16
- * Whether this type has the counter added.
17
- *
18
- * @since 2.7.0
19
- *
20
- * @var boolean
21
- */
22
- public $has_counter = false;
23
-
24
- /**
25
- * Return character counter markup for this field.
26
- *
27
- * @since 2.7.0
28
- *
29
- * @param string $val The actual value of this field.
30
- *
31
- * @return string
32
- */
33
- public function char_counter_markup( $val ) {
34
- $markup = '';
35
-
36
- if ( ! $this->field->args( 'char_counter' ) ) {
37
- return $markup;
38
- }
39
-
40
- $type = (string) $this->field->args( 'char_counter' );
41
- $field_id = $this->_id( '', false );
42
- $char_max = (int) $this->field->prop( 'char_max' );
43
- if ( $char_max ) {
44
- $char_max = 'data-max="' . $char_max . '"';
45
- }
46
-
47
- switch ( $type ) {
48
- case 'words':
49
- $label = $char_max
50
- ? $this->_text( 'words_left_text', esc_html__( 'Words left', 'cmb2' ) )
51
- : $this->_text( 'words_text', esc_html__( 'Words', 'cmb2' ) );
52
- break;
53
- default:
54
- $type = 'characters';
55
- $label = $char_max
56
- ? $this->_text( 'characters_left_text', esc_html__( 'Characters left', 'cmb2' ) )
57
- : $this->_text( 'characters_text', esc_html__( 'Characters', 'cmb2' ) );
58
- break;
59
- }
60
-
61
- $msg = $char_max
62
- ? sprintf( '<span class="cmb2-char-max-msg">%s</span>', $this->_text( 'characters_truncated_text', esc_html__( 'Your text may be truncated.', 'cmb2' ) ) )
63
- : '';
64
-
65
- $length = strlen( $val );
66
- $width = $length > 1 ? ( 8 * strlen( (string) $length ) ) + 15 : false;
67
-
68
- $markup .= '<p class="cmb2-char-counter-wrap">';
69
- $markup .= sprintf(
70
- '<label><span class="cmb2-char-counter-label">%2$s:</span> <input id="%1$s" data-field-id="%3$s" data-counter-type="%4$s" %5$s class="cmb2-char-counter" type="text" value="%6$s" readonly="readonly" style="%7$s"></label>%8$s',
71
- esc_attr( 'char-counter-' . $field_id ),
72
- $label,
73
- esc_attr( $field_id ),
74
- $type,
75
- $char_max,
76
- $length,
77
- $width ? "width: {$width}px;" : '',
78
- $msg
79
- );
80
- $markup .= '</p>';
81
-
82
- // Enqueue the required JS.
83
- $this->field->add_js_dependencies( array(
84
- 'word-count',
85
- 'wp-util',
86
- 'cmb2-char-counter',
87
- ) );
88
-
89
- $this->has_counter = true;
90
-
91
- return $markup;
92
- }
93
-
94
- /**
95
- * Maybe update attributes for the character counter.
96
- *
97
- * @since 2.7.0
98
- *
99
- * @param array $attributes Array of parsed attributes.
100
- *
101
- * @return array Potentially modified attributes.
102
- */
103
- public function maybe_update_attributes_for_char_counter( $attributes ) {
104
- $char_counter = $this->char_counter_markup( $attributes['value'] );
105
-
106
- // Has character counter?
107
- if ( $char_counter ) {
108
- $attributes['class'] = ! empty( $attributes['class'] ) ? $attributes['class'] . ' cmb2-count-chars' : ' cmb2-count-chars';
109
-
110
- // Enforce max chars?
111
- $max = $this->enforce_max();
112
- if ( $max ) {
113
- $attributes['maxlength'] = $max;
114
- }
115
- $attributes['desc'] = $char_counter . $attributes['desc'];
116
- }
117
-
118
- return $attributes;
119
- }
120
-
121
- /**
122
- * Enforce max chars?
123
- *
124
- * @since 2.7.0
125
- *
126
- * @return bool Whether to enforce max characters.
127
- */
128
- public function enforce_max() {
129
- $char_max = (int) $this->field->args( 'char_max' );
130
-
131
- // Enforce max chars?
132
- return ( $this->field->args( 'char_max_enforce' ) && $char_max > 0
133
- && 'words' !== $this->field->args( 'char_counter' ) )
134
- ? $char_max
135
- : false;
136
- }
137
-
138
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_File.php DELETED
@@ -1,190 +0,0 @@
1
- <?php
2
- /**
3
- * CMB file field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_File extends CMB2_Type_File_Base {
14
-
15
- /**
16
- * Handles outputting an 'file' field
17
- *
18
- * @param array $args Override arguments.
19
- * @return string Form input element
20
- */
21
- public function render( $args = array() ) {
22
- $args = empty( $args ) ? $this->args : $args;
23
- $field = $this->field;
24
- $options = (array) $field->options();
25
-
26
- $a = $this->args = $this->parse_args( 'file', array(
27
- 'class' => 'cmb2-upload-file regular-text',
28
- 'id' => $this->_id(),
29
- 'name' => $this->_name(),
30
- 'value' => $field->escaped_value(),
31
- 'id_value' => null,
32
- 'desc' => $this->_desc( true ),
33
- 'size' => 45,
34
- 'js_dependencies' => 'media-editor',
35
- 'preview_size' => $field->args( 'preview_size' ),
36
- 'query_args' => $field->args( 'query_args' ),
37
-
38
- // if options array and 'url' => false, then hide the url field.
39
- 'type' => array_key_exists( 'url', $options ) && false === $options['url']
40
- ? 'hidden'
41
- : 'text',
42
- ), $args );
43
-
44
- // get an array of image size meta data, fallback to 'large'.
45
- $this->args['img_size_data'] = $img_size_data = parent::get_image_size_data(
46
- $a['preview_size'],
47
- 'large'
48
- );
49
-
50
- $output = '';
51
-
52
- $output .= parent::render( array(
53
- 'type' => $a['type'],
54
- 'class' => $a['class'],
55
- 'value' => $a['value'],
56
- 'id' => $a['id'],
57
- 'name' => $a['name'],
58
- 'size' => $a['size'],
59
- 'desc' => '',
60
- 'data-previewsize' => sprintf( '[%d,%d]', $img_size_data['width'], $img_size_data['height'] ),
61
- 'data-sizename' => $img_size_data['name'],
62
- 'data-queryargs' => ! empty( $a['query_args'] ) ? json_encode( $a['query_args'] ) : '',
63
- 'js_dependencies' => $a['js_dependencies'],
64
- ) );
65
-
66
- // Now remove the data-iterator attribute if it exists.
67
- // (Possible if being used within a custom field)
68
- // This is not elegant, but compensates for CMB2_Types::_id
69
- // automagically & inelegantly adding the data-iterator attribute.
70
- // Single responsibility principle? pffft.
71
- $parts = explode( '"', $this->args['id'] );
72
- $this->args['id'] = $parts[0];
73
-
74
- $output .= sprintf(
75
- '<input class="cmb2-upload-button button-secondary" type="button" value="%1$s" />',
76
- esc_attr( $this->_text( 'add_upload_file_text', esc_html__( 'Add or Upload File', 'cmb2' ) ) )
77
- );
78
-
79
- $output .= $a['desc'];
80
- $output .= $this->get_id_field_output();
81
-
82
- $output .= '<div id="' . esc_attr( $field->id() ) . '-status" class="cmb2-media-status">';
83
- if ( ! empty( $a['value'] ) ) {
84
- $output .= $this->get_file_preview_output();
85
- }
86
- $output .= '</div>';
87
-
88
- return $this->rendered( $output );
89
- }
90
-
91
- /**
92
- * Return attempted file preview output for a provided file.
93
- *
94
- * @since 2.2.5
95
- *
96
- * @return string
97
- */
98
- public function get_file_preview_output() {
99
- if ( ! $this->is_valid_img_ext( $this->args['value'] ) ) {
100
-
101
- return $this->file_status_output( array(
102
- 'value' => $this->args['value'],
103
- 'tag' => 'div',
104
- 'cached_id' => $this->args['id'],
105
- ) );
106
- }
107
-
108
- if ( $this->args['id_value'] ) {
109
- $image = wp_get_attachment_image( $this->args['id_value'], $this->args['preview_size'], null, array(
110
- 'class' => 'cmb-file-field-image',
111
- ) );
112
- } else {
113
- $image = '<img style="max-width: ' . absint( $this->args['img_size_data']['width'] ) . 'px; width: 100%;" src="' . esc_url( $this->args['value'] ) . '" class="cmb-file-field-image" alt="" />';
114
- }
115
-
116
- return $this->img_status_output( array(
117
- 'image' => $image,
118
- 'tag' => 'div',
119
- 'cached_id' => $this->args['id'],
120
- ) );
121
- }
122
-
123
- /**
124
- * Return field ID output as a hidden field.
125
- *
126
- * @since 2.2.5
127
- *
128
- * @return string
129
- */
130
- public function get_id_field_output() {
131
- $field = $this->field;
132
-
133
- /*
134
- * A little bit of magic (tsk tsk) replacing the $this->types->field object,
135
- * So that the render function is using the proper field object.
136
- */
137
- $this->types->field = $this->get_id_field();
138
-
139
- $output = parent::render( array(
140
- 'type' => 'hidden',
141
- 'class' => 'cmb2-upload-file-id',
142
- 'value' => $this->types->field->value,
143
- 'desc' => '',
144
- ) );
145
-
146
- // We need to put the original field object back
147
- // or other fields in a custom field will be broken.
148
- $this->types->field = $field;
149
-
150
- return $output;
151
- }
152
-
153
- /**
154
- * Return field ID data.
155
- *
156
- * @since 2.2.5
157
- *
158
- * @return mixed
159
- */
160
- public function get_id_field() {
161
-
162
- // reset field args for attachment id.
163
- $args = array(
164
- // if we're looking at a file in a group, we need to get the non-prefixed id.
165
- 'id' => ( $this->field->group ? $this->field->args( '_id' ) : $this->args['id'] ) . '_id',
166
- 'disable_hash_data_attribute' => true,
167
- );
168
-
169
- // and get new field object
170
- // (need to set it to the types field property).
171
- $id_field = $this->field->get_field_clone( $args );
172
-
173
- $id_value = absint( null !== $this->args['id_value'] ? $this->args['id_value'] : $id_field->escaped_value() );
174
-
175
- // we don't want to output "0" as a value.
176
- if ( ! $id_value ) {
177
- $id_value = '';
178
- }
179
-
180
- // if there is no id saved yet, try to get it from the url.
181
- if ( $this->args['value'] && ! $id_value ) {
182
- $id_value = CMB2_Utils::image_id_from_url( esc_url_raw( $this->args['value'] ) );
183
- }
184
-
185
- $id_field->value = $id_value;
186
-
187
- return $id_field;
188
- }
189
-
190
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_File_Base.php DELETED
@@ -1,221 +0,0 @@
1
- <?php
2
- /**
3
- * CMB File base field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_File_Base extends CMB2_Type_Text {
14
-
15
- /**
16
- * Determines if a file has a valid image extension
17
- *
18
- * @since 1.0.0
19
- * @param string $file File url
20
- * @return bool Whether file has a valid image extension
21
- */
22
- public function is_valid_img_ext( $file, $blah = false ) {
23
- $file_ext = CMB2_Utils::get_file_ext( $file );
24
-
25
- $valid_types = array( 'jpg', 'jpeg', 'jpe', 'png', 'gif', 'ico', 'icon' );
26
-
27
- $allowed = get_allowed_mime_types();
28
- if ( ! empty( $allowed ) ) {
29
- foreach ( (array) $allowed as $type => $mime) {
30
- if ( 0 === strpos( $mime, 'image/' ) ) {
31
- $types = explode( '|', $type );
32
- $valid_types = array_merge( $valid_types, $types );
33
- }
34
- }
35
- $valid_types = array_unique( $valid_types );
36
- }
37
-
38
- /**
39
- * Which image types are considered valid image file extensions.
40
- *
41
- * @since 2.0.9
42
- *
43
- * @param array $valid_types The valid image file extensions.
44
- */
45
- $is_valid_types = apply_filters( 'cmb2_valid_img_types', $valid_types );
46
- $is_valid = $file_ext && in_array( $file_ext, (array) $is_valid_types );
47
- $field_id = $this->field->id();
48
-
49
- /**
50
- * Filter for determining if a field value has a valid image file-type extension.
51
- *
52
- * The dynamic portion of the hook name, $field_id, refers to the field id attribute.
53
- *
54
- * @since 2.0.9
55
- *
56
- * @param bool $is_valid Whether field value has a valid image file-type extension.
57
- * @param string $file File url.
58
- * @param string $file_ext File extension.
59
- */
60
- return (bool) apply_filters( "cmb2_{$field_id}_is_valid_img_ext", $is_valid, $file, $file_ext );
61
- }
62
-
63
- /**
64
- * file/file_list image wrap
65
- *
66
- * @since 2.0.2
67
- * @param array $args Array of arguments for output
68
- * @return string Image wrap output
69
- */
70
- public function img_status_output( $args ) {
71
- return sprintf( '<%1$s class="img-status cmb2-media-item">%2$s<p class="cmb2-remove-wrapper"><a href="#" class="cmb2-remove-file-button"%3$s>%4$s</a></p>%5$s</%1$s>',
72
- $args['tag'],
73
- $args['image'],
74
- isset( $args['cached_id'] ) ? ' rel="' . esc_attr( $args['cached_id'] ) . '"' : '',
75
- esc_html( $this->_text( 'remove_image_text', esc_html__( 'Remove Image', 'cmb2' ) ) ),
76
- isset( $args['id_input'] ) ? $args['id_input'] : ''
77
- );
78
- }
79
-
80
- /**
81
- * file/file_list file wrap
82
- *
83
- * @since 2.0.2
84
- * @param array $args Array of arguments for output
85
- * @return string File wrap output
86
- */
87
- public function file_status_output( $args ) {
88
- return sprintf( '<%1$s class="file-status cmb2-media-item"><span>%2$s <strong>%3$s</strong></span>&nbsp;&nbsp; (<a href="%4$s" target="_blank" rel="external">%5$s</a> / <a href="#" class="cmb2-remove-file-button"%6$s>%7$s</a>)%8$s</%1$s>',
89
- $args['tag'],
90
- esc_html( $this->_text( 'file_text', esc_html__( 'File:', 'cmb2' ) ) ),
91
- esc_html( CMB2_Utils::get_file_name_from_path( $args['value'] ) ),
92
- esc_url( $args['value'] ),
93
- esc_html( $this->_text( 'file_download_text', esc_html__( 'Download', 'cmb2' ) ) ),
94
- isset( $args['cached_id'] ) ? ' rel="' . esc_attr( $args['cached_id'] ) . '"' : '',
95
- esc_html( $this->_text( 'remove_text', esc_html__( 'Remove', 'cmb2' ) ) ),
96
- isset( $args['id_input'] ) ? $args['id_input'] : ''
97
- );
98
- }
99
-
100
- /**
101
- * Outputs the file/file_list underscore Javascript templates in the footer.
102
- *
103
- * @since 2.2.4
104
- * @return void
105
- */
106
- public static function output_js_underscore_templates() {
107
- ?>
108
- <script type="text/html" id="tmpl-cmb2-single-image">
109
- <div class="img-status cmb2-media-item">
110
- <img width="{{ data.sizeWidth }}" height="{{ data.sizeHeight }}" src="{{ data.sizeUrl }}" class="cmb-file-field-image" alt="{{ data.filename }}" title="{{ data.filename }}" />
111
- <p><a href="#" class="cmb2-remove-file-button" rel="{{ data.mediaField }}">{{ data.stringRemoveImage }}</a></p>
112
- </div>
113
- </script>
114
- <script type="text/html" id="tmpl-cmb2-single-file">
115
- <div class="file-status cmb2-media-item">
116
- <span>{{ data.stringFile }} <strong>{{ data.filename }}</strong></span>&nbsp;&nbsp; (<a href="{{ data.url }}" target="_blank" rel="external">{{ data.stringDownload }}</a> / <a href="#" class="cmb2-remove-file-button" rel="{{ data.mediaField }}">{{ data.stringRemoveFile }}</a>)
117
- </div>
118
- </script>
119
- <script type="text/html" id="tmpl-cmb2-list-image">
120
- <li class="img-status cmb2-media-item">
121
- <img width="{{ data.sizeWidth }}" height="{{ data.sizeHeight }}" src="{{ data.sizeUrl }}" class="cmb-file_list-field-image" alt="{{ data.filename }}">
122
- <p><a href="#" class="cmb2-remove-file-button" rel="{{ data.mediaField }}[{{ data.id }}]">{{ data.stringRemoveImage }}</a></p>
123
- <input type="hidden" id="filelist-{{ data.id }}" data-id="{{ data.id }}" name="{{ data.mediaFieldName }}[{{ data.id }}]" value="{{ data.url }}">
124
- </li>
125
- </script>
126
- <script type="text/html" id="tmpl-cmb2-list-file">
127
- <li class="file-status cmb2-media-item">
128
- <span>{{ data.stringFile }} <strong>{{ data.filename }}</strong></span>&nbsp;&nbsp; (<a href="{{ data.url }}" target="_blank" rel="external">{{ data.stringDownload }}</a> / <a href="#" class="cmb2-remove-file-button" rel="{{ data.mediaField }}[{{ data.id }}]">{{ data.stringRemoveFile }}</a>)
129
- <input type="hidden" id="filelist-{{ data.id }}" data-id="{{ data.id }}" name="{{ data.mediaFieldName }}[{{ data.id }}]" value="{{ data.url }}">
130
- </li>
131
- </script>
132
- <?php
133
- }
134
-
135
- /**
136
- * Utility method to return an array of meta data for a registered image size
137
- *
138
- * Uses CMB2_Utils::get_named_size() to get the closest available named size
139
- * from an array of width and height values and CMB2_Utils::get_available_image_sizes()
140
- * to get the meta data associated with a named size.
141
- *
142
- * @since 2.2.4
143
- * @param array|string $img_size Image size. Accepts an array of width and height (in that order)
144
- * @param string $fallback Size to use if the supplied named size doesn't exist
145
- * @return array Array containing the image size meta data
146
- * $size = (
147
- * 'width' => (int) image size width
148
- * 'height' => (int) image size height
149
- * 'name' => (string) e.g. 'thumbnail'
150
- * )
151
- */
152
- static function get_image_size_data( $img_size = '', $fallback = 'thumbnail' ) {
153
- $data = array();
154
-
155
- if ( is_array( $img_size ) ) {
156
- $data['width'] = intval( $img_size[0] );
157
- $data['height'] = intval( $img_size[1] );
158
- $data['name'] = '';
159
-
160
- // Try and get the closest named size from our array of dimensions
161
- if ( $named_size = CMB2_Utils::get_named_size( $img_size ) ) {
162
- $data['name'] = $named_size;
163
- }
164
- } else {
165
-
166
- $image_sizes = CMB2_Utils::get_available_image_sizes();
167
-
168
- // The 'thumb' alias, which works elsewhere, doesn't work in the wp.media uploader
169
- if ( 'thumb' == $img_size ) {
170
- $img_size = 'thumbnail';
171
- }
172
-
173
- // Named size doesn't exist, use $fallback
174
- if ( ! array_key_exists( $img_size, $image_sizes ) ) {
175
- $img_size = $fallback;
176
- }
177
-
178
- // Get image dimensions from named sizes
179
- $data['width'] = intval( $image_sizes[ $img_size ]['width'] );
180
- $data['height'] = intval( $image_sizes[ $img_size ]['height'] );
181
- $data['name'] = $img_size;
182
- }
183
-
184
- return $data;
185
- }
186
-
187
- /**
188
- * Filters attachment data prepared for JavaScript.
189
- *
190
- * Adds the url, width, height, and orientation for custom sizes to the JavaScript
191
- * object returned by the wp.media uploader. Hooked to 'wp_prepare_attachment_for_js'.
192
- *
193
- * @since 2.2.4
194
- * @param array $response Array of prepared attachment data
195
- * @param int|object $attachment Attachment ID or object
196
- * @param array $meta Array of attachment meta data ( from wp_get_attachment_metadata() )
197
- * @return array filtered $response array
198
- */
199
- public static function prepare_image_sizes_for_js( $response, $attachment, $meta ) {
200
- foreach ( CMB2_Utils::get_available_image_sizes() as $size => $info ) {
201
-
202
- // registered image size exists for this attachment
203
- if ( isset( $meta['sizes'][ $size ] ) ) {
204
-
205
- $attachment_url = wp_get_attachment_url( $attachment->ID );
206
- $base_url = str_replace( wp_basename( $attachment_url ), '', $attachment_url );
207
- $size_meta = $meta['sizes'][ $size ];
208
-
209
- $response['sizes'][ $size ] = array(
210
- 'url' => $base_url . $size_meta['file'],
211
- 'height' => $size_meta['height'],
212
- 'width' => $size_meta['width'],
213
- 'orientation' => $size_meta['height'] > $size_meta['width'] ? 'portrait' : 'landscape',
214
- );
215
- }
216
- }
217
-
218
- return $response;
219
- }
220
-
221
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_File_List.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
- /**
3
- * CMB file_list field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_File_List extends CMB2_Type_File_Base {
14
-
15
- public function render( $args = array() ) {
16
- $field = $this->field;
17
- $meta_value = $field->escaped_value();
18
- $name = $this->_name();
19
- $img_size = $field->args( 'preview_size' );
20
- $query_args = $field->args( 'query_args' );
21
- $output = '';
22
-
23
- // get an array of image size meta data, fallback to 'thumbnail'
24
- $img_size_data = parent::get_image_size_data( $img_size, 'thumbnail' );
25
-
26
- $output .= parent::render( array(
27
- 'type' => 'hidden',
28
- 'class' => 'cmb2-upload-file cmb2-upload-list',
29
- 'size' => 45,
30
- 'desc' => '',
31
- 'value' => '',
32
- 'data-previewsize' => sprintf( '[%d,%d]', $img_size_data['width'], $img_size_data['height'] ),
33
- 'data-sizename' => $img_size_data['name'],
34
- 'data-queryargs' => ! empty( $query_args ) ? json_encode( $query_args ) : '',
35
- 'js_dependencies' => 'media-editor',
36
- ) );
37
-
38
- $output .= parent::render( array(
39
- 'type' => 'button',
40
- 'class' => 'cmb2-upload-button button-secondary cmb2-upload-list',
41
- 'value' => esc_attr( $this->_text( 'add_upload_files_text', esc_html__( 'Add or Upload Files', 'cmb2' ) ) ),
42
- 'name' => false,
43
- 'id' => false,
44
- ) );
45
-
46
- $output .= '<ul id="' . $this->_id( '-status', false ) . '" class="cmb2-media-status cmb-attach-list">';
47
-
48
- if ( $meta_value && is_array( $meta_value ) ) {
49
-
50
- foreach ( $meta_value as $id => $fullurl ) {
51
- $id_input = parent::render( array(
52
- 'type' => 'hidden',
53
- 'value' => $fullurl,
54
- 'name' => $name . '[' . $id . ']',
55
- 'id' => 'filelist-' . $id,
56
- 'data-id' => $id,
57
- 'desc' => '',
58
- 'class' => false,
59
- ) );
60
-
61
- if ( $this->is_valid_img_ext( $fullurl ) ) {
62
-
63
- $output .= $this->img_status_output( array(
64
- 'image' => wp_get_attachment_image( $id, $img_size ),
65
- 'tag' => 'li',
66
- 'id_input' => $id_input,
67
- ) );
68
-
69
- } else {
70
-
71
- $output .= $this->file_status_output( array(
72
- 'value' => $fullurl,
73
- 'tag' => 'li',
74
- 'id_input' => $id_input,
75
- ) );
76
-
77
- }
78
- }
79
- }
80
-
81
- $output .= '</ul>';
82
-
83
- return $this->rendered( $output );
84
- }
85
-
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Multi_Base.php DELETED
@@ -1,110 +0,0 @@
1
- <?php
2
- /**
3
- * CMB Multi base field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- abstract class CMB2_Type_Multi_Base extends CMB2_Type_Base {
14
-
15
- /**
16
- * Generates html for an option element
17
- *
18
- * @since 1.1.0
19
- * @param array $args Arguments array containing value, label, and checked boolean
20
- * @return string Generated option element html
21
- */
22
- public function select_option( $args = array() ) {
23
- return sprintf( "\t" . '<option value="%s" %s>%s</option>', $args['value'], selected( isset( $args['checked'] ) && $args['checked'], true, false ), $args['label'] ) . "\n";
24
- }
25
-
26
- /**
27
- * Generates html for list item with input
28
- *
29
- * @since 1.1.0
30
- * @param array $args Override arguments
31
- * @param int $i Iterator value
32
- * @return string Gnerated list item html
33
- */
34
- public function list_input( $args = array(), $i ) {
35
- $a = $this->parse_args( 'list_input', array(
36
- 'type' => 'radio',
37
- 'class' => 'cmb2-option',
38
- 'name' => $this->_name(),
39
- 'id' => $this->_id( $i ),
40
- 'value' => $this->field->escaped_value(),
41
- 'label' => '',
42
- ), $args );
43
-
44
- return sprintf( "\t" . '<li><input%s/> <label for="%s">%s</label></li>' . "\n", $this->concat_attrs( $a, array( 'label' ) ), $a['id'], $a['label'] );
45
- }
46
-
47
- /**
48
- * Generates html for list item with checkbox input
49
- *
50
- * @since 1.1.0
51
- * @param array $args Override arguments
52
- * @param int $i Iterator value
53
- * @return string Gnerated list item html
54
- */
55
- public function list_input_checkbox( $args, $i ) {
56
- $saved_value = $this->field->escaped_value();
57
- if ( is_array( $saved_value ) && in_array( $args['value'], $saved_value ) ) {
58
- $args['checked'] = 'checked';
59
- }
60
- $args['type'] = 'checkbox';
61
- return $this->list_input( $args, $i );
62
- }
63
-
64
- /**
65
- * Generates html for concatenated items
66
- *
67
- * @since 1.1.0
68
- * @param array $args Optional arguments
69
- * @return string Concatenated html items
70
- */
71
- public function concat_items( $args = array() ) {
72
- $field = $this->field;
73
-
74
- $method = isset( $args['method'] ) ? $args['method'] : 'select_option';
75
- unset( $args['method'] );
76
-
77
- $value = null !== $field->escaped_value()
78
- ? $field->escaped_value()
79
- : $field->get_default();
80
-
81
- $value = CMB2_Utils::normalize_if_numeric( $value );
82
-
83
- $concatenated_items = '';
84
- $i = 1;
85
-
86
- $options = array();
87
- if ( $option_none = $field->args( 'show_option_none' ) ) {
88
- $options[''] = $option_none;
89
- }
90
- $options = $options + (array) $field->options();
91
- foreach ( $options as $opt_value => $opt_label ) {
92
-
93
- // Clone args & modify for just this item
94
- $a = $args;
95
-
96
- $a['value'] = $opt_value;
97
- $a['label'] = $opt_label;
98
-
99
- // Check if this option is the value of the input
100
- if ( $value === CMB2_Utils::normalize_if_numeric( $opt_value ) ) {
101
- $a['checked'] = 'checked';
102
- }
103
-
104
- $concatenated_items .= $this->$method( $a, $i++ );
105
- }
106
-
107
- return $concatenated_items;
108
- }
109
-
110
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Multicheck.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
- /**
3
- * CMB multicheck field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Multicheck extends CMB2_Type_Radio {
14
-
15
- /**
16
- * The type of radio field
17
- *
18
- * @var string
19
- */
20
- public $type = 'checkbox';
21
-
22
- public function render( $args = array() ) {
23
- $classes = false === $this->field->args( 'select_all_button' )
24
- ? 'cmb2-checkbox-list no-select-all cmb2-list'
25
- : 'cmb2-checkbox-list cmb2-list';
26
-
27
- $args = $this->parse_args( $this->type, array(
28
- 'class' => $classes,
29
- 'options' => $this->concat_items( array(
30
- 'name' => $this->_name() . '[]',
31
- 'method' => 'list_input_checkbox',
32
- ) ),
33
- 'desc' => $this->_desc( true ),
34
- ) );
35
-
36
- return $this->rendered( $this->ul( $args ) );
37
- }
38
-
39
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Oembed.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
- /**
3
- * CMB oembed field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Oembed extends CMB2_Type_Text {
14
-
15
- public function render( $args = array() ) {
16
- $field = $this->field;
17
-
18
- $meta_value = trim( $field->escaped_value() );
19
-
20
- $oembed = ! empty( $meta_value )
21
- ? cmb2_ajax()->get_oembed( array(
22
- 'url' => $field->escaped_value(),
23
- 'object_id' => $field->object_id,
24
- 'object_type' => $field->object_type,
25
- 'oembed_args' => array(
26
- 'width' => '640',
27
- ),
28
- 'field_id' => $this->_id( '', false ),
29
- ) )
30
- : '';
31
-
32
- return parent::render( array(
33
- 'class' => 'cmb2-oembed regular-text',
34
- 'data-objectid' => $field->object_id,
35
- 'data-objecttype' => $field->object_type,
36
- ) )
37
- . '<p class="cmb-spinner spinner"></p>'
38
- . '<div id="' . $this->_id( '-status' ) . '" class="cmb2-media-status ui-helper-clearfix embed_wrap">' . $oembed . '</div>';
39
- }
40
-
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Picker_Base.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
- /**
3
- * CMB Picker base field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- abstract class CMB2_Type_Picker_Base extends CMB2_Type_Text {
14
-
15
- /**
16
- * Parse the picker attributes.
17
- *
18
- * @since 2.2.0
19
- * @param string $arg 'date' or 'time'
20
- * @param array $args Optional arguments to modify (else use $this->field->args['attributes'])
21
- * @return array Array of field attributes
22
- */
23
- public function parse_picker_options( $arg = 'date', $args = array() ) {
24
- $att = 'data-' . $arg . 'picker';
25
- $update = empty( $args );
26
- $atts = array();
27
- $format = $this->field->args( $arg . '_format' );
28
-
29
- if ( $js_format = CMB2_Utils::php_to_js_dateformat( $format ) ) {
30
-
31
- if ( $update ) {
32
- $atts = $this->field->args( 'attributes' );
33
- } else {
34
- $atts = isset( $args['attributes'] )
35
- ? $args['attributes']
36
- : $atts;
37
- }
38
-
39
- // Don't override user-provided datepicker values
40
- $data = isset( $atts[ $att ] )
41
- ? json_decode( $atts[ $att ], true )
42
- : array();
43
-
44
- $data[ $arg . 'Format' ] = $js_format;
45
- $atts[ $att ] = function_exists( 'wp_json_encode' )
46
- ? wp_json_encode( $data )
47
- : json_encode( $data );
48
- }
49
-
50
- if ( $update ) {
51
- $this->field->args['attributes'] = $atts;
52
- }
53
-
54
- return array_merge( $args, $atts );
55
- }
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Radio.php DELETED
@@ -1,52 +0,0 @@
1
- <?php
2
- /**
3
- * CMB radio field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Radio extends CMB2_Type_Multi_Base {
14
-
15
- /**
16
- * The type of radio field
17
- *
18
- * @var string
19
- */
20
- public $type = 'radio';
21
-
22
- /**
23
- * Constructor
24
- *
25
- * @since 2.2.2
26
- *
27
- * @param CMB2_Types $types
28
- * @param array $args
29
- */
30
- public function __construct( CMB2_Types $types, $args = array(), $type = '' ) {
31
- parent::__construct( $types, $args );
32
- $this->type = $type ? $type : $this->type;
33
- }
34
-
35
- public function render() {
36
- $args = $this->parse_args( $this->type, array(
37
- 'class' => 'cmb2-radio-list cmb2-list',
38
- 'options' => $this->concat_items( array(
39
- 'label' => 'test',
40
- 'method' => 'list_input',
41
- ) ),
42
- 'desc' => $this->_desc( true ),
43
- ) );
44
-
45
- return $this->rendered( $this->ul( $args ) );
46
- }
47
-
48
- protected function ul( $a ) {
49
- return sprintf( '<ul class="%s">%s</ul>%s', $a['class'], $a['options'], $a['desc'] );
50
- }
51
-
52
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Select.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
- /**
3
- * CMB select field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Select extends CMB2_Type_Multi_Base {
14
-
15
- public function render() {
16
- $a = $this->parse_args( 'select', array(
17
- 'class' => 'cmb2_select',
18
- 'name' => $this->_name(),
19
- 'id' => $this->_id(),
20
- 'desc' => $this->_desc( true ),
21
- 'options' => $this->concat_items(),
22
- ) );
23
-
24
- $attrs = $this->concat_attrs( $a, array( 'desc', 'options' ) );
25
-
26
- return $this->rendered(
27
- sprintf( '<select%s>%s</select>%s', $attrs, $a['options'], $a['desc'] )
28
- );
29
- }
30
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Select_Timezone.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
- /**
3
- * CMB select_timezone field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Select_Timezone extends CMB2_Type_Select {
14
-
15
- public function render() {
16
-
17
- $this->field->args['default'] = $this->field->get_default()
18
- ? $this->field->get_default()
19
- : CMB2_Utils::timezone_string();
20
-
21
- $this->args = wp_parse_args( $this->args, array(
22
- 'class' => 'cmb2_select cmb2-select-timezone',
23
- 'options' => wp_timezone_choice( $this->field->escaped_value() ),
24
- 'desc' => $this->_desc(),
25
- ) );
26
-
27
- return parent::render();
28
- }
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Base.php DELETED
@@ -1,189 +0,0 @@
1
- <?php
2
- /**
3
- * CMB Taxonomy base field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- abstract class CMB2_Type_Taxonomy_Base extends CMB2_Type_Multi_Base {
14
-
15
- /**
16
- * Parent term ID when looping hierarchical terms.
17
- *
18
- * @var integer|null
19
- */
20
- protected $parent = null;
21
-
22
- /**
23
- * Checks if we can get a post object, and if so, uses `get_the_terms` which utilizes caching.
24
- *
25
- * @since 1.0.2
26
- * @return mixed Array of terms on success
27
- */
28
- public function get_object_terms() {
29
- switch ( $this->field->object_type ) {
30
- case 'options-page':
31
- case 'term':
32
- return $this->options_terms();
33
- case 'post':
34
- // WP caches internally so it's better to use
35
- return get_the_terms( $this->field->object_id, $this->field->args( 'taxonomy' ) );
36
-
37
- default:
38
- return $this->non_post_object_terms();
39
- }
40
- }
41
-
42
- /**
43
- * Gets the term objects for the terms stored via options boxes.
44
- *
45
- * @since 2.2.4
46
- * @return mixed Array of terms on success
47
- */
48
- public function options_terms() {
49
- if ( empty( $this->field->value ) ) {
50
- return array();
51
- }
52
-
53
- $terms = (array) $this->field->value;
54
-
55
- foreach ( $terms as $index => $term ) {
56
- $terms[ $index ] = get_term_by( 'slug', $term, $this->field->args( 'taxonomy' ) );
57
- }
58
-
59
- return $terms;
60
- }
61
-
62
- /**
63
- * For non-post objects, wraps the call to wp_get_object_terms with transient caching.
64
- *
65
- * @since 2.2.4
66
- * @return mixed Array of terms on success
67
- */
68
- public function non_post_object_terms() {
69
- $object_id = $this->field->object_id;
70
- $taxonomy = $this->field->args( 'taxonomy' );
71
-
72
- $cache_key = "cmb-cache-{$taxonomy}-{$object_id}";
73
-
74
- // Check cache
75
- $cached = get_transient( $cache_key );
76
-
77
- if ( ! $cached ) {
78
- $cached = wp_get_object_terms( $object_id, $taxonomy );
79
- // Do our own (minimal) caching. Long enough for a page-load.
80
- set_transient( $cache_key, $cached, 60 );
81
- }
82
-
83
- return $cached;
84
- }
85
-
86
- /**
87
- * Wrapper for `get_terms` to account for changes in WP 4.6 where taxonomy is expected
88
- * as part of the arguments.
89
- *
90
- * @since 2.2.2
91
- * @return mixed Array of terms on success
92
- */
93
- public function get_terms() {
94
- $args = array(
95
- 'taxonomy' => $this->field->args( 'taxonomy' ),
96
- 'hide_empty' => false,
97
- );
98
-
99
- if ( null !== $this->parent ) {
100
- $args['parent'] = $this->parent;
101
- }
102
-
103
- $args = wp_parse_args( $this->field->prop( 'query_args', array() ), $args );
104
-
105
- return CMB2_Utils::wp_at_least( '4.5.0' )
106
- ? get_terms( $args )
107
- : get_terms( $this->field->args( 'taxonomy' ), http_build_query( $args ) );
108
- }
109
-
110
- protected function no_terms_result( $error, $tag = 'li' ) {
111
- if ( is_wp_error( $error ) ) {
112
- $message = $error->get_error_message();
113
- $data = 'data-error="' . esc_attr( $error->get_error_code() ) . '"';
114
- } else {
115
- $message = $this->_text( 'no_terms_text', esc_html__( 'No terms', 'cmb2' ) );
116
- $data = '';
117
- }
118
-
119
- $this->field->args['select_all_button'] = false;
120
-
121
- return sprintf( '<%3$s><label %1$s>%2$s</label></%3$s>', $data, esc_html( $message ), $tag );
122
- }
123
-
124
- public function get_object_term_or_default() {
125
- $saved_terms = $this->get_object_terms();
126
-
127
- return is_wp_error( $saved_terms ) || empty( $saved_terms )
128
- ? $this->field->get_default()
129
- : array_shift( $saved_terms )->slug;
130
- }
131
-
132
- /**
133
- * Takes a list of all tax terms and outputs.
134
- *
135
- * @since 2.2.5
136
- *
137
- * @param array $all_terms Array of all terms.
138
- * @param array|string $saved Array of terms set to the object, or single term slug.
139
- *
140
- * @return string List of terms.
141
- */
142
- protected function loop_terms( $all_terms, $saved_terms ) {
143
- return '';
144
- }
145
-
146
- /**
147
- * Build children hierarchy.
148
- *
149
- * @param object $parent_term The parent term object.
150
- * @param array|string $saved Array of terms set to the object, or single term slug.
151
- *
152
- * @return string List of terms.
153
- */
154
- protected function build_children( $parent_term, $saved ) {
155
- if ( empty( $parent_term->term_id ) ) {
156
- return '';
157
- }
158
-
159
- $this->parent = $parent_term->term_id;
160
-
161
- $terms = $this->get_terms();
162
- $options = '';
163
-
164
- if ( ! empty( $terms ) && is_array( $terms ) ) {
165
- $options .= $this->child_option_output( $terms, $saved );
166
- }
167
-
168
- return $options;
169
- }
170
-
171
- /**
172
- * Build child terms output.
173
- *
174
- * @since 2.6.1
175
- *
176
- * @param array $terms Array of child terms.
177
- * @param array|string $saved Array of terms set to the object, or single term slug.
178
- *
179
- * @return string Child option output.
180
- */
181
- public function child_option_output( $terms, $saved ) {
182
- $output = '<li class="cmb2-indented-hierarchy"><ul>';
183
- $output .= $this->loop_terms( $terms, $saved );
184
- $output .= '</ul></li>';
185
-
186
- return $output;
187
- }
188
-
189
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck.php DELETED
@@ -1,76 +0,0 @@
1
- <?php
2
- /**
3
- * CMB taxonomy_multicheck field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Taxonomy_Multicheck extends CMB2_Type_Taxonomy_Base {
14
- protected $counter = 0;
15
-
16
- public function render() {
17
- return $this->rendered(
18
- $this->types->radio( array(
19
- 'class' => $this->get_wrapper_classes(),
20
- 'options' => $this->get_term_options(),
21
- ), 'taxonomy_multicheck' )
22
- );
23
- }
24
-
25
- protected function get_term_options() {
26
- $all_terms = $this->get_terms();
27
-
28
- if ( ! $all_terms || is_wp_error( $all_terms ) ) {
29
- return $this->no_terms_result( $all_terms );
30
- }
31
-
32
- return $this->loop_terms( $all_terms, $this->get_object_term_or_default() );
33
- }
34
-
35
- protected function loop_terms( $all_terms, $saved_terms ) {
36
- $options = '';
37
- foreach ( $all_terms as $term ) {
38
- $options .= $this->list_term_input( $term, $saved_terms );
39
- }
40
-
41
- return $options;
42
- }
43
-
44
- protected function list_term_input( $term, $saved_terms ) {
45
- $args = array(
46
- 'value' => $term->slug,
47
- 'label' => $term->name,
48
- 'type' => 'checkbox',
49
- 'name' => $this->_name() . '[]',
50
- );
51
-
52
- if ( is_array( $saved_terms ) && in_array( $term->slug, $saved_terms ) ) {
53
- $args['checked'] = 'checked';
54
- }
55
-
56
- return $this->list_input( $args, ++$this->counter );
57
- }
58
-
59
- public function get_object_term_or_default() {
60
- $saved_terms = $this->get_object_terms();
61
-
62
- return is_wp_error( $saved_terms ) || empty( $saved_terms )
63
- ? $this->field->get_default()
64
- : wp_list_pluck( $saved_terms, 'slug' );
65
- }
66
-
67
- protected function get_wrapper_classes() {
68
- $classes = 'cmb2-checkbox-list cmb2-list';
69
- if ( false === $this->field->args( 'select_all_button' ) ) {
70
- $classes .= ' no-select-all';
71
- }
72
-
73
- return $classes;
74
- }
75
-
76
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck_Hierarchical.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
- /**
3
- * CMB taxonomy_multicheck_hierarchical field type
4
- *
5
- * @since 2.2.5
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Taxonomy_Multicheck_Hierarchical extends CMB2_Type_Taxonomy_Multicheck {
14
-
15
- /**
16
- * Parent term ID when looping hierarchical terms.
17
- *
18
- * @var integer
19
- */
20
- protected $parent = 0;
21
-
22
- public function render() {
23
- return $this->rendered(
24
- $this->types->radio( array(
25
- 'class' => $this->get_wrapper_classes(),
26
- 'options' => $this->get_term_options(),
27
- ), 'taxonomy_multicheck_hierarchical' )
28
- );
29
- }
30
-
31
- protected function list_term_input( $term, $saved_terms ) {
32
- $options = parent::list_term_input( $term, $saved_terms );
33
- $children = $this->build_children( $term, $saved_terms );
34
-
35
- if ( ! empty( $children ) ) {
36
- $options .= $children;
37
- }
38
-
39
- return $options;
40
- }
41
-
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php DELETED
@@ -1,92 +0,0 @@
1
- <?php
2
- /**
3
- * CMB taxonomy_radio field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Taxonomy_Radio extends CMB2_Type_Taxonomy_Base {
14
- protected $counter = 0;
15
-
16
- public function render() {
17
- return $this->rendered(
18
- $this->types->radio( array(
19
- 'options' => $this->get_term_options(),
20
- ), 'taxonomy_radio' )
21
- );
22
- }
23
-
24
- protected function get_term_options() {
25
- $all_terms = $this->get_terms();
26
-
27
- if ( ! $all_terms || is_wp_error( $all_terms ) ) {
28
- return $this->no_terms_result( $all_terms );
29
- }
30
-
31
- $saved_term = $this->get_object_term_or_default();
32
- $option_none = $this->field->args( 'show_option_none' );
33
- $options = '';
34
-
35
- if ( ! empty( $option_none ) ) {
36
-
37
- $field_id = $this->_id( '', false );
38
-
39
- /**
40
- * Default (option-none) taxonomy-radio value.
41
- *
42
- * @since 1.3.0
43
- *
44
- * @param string $option_none_value Default (option-none) taxonomy-radio value.
45
- */
46
- $option_none_value = apply_filters( 'cmb2_taxonomy_radio_default_value', '' );
47
-
48
- /**
49
- * Default (option-none) taxonomy-radio value.
50
- *
51
- * The dynamic portion of the hook name, $field_id, refers to the field id attribute.
52
- *
53
- * @since 1.3.0
54
- *
55
- * @param string $option_none_value Default (option-none) taxonomy-radio value.
56
- */
57
- $option_none_value = apply_filters( "cmb2_taxonomy_radio_{$field_id}_default_value", $option_none_value );
58
-
59
- $options .= $this->list_term_input( (object) array(
60
- 'slug' => $option_none_value,
61
- 'name' => $option_none,
62
- ), $saved_term );
63
- }
64
-
65
- $options .= $this->loop_terms( $all_terms, $saved_term );
66
-
67
- return $options;
68
- }
69
-
70
- protected function loop_terms( $all_terms, $saved_term ) {
71
- $options = '';
72
- foreach ( $all_terms as $term ) {
73
- $options .= $this->list_term_input( $term, $saved_term );
74
- }
75
-
76
- return $options;
77
- }
78
-
79
- protected function list_term_input( $term, $saved_term ) {
80
- $args = array(
81
- 'value' => $term->slug,
82
- 'label' => $term->name,
83
- );
84
-
85
- if ( $saved_term == $term->slug ) {
86
- $args['checked'] = 'checked';
87
- }
88
-
89
- return $this->list_input( $args, ++$this->counter );
90
- }
91
-
92
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Radio_Hierarchical.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
- /**
3
- * CMB taxonomy_radio_hierarchical field type
4
- *
5
- * @since 2.2.5
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Taxonomy_Radio_Hierarchical extends CMB2_Type_Taxonomy_Radio {
14
-
15
- /**
16
- * Parent term ID when looping hierarchical terms.
17
- *
18
- * @var integer
19
- */
20
- protected $parent = 0;
21
-
22
- public function render() {
23
- return $this->rendered(
24
- $this->types->radio( array(
25
- 'options' => $this->get_term_options(),
26
- ), 'taxonomy_radio_hierarchical' )
27
- );
28
- }
29
-
30
- protected function list_term_input( $term, $saved_term ) {
31
- $options = parent::list_term_input( $term, $saved_term );
32
- $children = $this->build_children( $term, $saved_term );
33
-
34
- if ( ! empty( $children ) ) {
35
- $options .= $children;
36
- }
37
-
38
- return $options;
39
- }
40
-
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php DELETED
@@ -1,102 +0,0 @@
1
- <?php
2
- /**
3
- * CMB taxonomy_select field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Taxonomy_Select extends CMB2_Type_Taxonomy_Base {
14
-
15
- /**
16
- * Current Term Object.
17
- *
18
- * @since 2.6.1
19
- *
20
- * @var null|WP_Term
21
- */
22
- public $current_term = null;
23
-
24
- /**
25
- * Saved Term Object.
26
- *
27
- * @since 2.6.1
28
- *
29
- * @var null|WP_Term
30
- */
31
- public $saved_term = null;
32
-
33
- public function render() {
34
- return $this->rendered(
35
- $this->types->select( array(
36
- 'options' => $this->get_term_options(),
37
- ) )
38
- );
39
- }
40
-
41
- protected function get_term_options() {
42
- $all_terms = $this->get_terms();
43
-
44
- if ( ! $all_terms || is_wp_error( $all_terms ) ) {
45
- return $this->no_terms_result( $all_terms, 'strong' );
46
- }
47
-
48
- $this->saved_term = $this->get_object_term_or_default();
49
- $option_none = $this->field->args( 'show_option_none' );
50
- $options = '';
51
-
52
- if ( ! empty( $option_none ) ) {
53
-
54
- $field_id = $this->_id( '', false );
55
-
56
- /**
57
- * Default (option-none) taxonomy-select value.
58
- *
59
- * @since 1.3.0
60
- *
61
- * @param string $option_none_value Default (option-none) taxonomy-select value.
62
- */
63
- $option_none_value = apply_filters( 'cmb2_taxonomy_select_default_value', '' );
64
-
65
- /**
66
- * Default (option-none) taxonomy-select value.
67
- *
68
- * The dynamic portion of the hook name, $field_id, refers to the field id attribute.
69
- *
70
- * @since 1.3.0
71
- *
72
- * @param string $option_none_value Default (option-none) taxonomy-select value.
73
- */
74
- $option_none_value = apply_filters( "cmb2_taxonomy_select_{$field_id}_default_value", $option_none_value );
75
-
76
- $options .= $this->select_option( array(
77
- 'label' => $option_none,
78
- 'value' => $option_none_value,
79
- 'checked' => $this->saved_term == $option_none_value,
80
- ) );
81
- }
82
-
83
- $options .= $this->loop_terms( $all_terms, $this->saved_term );
84
-
85
- return $options;
86
- }
87
-
88
- protected function loop_terms( $all_terms, $saved_term ) {
89
- $options = '';
90
-
91
- foreach ( $all_terms as $term ) {
92
- $this->current_term = $term;
93
- $options .= $this->select_option( array(
94
- 'label' => $term->name,
95
- 'value' => $term->slug,
96
- 'checked' => $this->saved_term === $term->slug,
97
- ) );
98
- }
99
-
100
- return $options;
101
- }
102
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Select_Hierarchical.php DELETED
@@ -1,73 +0,0 @@
1
- <?php
2
- /**
3
- * CMB taxonomy_select_hierarchical field type
4
- *
5
- * @since 2.6.1
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Taxonomy_Select_Hierarchical extends CMB2_Type_Taxonomy_Select {
14
-
15
- /**
16
- * Parent term ID when looping hierarchical terms.
17
- *
18
- * @since 2.6.1
19
- *
20
- * @var integer
21
- */
22
- protected $parent = 0;
23
-
24
- /**
25
- * Child loop depth.
26
- *
27
- * @since 2.6.1
28
- *
29
- * @var integer
30
- */
31
- protected $level = 0;
32
-
33
- public function render() {
34
- return $this->rendered(
35
- $this->types->select( array(
36
- 'options' => $this->get_term_options(),
37
- ), 'taxonomy_select_hierarchical' )
38
- );
39
- }
40
-
41
- public function select_option( $args = array() ) {
42
- if ( $this->level > 0 ) {
43
- $args['label'] = str_repeat( '&nbsp;&nbsp;&nbsp;&nbsp;', $this->level ) . $args['label'];
44
- }
45
- $option = parent::select_option( $args );
46
- $children = $this->build_children( $this->current_term, $this->saved_term );
47
-
48
- if ( ! empty( $children ) ) {
49
- $option .= $children;
50
- }
51
-
52
- return $option;
53
- }
54
-
55
- /**
56
- * Build children hierarchy.
57
- *
58
- * @since 2.6.1
59
- *
60
- * @param array $terms Array of child terms.
61
- * @param array|string $saved Array of terms set to the object, or single term slug.
62
- *
63
- * @return string Child option output.
64
- */
65
- public function child_option_output( $terms, $saved ) {
66
- $this->level++;
67
- $output = $this->loop_terms( $terms, $saved );
68
- $this->level--;
69
-
70
- return $output;
71
- }
72
-
73
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Text.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
- /**
3
- * CMB text field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Text extends CMB2_Type_Counter_Base {
14
-
15
- /**
16
- * The type of field
17
- *
18
- * @var string
19
- */
20
- public $type = 'input';
21
-
22
- /**
23
- * Constructor
24
- *
25
- * @since 2.2.2
26
- *
27
- * @param CMB2_Types $types
28
- * @param array $args
29
- */
30
- public function __construct( CMB2_Types $types, $args = array(), $type = '' ) {
31
- parent::__construct( $types, $args );
32
- $this->type = $type ? $type : $this->type;
33
- }
34
-
35
- /**
36
- * Handles outputting an 'input' element
37
- *
38
- * @since 1.1.0
39
- * @param array $args Override arguments
40
- * @return string Form input element
41
- */
42
- public function render( $args = array() ) {
43
- $args = empty( $args ) ? $this->args : $args;
44
- $a = $this->parse_args( $this->type, array(
45
- 'type' => 'text',
46
- 'class' => 'regular-text',
47
- 'name' => $this->_name(),
48
- 'id' => $this->_id(),
49
- 'value' => $this->field->escaped_value(),
50
- 'desc' => $this->_desc( true ),
51
- 'js_dependencies' => array(),
52
- ), $args );
53
-
54
- // Add character counter?
55
- $a = $this->maybe_update_attributes_for_char_counter( $a );
56
-
57
- return $this->rendered(
58
- sprintf( '<input%s/>%s', $this->concat_attrs( $a, array( 'desc' ) ), $a['desc'] )
59
- );
60
- }
61
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Text_Date.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
- /**
3
- * CMB text_date field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Text_Date extends CMB2_Type_Picker_Base {
14
-
15
- public function render( $args = array() ) {
16
- $args = $this->parse_args( 'text_date', array(
17
- 'class' => 'cmb2-text-small cmb2-datepicker',
18
- 'value' => $this->field->get_timestamp_format(),
19
- 'desc' => $this->_desc(),
20
- 'js_dependencies' => array( 'jquery-ui-core', 'jquery-ui-datepicker' ),
21
- ) );
22
-
23
- if ( false === strpos( $args['class'], 'timepicker' ) ) {
24
- $this->parse_picker_options( 'date' );
25
- }
26
-
27
- return parent::render( $args );
28
- }
29
-
30
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php DELETED
@@ -1,78 +0,0 @@
1
- <?php
2
- /**
3
- * CMB text_datetime_timestamp field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Text_Datetime_Timestamp extends CMB2_Type_Picker_Base {
14
-
15
- public function render( $args = array() ) {
16
- $field = $this->field;
17
-
18
- $value = $field->escaped_value();
19
- if ( empty( $value ) ) {
20
- $value = $field->get_default();
21
- }
22
-
23
- $args = wp_parse_args( $this->args, array(
24
- 'value' => $value,
25
- 'desc' => $this->_desc(),
26
- 'datepicker' => array(),
27
- 'timepicker' => array(),
28
- ) );
29
-
30
- if ( empty( $args['value'] ) ) {
31
- $args['value'] = $value;
32
- // This will be used if there is a select_timezone set for this field
33
- $tz_offset = $field->field_timezone_offset();
34
- if ( ! empty( $tz_offset ) ) {
35
- $args['value'] -= $tz_offset;
36
- }
37
- }
38
-
39
- $has_good_value = ! empty( $args['value'] ) && ! is_array( $args['value'] );
40
-
41
- $date_input = parent::render( $this->date_args( $args, $has_good_value ) );
42
- $time_input = parent::render( $this->time_args( $args, $has_good_value ) );
43
-
44
- return $this->rendered( $date_input . "\n" . $time_input );
45
- }
46
-
47
- public function date_args( $args, $has_good_value ) {
48
- $date_args = wp_parse_args( $args['datepicker'], array(
49
- 'class' => 'cmb2-text-small cmb2-datepicker',
50
- 'name' => $this->_name( '[date]' ),
51
- 'id' => $this->_id( '_date' ),
52
- 'value' => $has_good_value ? $this->field->get_timestamp_format( 'date_format', $args['value'] ) : '',
53
- 'desc' => '',
54
- ) );
55
-
56
- $date_args['rendered'] = true;
57
-
58
- // Let's get the date-format, and set it up as a data attr for the field.
59
- return $this->parse_picker_options( 'date', $date_args );
60
- }
61
-
62
- public function time_args( $args, $has_good_value ) {
63
- $time_args = wp_parse_args( $args['timepicker'], array(
64
- 'class' => 'cmb2-timepicker text-time',
65
- 'name' => $this->_name( '[time]' ),
66
- 'id' => $this->_id( '_time' ),
67
- 'value' => $has_good_value ? $this->field->get_timestamp_format( 'time_format', $args['value'] ) : '',
68
- 'desc' => $args['desc'],
69
- 'js_dependencies' => array( 'jquery-ui-core', 'jquery-ui-datepicker', 'jquery-ui-datetimepicker' ),
70
- ) );
71
-
72
- $time_args['rendered'] = true;
73
-
74
- // Let's get the time-format, and set it up as a data attr for the field.
75
- return $this->parse_picker_options( 'time', $time_args );
76
- }
77
-
78
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp_Timezone.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
- /**
3
- * CMB text_datetime_timestamp_timezone field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Text_Datetime_Timestamp_Timezone extends CMB2_Type_Base {
14
-
15
- public function render( $args = array() ) {
16
- $field = $this->field;
17
-
18
- $value = $field->escaped_value();
19
- if ( empty( $value ) ) {
20
- $value = $field->get_default();
21
- }
22
-
23
- $args = wp_parse_args( $this->args, array(
24
- 'value' => $value,
25
- 'desc' => $this->_desc( true ),
26
- 'text_datetime_timestamp' => array(),
27
- 'select_timezone' => array(),
28
- ) );
29
-
30
- $args['value'] = $value;
31
- if ( is_array( $args['value'] ) ) {
32
- $args['value'] = '';
33
- }
34
-
35
- $datetime = maybe_unserialize( $args['value'] );
36
- $value = $tzstring = '';
37
-
38
- if ( $datetime && $datetime instanceof DateTime ) {
39
- $tz = $datetime->getTimezone();
40
- $tzstring = $tz->getName();
41
- $value = $datetime->getTimestamp();
42
- }
43
-
44
- $timestamp_args = wp_parse_args( $args['text_datetime_timestamp'], array(
45
- 'desc' => '',
46
- 'value' => $value,
47
- 'rendered' => true,
48
- ) );
49
- $datetime_timestamp = $this->types->text_datetime_timestamp( $timestamp_args );
50
-
51
- $timezone_select_args = wp_parse_args( $args['select_timezone'], array(
52
- 'class' => 'cmb2_select cmb2-select-timezone',
53
- 'name' => $this->_name( '[timezone]' ),
54
- 'id' => $this->_id( '_timezone' ),
55
- 'options' => wp_timezone_choice( $tzstring ),
56
- 'desc' => $args['desc'],
57
- 'rendered' => true,
58
- ) );
59
- $select = $this->types->select( $timezone_select_args );
60
-
61
- return $this->rendered(
62
- $datetime_timestamp . "\n" . $select
63
- );
64
- }
65
-
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Text_Time.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- /**
3
- * CMB text_time field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Text_Time extends CMB2_Type_Text_Date {
14
-
15
- public function render( $args = array() ) {
16
- $this->args = $this->parse_picker_options( 'time', wp_parse_args( $this->args, array(
17
- 'class' => 'cmb2-timepicker text-time',
18
- 'value' => $this->field->get_timestamp_format( 'time_format' ),
19
- 'js_dependencies' => array( 'jquery-ui-core', 'jquery-ui-datepicker', 'jquery-ui-datetimepicker' ),
20
- ) ) );
21
-
22
- return parent::render();
23
- }
24
-
25
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Textarea.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
- /**
3
- * CMB textarea field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Textarea extends CMB2_Type_Counter_Base {
14
-
15
- /**
16
- * Handles outputting an 'textarea' element
17
- *
18
- * @since 1.1.0
19
- * @param array $args Override arguments
20
- * @return string Form textarea element
21
- */
22
- public function render( $args = array() ) {
23
- $args = empty( $args ) ? $this->args : $args;
24
- $a = $this->parse_args( 'textarea', array(
25
- 'class' => 'cmb2_textarea',
26
- 'name' => $this->_name(),
27
- 'id' => $this->_id(),
28
- 'cols' => 60,
29
- 'rows' => 10,
30
- 'value' => $this->field->escaped_value( 'esc_textarea' ),
31
- 'desc' => $this->_desc( true ),
32
- ), $args );
33
-
34
- // Add character counter?
35
- $a = $this->maybe_update_attributes_for_char_counter( $a );
36
-
37
- return $this->rendered(
38
- sprintf( '<textarea%s>%s</textarea>%s', $this->concat_attrs( $a, array( 'desc', 'value' ) ), $a['value'], $a['desc'] )
39
- );
40
- }
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Textarea_Code.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
- /**
3
- * CMB textarea_code field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Textarea_Code extends CMB2_Type_Textarea {
14
-
15
- /**
16
- * Handles outputting an 'textarea' element
17
- *
18
- * @since 1.1.0
19
- * @param array $args Override arguments
20
- * @return string Form textarea element
21
- */
22
- public function render( $args = array() ) {
23
- $args = wp_parse_args( $args, array(
24
- 'class' => 'cmb2-textarea-code',
25
- 'desc' => '</pre>' . $this->_desc( true ),
26
- ) );
27
-
28
- if ( true !== $this->field->options( 'disable_codemirror' )
29
- && function_exists( 'wp_enqueue_code_editor' ) ) {
30
- $args['js_dependencies'] = array( 'code-editor' );
31
- } else {
32
- $args['class'] = rtrim( $args['class'] ) . ' disable-codemirror';
33
- }
34
-
35
- return $this->rendered(
36
- sprintf( '<pre>%s', parent::render( $args ) )
37
- );
38
- }
39
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Title.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- /**
3
- * CMB title field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- */
13
- class CMB2_Type_Title extends CMB2_Type_Base {
14
-
15
- /**
16
- * Handles outputting an 'title' element
17
- *
18
- * @return string Heading element
19
- */
20
- public function render() {
21
- $name = $this->field->args( 'name' );
22
- $tag = 'span';
23
-
24
- if ( ! empty( $name ) ) {
25
- $tag = $this->field->object_type == 'post' ? 'h5' : 'h3';
26
- }
27
-
28
- $a = $this->parse_args( 'title', array(
29
- 'tag' => $tag,
30
- 'class' => empty( $name ) ? 'cmb2-metabox-title-anchor' : 'cmb2-metabox-title',
31
- 'name' => $name,
32
- 'desc' => $this->_desc( true ),
33
- 'id' => str_replace( '_', '-', sanitize_html_class( $this->field->id() ) ),
34
- ) );
35
-
36
- return $this->rendered(
37
- sprintf(
38
- '<%1$s %2$s>%3$s</%1$s>%4$s',
39
- $a['tag'],
40
- $this->concat_attrs( $a, array( 'tag', 'name', 'desc' ) ),
41
- $a['name'],
42
- $a['desc']
43
- )
44
- );
45
- }
46
-
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/includes/types/CMB2_Type_Wysiwyg.php DELETED
@@ -1,103 +0,0 @@
1
- <?php
2
- /**
3
- * CMB wysiwyg field type
4
- *
5
- * @since 2.2.2
6
- *
7
- * @category WordPress_Plugin
8
- * @package CMB2
9
- * @author CMB2 team
10
- * @license GPL-2.0+
11
- * @link https://cmb2.io
12
- *
13
- * @method string _id()
14
- * @method string _desc()
15
- */
16
- class CMB2_Type_Wysiwyg extends CMB2_Type_Textarea {
17
-
18
- /**
19
- * Handles outputting a 'wysiwyg' element
20
- * @since 1.1.0
21
- * @return string Form wysiwyg element
22
- */
23
- public function render( $args = array() ) {
24
- $field = $this->field;
25
- $a = $this->parse_args( 'wysiwyg', array(
26
- 'id' => $this->_id( '', false ),
27
- 'value' => $field->escaped_value( 'stripslashes' ),
28
- 'desc' => $this->_desc( true ),
29
- 'options' => $field->options(),
30
- ) );
31
-
32
- if ( ! $field->group ) {
33
-
34
- $a = $this->maybe_update_attributes_for_char_counter( $a );
35
-
36
- if ( $this->has_counter ) {
37
- $a['options']['editor_class'] = ! empty( $a['options']['editor_class'] )
38
- ? $a['options']['editor_class'] . ' cmb2-count-chars'
39
- : 'cmb2-count-chars';
40
- }
41
-
42
- return $this->rendered( $this->get_wp_editor( $a ) . $a['desc'] );
43
- }
44
-
45
- // Character counter not currently working for grouped WYSIWYG
46
- $this->field->args['char_counter'] = false;
47
-
48
- // wysiwyg fields in a group need some special handling.
49
- $field->add_js_dependencies( array( 'wp-util', 'cmb2-wysiwyg' ) );
50
-
51
- // Hook in our template-output to the footer.
52
- add_action( is_admin() ? 'admin_footer' : 'wp_footer', array( $this, 'add_wysiwyg_template_for_group' ) );
53
-
54
- return $this->rendered(
55
- sprintf( '<div class="cmb2-wysiwyg-wrap">%s', parent::render( array(
56
- 'class' => 'cmb2_textarea cmb2-wysiwyg-placeholder',
57
- 'data-groupid' => $field->group->id(),
58
- 'data-iterator' => $field->group->index,
59
- 'data-fieldid' => $field->id( true ),
60
- 'desc' => '</div>' . $this->_desc( true ),
61
- ) ) )
62
- );
63
- }
64
-
65
- protected function get_wp_editor( $args ) {
66
- ob_start();
67
- wp_editor( $args['value'], $args['id'], $args['options'] );
68
- return ob_get_clean();
69
- }
70
-
71
- public function add_wysiwyg_template_for_group() {
72
- $group_id = $this->field->group->id();
73
- $field_id = $this->field->id( true );
74
- $hash = $this->field->hash_id();
75
- $options = $this->field->options();
76
- $options['textarea_name'] = 'cmb2_n_' . $group_id . $field_id;
77
-
78
- // Initate the editor with special id/value/name so we can retrieve the options in JS.
79
- $editor = $this->get_wp_editor( array(
80
- 'value' => 'cmb2_v_' . $group_id . $field_id,
81
- 'id' => 'cmb2_i_' . $group_id . $field_id,
82
- 'options' => $options,
83
- ) );
84
-
85
- // Then replace the special id/value/name with underscore placeholders.
86
- $editor = str_replace( array(
87
- 'cmb2_n_' . $group_id . $field_id,
88
- 'cmb2_v_' . $group_id . $field_id,
89
- 'cmb2_i_' . $group_id . $field_id,
90
- ), array(
91
- '{{ data.name }}',
92
- '{{{ data.value }}}',
93
- '{{ data.id }}',
94
- ), $editor );
95
-
96
- // And put the editor instance in a JS template wrapper.
97
- echo '<script type="text/template" id="tmpl-cmb2-wysiwyg-' . $group_id . '-' . $field_id . '">';
98
- // Need to wrap the template in a wrapper div w/ specific data attributes which will be used when adding/removing rows.
99
- echo '<div class="cmb2-wysiwyg-inner-wrap" data-iterator="{{ data.iterator }}" data-groupid="' . $group_id . '" data-id="' . $field_id . '" data-hash="' . $hash . '">' . $editor . '</div>';
100
- echo '</script>';
101
- }
102
-
103
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/index.php DELETED
@@ -1 +0,0 @@
1
- <?php // Silence is golden.
 
includes/lib/cmb2/init.php DELETED
@@ -1,198 +0,0 @@
1
- <?php
2
- /**
3
- * The initation loader for CMB2, and the main plugin file.
4
- *
5
- * @category WordPress_Plugin
6
- * @package CMB2
7
- * @author CMB2 team
8
- * @license GPL-2.0+
9
- * @link https://cmb2.io
10
- *
11
- * Plugin Name: CMB2
12
- * Plugin URI: https://github.com/CMB2/CMB2
13
- * Description: CMB2 will create metaboxes and forms with custom fields that will blow your mind.
14
- * Author: CMB2 team
15
- * Author URI: https://cmb2.io
16
- * Contributors: Justin Sternberg (@jtsternberg / dsgnwrks.pro)
17
- * WebDevStudios (@webdevstudios / webdevstudios.com)
18
- * Human Made (@humanmadeltd / hmn.md)
19
- * Jared Atchison (@jaredatch / jaredatchison.com)
20
- * Bill Erickson (@billerickson / billerickson.net)
21
- * Andrew Norcross (@norcross / andrewnorcross.com)
22
- *
23
- * Version: 2.9.0
24
- *
25
- * Text Domain: cmb2
26
- * Domain Path: languages
27
- *
28
- *
29
- * Released under the GPL license
30
- * http://www.opensource.org/licenses/gpl-license.php
31
- *
32
- * This is an add-on for WordPress
33
- * https://wordpress.org/
34
- *
35
- * **********************************************************************
36
- * This program is free software; you can redistribute it and/or modify
37
- * it under the terms of the GNU General Public License as published by
38
- * the Free Software Foundation; either version 2 of the License, or
39
- * (at your option) any later version.
40
- *
41
- * This program is distributed in the hope that it will be useful,
42
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
43
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44
- * GNU General Public License for more details.
45
- * **********************************************************************
46
- */
47
-
48
- /**
49
- * *********************************************************************
50
- * You should not edit the code below
51
- * (or any code in the included files)
52
- * or things might explode!
53
- * ***********************************************************************
54
- */
55
-
56
- if ( ! class_exists( 'CMB2_Bootstrap_290', false ) ) {
57
-
58
- /**
59
- * Handles checking for and loading the newest version of CMB2
60
- *
61
- * @since 2.0.0
62
- *
63
- * @category WordPress_Plugin
64
- * @package CMB2
65
- * @author CMB2 team
66
- * @license GPL-2.0+
67
- * @link https://cmb2.io
68
- */
69
- class CMB2_Bootstrap_290 {
70
-
71
- /**
72
- * Current version number
73
- *
74
- * @var string
75
- * @since 1.0.0
76
- */
77
- const VERSION = '2.9.0';
78
-
79
- /**
80
- * Current version hook priority.
81
- * Will decrement with each release
82
- *
83
- * @var int
84
- * @since 2.0.0
85
- */
86
- const PRIORITY = 9959;
87
-
88
- /**
89
- * Single instance of the CMB2_Bootstrap_290 object
90
- *
91
- * @var CMB2_Bootstrap_290
92
- */
93
- public static $single_instance = null;
94
-
95
- /**
96
- * Creates/returns the single instance CMB2_Bootstrap_290 object
97
- *
98
- * @since 2.0.0
99
- * @return CMB2_Bootstrap_290 Single instance object
100
- */
101
- public static function initiate() {
102
- if ( null === self::$single_instance ) {
103
- self::$single_instance = new self();
104
- }
105
- return self::$single_instance;
106
- }
107
-
108
- /**
109
- * Starts the version checking process.
110
- * Creates CMB2_LOADED definition for early detection by other scripts
111
- *
112
- * Hooks CMB2 inclusion to the init hook on a high priority which decrements
113
- * (increasing the priority) with each version release.
114
- *
115
- * @since 2.0.0
116
- */
117
- private function __construct() {
118
- /**
119
- * A constant you can use to check if CMB2 is loaded
120
- * for your plugins/themes with CMB2 dependency
121
- */
122
- if ( ! defined( 'CMB2_LOADED' ) ) {
123
- define( 'CMB2_LOADED', self::PRIORITY );
124
- }
125
-
126
- if ( ! function_exists( 'add_action' ) ) {
127
- // We are running outside of the context of WordPress.
128
- return;
129
- }
130
-
131
- add_action( 'init', array( $this, 'include_cmb' ), self::PRIORITY );
132
- }
133
-
134
- /**
135
- * A final check if CMB2 exists before kicking off our CMB2 loading.
136
- * CMB2_VERSION and CMB2_DIR constants are set at this point.
137
- *
138
- * @since 2.0.0
139
- */
140
- public function include_cmb() {
141
- if ( class_exists( 'CMB2', false ) ) {
142
- return;
143
- }
144
-
145
- if ( ! defined( 'CMB2_VERSION' ) ) {
146
- define( 'CMB2_VERSION', self::VERSION );
147
- }
148
-
149
- if ( ! defined( 'CMB2_DIR' ) ) {
150
- define( 'CMB2_DIR', trailingslashit( dirname( __FILE__ ) ) );
151
- }
152
-
153
- $this->l10ni18n();
154
-
155
- // Include helper functions.
156
- require_once CMB2_DIR . 'includes/CMB2_Base.php';
157
- require_once CMB2_DIR . 'includes/CMB2.php';
158
- require_once CMB2_DIR . 'includes/helper-functions.php';
159
-
160
- // Now kick off the class autoloader.
161
- spl_autoload_register( 'cmb2_autoload_classes' );
162
-
163
- // Kick the whole thing off.
164
- require_once( cmb2_dir( 'bootstrap.php' ) );
165
- cmb2_bootstrap();
166
- }
167
-
168
- /**
169
- * Registers CMB2 text domain path
170
- *
171
- * @since 2.0.0
172
- */
173
- public function l10ni18n() {
174
-
175
- $loaded = load_plugin_textdomain( 'cmb2', false, '/languages/' );
176
-
177
- if ( ! $loaded ) {
178
- $loaded = load_muplugin_textdomain( 'cmb2', '/languages/' );
179
- }
180
-
181
- if ( ! $loaded ) {
182
- $loaded = load_theme_textdomain( 'cmb2', get_stylesheet_directory() . '/languages/' );
183
- }
184
-
185
- if ( ! $loaded ) {
186
- $locale = apply_filters( 'plugin_locale', function_exists( 'determine_locale' ) ? determine_locale() : get_locale(), 'cmb2' );
187
- $mofile = dirname( __FILE__ ) . '/languages/cmb2-' . $locale . '.mo';
188
- load_textdomain( 'cmb2', $mofile );
189
- }
190
-
191
- }
192
-
193
- }
194
-
195
- // Make it so...
196
- CMB2_Bootstrap_290::initiate();
197
-
198
- }// End if().
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/js/cmb2-char-counter.js DELETED
@@ -1,211 +0,0 @@
1
- /**
2
- * Used for character counters
3
- */
4
- window.CMB2 = window.CMB2 || {};
5
- window.CMB2.charcounter = window.CMB2.charcounter || {};
6
-
7
- ( function(window, document, $, cmb, counter ) {
8
- 'use strict';
9
-
10
- if ( ! wp.utils || ! wp.utils.WordCounter ) {
11
- return cmb.log( 'Cannot find wp.utils!' );
12
- }
13
-
14
- // Private variables
15
- counter.counters = {};
16
- var counters = counter.counters;
17
- var wpCounter = new wp.utils.WordCounter();
18
-
19
- /**
20
- * Update a field's character counter
21
- *
22
- * @since 2.7.0
23
- *
24
- * @param {string} field_id
25
- *
26
- * @return {int}
27
- */
28
- counter.updateCounter = function( field_id ) {
29
- // No counter?
30
- if ( ! counters.hasOwnProperty( field_id ) ) {
31
- return null;
32
- }
33
-
34
- var instance = counters[ field_id ];
35
- var wysiwyg = instance.editor && ! instance.editor.isHidden();
36
-
37
- // Are we dealing with WYSIWYG visual editor, or textarea / WYSIWYG textarea?
38
- var text = wysiwyg ? instance.editor.getContent( { format: 'raw' } ) : cmb.$id( field_id ).val().trim();
39
- var count = wpCounter.count( text, instance.type );
40
- var exceeded = instance.max && count > instance.max;
41
-
42
- // Number remaining when max is defined
43
- var val = instance.max ? instance.max - count : count;
44
-
45
- // Over maximum?
46
- instance.$el.parents( '.cmb2-char-counter-wrap' )[ exceeded ? 'addClass' : 'removeClass' ]( 'cmb2-max-exceeded' );
47
-
48
- // Update counter, and update counter input width.
49
- instance.$el.val( val ).outerWidth( ( ( 8 * String( val ).length ) + 15 ) + 'px' );
50
-
51
- return count;
52
- };
53
-
54
- counter.instantiate = function( $el ) {
55
- var data = $el.data();
56
-
57
- // Add counter details if not already done
58
- if ( ! ( data.fieldId in counters ) ) {
59
-
60
- var instance = {
61
- $el : $el,
62
- max : data.max,
63
- type : 'words' === data.counterType ? 'words' : 'characters_including_spaces',
64
- editor : false,
65
- };
66
-
67
- counters[ data.fieldId ] = instance;
68
-
69
- // Initialise counter
70
- counter.updateCounter( data.fieldId );
71
- }
72
- };
73
-
74
- /**
75
- * Initializes all character counters. Hooked to cmb_init.
76
- *
77
- * @since 2.7.0
78
- *
79
- * @param {bool} init First init?
80
- *
81
- * @return {void}
82
- */
83
- counter.initAll = function() {
84
-
85
- // Gather counters and initialise
86
- $( '.cmb2-char-counter' ).each( function() {
87
- counter.instantiate( $( this ) );
88
- });
89
- };
90
-
91
- /**
92
- * Initializes WYSIWYG editors. Hooked to tinymce-editor-init
93
- *
94
- * @since 2.7.0
95
- *
96
- * @param {object} evt
97
- * @param {object} editor
98
- *
99
- * @return {void}
100
- */
101
- counter.initWysiwyg = function( evt, editor ) {
102
-
103
- // Check if it's one of our WYSIWYGs
104
- // Should have already been registered in counters via hidden textarea
105
- if ( editor.id in counters ) {
106
-
107
- // Add editor to counter
108
- counters[ editor.id ].editor = editor;
109
-
110
- // Add nodechange event
111
- editor.on( 'nodechange keyup', counter.countWysiwyg );
112
- }
113
- };
114
-
115
- /**
116
- * Initializes after a new repeatable row has been added. Hooked to cmb2_add_row
117
- *
118
- * @since 2.7.0
119
- *
120
- * @param {object} evt A jQuery-normalized event object.
121
- * @param {object} $row A jQuery dom element object for the group row.
122
- *
123
- * @return {void}
124
- */
125
- counter.addRow = function( evt, $row ) {
126
-
127
- // Character counters in row?
128
- $row.find( '.cmb2-char-counter' ).each( function() {
129
-
130
- // Update attributes
131
- var $this = $( this );
132
- var id = $this.attr( 'id' );
133
- var field_id = id.replace( /^char-counter-/, '' );
134
- $this.attr( 'data-field-id', field_id ).data( 'field-id', field_id );
135
-
136
- counter.instantiate( $this );
137
- });
138
- };
139
-
140
- /**
141
- * Clean the counters array.
142
- * Removes counters after a repeatable row has been removed. Hooked to cmb2_remove_row.
143
- *
144
- * @since 2.7.0
145
- *
146
- * @return {void}
147
- */
148
- counter.cleanCounters = function() {
149
- var field_id, remove = [];
150
-
151
- // Got through counters
152
- for ( field_id in counters ) {
153
- // Check for element, gather for removal
154
- if ( ! document.getElementById( field_id ) ) {
155
- remove.push( field_id );
156
- }
157
- }
158
-
159
- // Anything to remove?
160
- if ( remove.length ) {
161
- _.each( remove, function( field_id ) {
162
- delete counters[ field_id ];
163
- });
164
- }
165
- };
166
-
167
- /**
168
- * Counts the value of wysiwyg on the keyup event.
169
- *
170
- * @since 2.7.0
171
- *
172
- * @param {object} evt
173
- *
174
- * @return {void}
175
- */
176
- counter.countWysiwyg = _.throttle( function( evt ) {
177
-
178
- // Init event
179
- if ( evt.hasOwnProperty( 'element' ) ) {
180
- return counter.updateCounter( $( evt.element ).data( 'id' ) );
181
- }
182
-
183
- // Nodechange event
184
- if ( evt.hasOwnProperty( 'currentTarget' ) ) {
185
- return counter.updateCounter( $( evt.currentTarget ).data( 'id' ) );
186
- }
187
-
188
- } );
189
-
190
- /**
191
- * Counts the value of textarea on the keyup event.
192
- *
193
- * @since 2.7.0
194
- *
195
- * @param {object} evt
196
- *
197
- * @return {void}
198
- */
199
- counter.countTextarea = _.throttle( function(evt) {
200
- counter.updateCounter( evt.currentTarget.id );
201
- }, 400 );
202
-
203
- // Hook in our event callbacks.
204
- $( document )
205
- .on( 'cmb_init', counter.initAll )
206
- .on( 'tinymce-editor-init', counter.initWysiwyg )
207
- .on( 'cmb2_add_row', counter.addRow )
208
- .on( 'cmb2_remove_row', counter.cleanCounters )
209
- .on( 'input keyup', '.cmb2-count-chars', counter.countTextarea );
210
-
211
- } )( window, document, jQuery, window.CMB2, window.CMB2.charcounter );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/js/cmb2-wysiwyg.js DELETED
@@ -1,345 +0,0 @@
1
- /**
2
- * Used for WYSIWYG logic
3
- */
4
- window.CMB2 = window.CMB2 || {};
5
- window.CMB2.wysiwyg = window.CMB2.wysiwyg || {};
6
-
7
- ( function(window, document, $, cmb, wysiwyg, undefined ) {
8
- 'use strict';
9
-
10
- // Private variables
11
- var toBeDestroyed = [];
12
- var toBeInitialized = [];
13
- var all = wysiwyg.all = {};
14
-
15
- // Private functions
16
-
17
- /**
18
- * Initializes any editors that weren't initialized because they didn't exist yet.
19
- *
20
- * @since 2.2.3
21
- *
22
- * @return {void}
23
- */
24
- function delayedInit() {
25
-
26
- // Don't initialize until they've all been destroyed.
27
- if ( 0 === toBeDestroyed.length ) {
28
- toBeInitialized.forEach( function ( toInit ) {
29
- toBeInitialized.splice( toBeInitialized.indexOf( toInit ), 1 );
30
- wysiwyg.init.apply( wysiwyg, toInit );
31
- } );
32
- } else {
33
- window.setTimeout( delayedInit, 100 );
34
- }
35
- }
36
-
37
- /**
38
- * Destroys any editors that weren't destroyed because they didn't exist yet.
39
- *
40
- * @since 2.2.3
41
- *
42
- * @return {void}
43
- */
44
- function delayedDestroy() {
45
- toBeDestroyed.forEach( function( id ) {
46
- toBeDestroyed.splice( toBeDestroyed.indexOf( id ), 1 );
47
- wysiwyg.destroy( id );
48
- } );
49
- }
50
-
51
- /**
52
- * Gets the option data for a group (and initializes that data if it doesn't exist).
53
- *
54
- * @since 2.2.3
55
- *
56
- * @param {object} data The group/field data.
57
- *
58
- * @return {object} Options data object for a group.
59
- */
60
- function getGroupData( data ) {
61
- var groupid = data.groupid;
62
- var fieldid = data.fieldid;
63
-
64
- if ( ! all[ groupid ] || ! all[ groupid ][ fieldid ] ) {
65
- all[ groupid ] = all[ groupid ] || {};
66
- all[ groupid ][ fieldid ] = {
67
- template : wp.template( 'cmb2-wysiwyg-' + groupid + '-' + fieldid ),
68
- defaults : {
69
-
70
- // Get the data from the template-wysiwyg initiation.
71
- mce : $.extend( {}, tinyMCEPreInit.mceInit[ 'cmb2_i_' + groupid + fieldid ] ),
72
- qt : $.extend( {}, tinyMCEPreInit.qtInit[ 'cmb2_i_' + groupid + fieldid ] )
73
- }
74
- };
75
- // This is the template-wysiwyg data, and we do not want that to be initiated.
76
- delete tinyMCEPreInit.mceInit[ 'cmb2_i_' + groupid + fieldid ];
77
- delete tinyMCEPreInit.qtInit[ 'cmb2_i_' + groupid + fieldid ];
78
- }
79
-
80
- return all[ groupid ][ fieldid ];
81
- }
82
-
83
- /**
84
- * Initiates the tinyMCEPreInit options for a wysiwyg editor instance.
85
- *
86
- * @since 2.2.3
87
- *
88
- * @param {object} options Options data object for the wysiwyg editor instance.
89
- *
90
- * @return {void}
91
- */
92
- function initOptions( options ) {
93
- var nameRegex = new RegExp( 'cmb2_n_' + options.groupid + options.fieldid, 'g' );
94
- var idRegex = new RegExp( 'cmb2_i_' + options.groupid + options.fieldid, 'g' );
95
- var prop, newSettings, newQTS;
96
-
97
- // If no settings for this field. Clone from placeholder.
98
- if ( 'undefined' === typeof( tinyMCEPreInit.mceInit[ options.id ] ) ) {
99
- newSettings = $.extend( {}, options.defaults.mce );
100
- for ( prop in newSettings ) {
101
- if ( 'string' === typeof( newSettings[ prop ] ) ) {
102
- newSettings[ prop ] = newSettings[ prop ]
103
- .replace( idRegex, options.id )
104
- .replace( nameRegex, options.name );
105
- }
106
- }
107
- tinyMCEPreInit.mceInit[ options.id ] = newSettings;
108
- }
109
-
110
- // If no Quicktag settings for this field. Clone from placeholder.
111
- if ( 'undefined' === typeof( tinyMCEPreInit.qtInit[ options.id ] ) ) {
112
- newQTS = $.extend( {}, options.defaults.qt );
113
- for ( prop in newQTS ) {
114
- if ( 'string' === typeof( newQTS[ prop ] ) ) {
115
- newQTS[ prop ] = newQTS[ prop ]
116
- .replace( idRegex, options.id )
117
- .replace( nameRegex, options.name );
118
- }
119
- }
120
- tinyMCEPreInit.qtInit[ options.id ] = newQTS;
121
- }
122
- }
123
-
124
- /**
125
- * Initializes all group wysiwyg editors. Hooked to cmb_init.
126
- *
127
- * @since 2.2.3
128
- *
129
- * @return {void}
130
- */
131
- wysiwyg.initAll = function() {
132
- var $this,data,initiated;
133
-
134
- $( '.cmb2-wysiwyg-placeholder' ).each( function() {
135
- $this = $( this );
136
- data = $this.data();
137
-
138
- if ( data.groupid ) {
139
-
140
- data.id = $this.attr( 'id' );
141
- data.name = $this.attr( 'name' );
142
- data.value = $this.val();
143
-
144
- wysiwyg.init( $this, data, false );
145
- initiated = true;
146
- }
147
- } );
148
-
149
- if ( true === initiated ) {
150
- if ( 'undefined' !== typeof window.QTags ) {
151
- window.QTags._buttonsInit();
152
- }
153
-
154
- // Hook in our event callbacks.
155
- $( document )
156
- .on( 'cmb2_add_row', wysiwyg.addRow )
157
- .on( 'cmb2_remove_group_row_start', wysiwyg.destroyRowEditors )
158
- .on( 'cmb2_shift_rows_start', wysiwyg.shiftStart )
159
- .on( 'cmb2_shift_rows_complete', wysiwyg.shiftComplete );
160
- }
161
- };
162
-
163
- /**
164
- * Initiates wysiwyg editors in a new group row. Hooked to cmb2_add_row.
165
- *
166
- * @since 2.2.3
167
- *
168
- * @param {object} evt A jQuery-normalized event object.
169
- * @param {object} $row A jQuery dom element object for the group row.
170
- *
171
- * @return {void}
172
- */
173
- wysiwyg.addRow = function( evt, $row ) {
174
- wysiwyg.initRow( $row, evt );
175
- };
176
-
177
- /**
178
- * Destroys wysiwyg editors in a group row when that row is removed. Hooked to cmb2_remove_group_row_start.
179
- *
180
- * @since 2.2.3
181
- *
182
- * @param {object} evt A jQuery-normalized event object.
183
- * @param {object} $btn A jQuery dom element object for the remove-row button.
184
- *
185
- * @return {void}
186
- */
187
- wysiwyg.destroyRowEditors = function( evt, $btn ) {
188
- wysiwyg.destroy( $btn.parents( '.cmb-repeatable-grouping' ).find( '.wp-editor-area' ).attr( 'id' ) );
189
- };
190
-
191
- /**
192
- * When a row-shift starts, we need to destroy the wysiwyg editors for the group-rows being shuffled.
193
- *
194
- * @since 2.2.3
195
- *
196
- * @param {object} evt A jQuery-normalized event object.
197
- * @param {object} $btn A jQuery dom element object for the remove-row button.
198
- * @param {object} $from A jQuery dom element object for the row being shifted from.
199
- * @param {object} $to A jQuery dom element object for the row being shifted to.
200
- *
201
- * @return {void}
202
- */
203
- wysiwyg.shiftStart = function( evt, $btn, $from, $to ) {
204
- $from.add( $to ).find( '.wp-editor-wrap textarea' ).each( function() {
205
- wysiwyg.destroy( $( this ).attr( 'id' ) );
206
- } );
207
- };
208
-
209
- /**
210
- * When a row-shift completes, we need to re-init the wysiwyg editors for the group-rows being shuffled.
211
- *
212
- * @since 2.2.3
213
- *
214
- * @param {object} evt A jQuery-normalized event object.
215
- * @param {object} $btn A jQuery dom element object for the remove-row button.
216
- * @param {object} $from A jQuery dom element object for the row being shifted from.
217
- * @param {object} $to A jQuery dom element object for the row being shifted to.
218
- *
219
- * @return {void}
220
- */
221
- wysiwyg.shiftComplete = function( evt, $btn, $from, $to ) {
222
- $from.add( $to ).each( function() {
223
- wysiwyg.initRow( $( this ), evt );
224
- } );
225
- };
226
-
227
- /**
228
- * Initializes editors for a new CMB row.
229
- *
230
- * @since 2.2.3
231
- *
232
- * @param {object} $row A jQuery dom element object for the group row.
233
- * @param {object} evt A jQuery-normalized event object.
234
- *
235
- * @return {void}
236
- */
237
- wysiwyg.initRow = function( $row, evt ) {
238
- var $toReplace, data, defVal;
239
-
240
- $row.find( '.cmb2-wysiwyg-inner-wrap' ).each( function() {
241
- $toReplace = $( this );
242
- data = $toReplace.data();
243
- defVal = cmb.getFieldArg( data.hash, 'default', '' );
244
- defVal = 'undefined' !== typeof defVal && false !== defVal ? defVal : '';
245
-
246
- data.iterator = $row.data( 'iterator' );
247
- data.fieldid = data.id;
248
- data.id = data.groupid + '_' + data.iterator + '_' + data.fieldid;
249
- data.name = data.groupid + '[' + data.iterator + '][' + data.fieldid + ']';
250
- data.value = 'cmb2_add_row' !== evt.type && $toReplace.find( '.wp-editor-area' ).length ? $toReplace.find( '.wp-editor-area' ).val() : defVal;
251
-
252
- // The destroys might not have happened yet. Don't init until they have.
253
- if ( 0 === toBeDestroyed.length ) {
254
-
255
- wysiwyg.init( $toReplace, data );
256
-
257
- } else {
258
- toBeInitialized.push( [$toReplace, data] );
259
- window.setTimeout( delayedInit, 100 );
260
- }
261
- } );
262
-
263
- };
264
-
265
- /**
266
- * Initiates a wysiwyg editor instance and replaces the passed dom element w/ the editor html.
267
- *
268
- * @since 2.2.3
269
- *
270
- * @param {object} $toReplace A jQuery dom element which will be replaced with the wysiwyg editor.
271
- * @param {object} data Data used to initate the editor.
272
- * @param {bool} buttonsInit Whether to run QTags._buttonsInit()
273
- *
274
- * @return {void}
275
- */
276
- wysiwyg.init = function( $toReplace, data, buttonsInit ) {
277
- if ( ! data.groupid ) {
278
- return false;
279
- }
280
-
281
- var mceActive = cmb.canTinyMCE();
282
- var qtActive = 'function' === typeof window.quicktags;
283
- $.extend( data, getGroupData( data ) );
284
-
285
- initOptions( data );
286
-
287
- $toReplace.replaceWith( data.template( data ) );
288
-
289
- if ( mceActive ) {
290
- window.tinyMCE.init( tinyMCEPreInit.mceInit[ data.id ] );
291
- }
292
-
293
- if ( qtActive ) {
294
- window.quicktags( tinyMCEPreInit.qtInit[ data.id ] );
295
- }
296
-
297
- if ( mceActive ) {
298
- $( document.getElementById( data.id ) ).parents( '.wp-editor-wrap' ).removeClass( 'html-active' ).addClass( 'tmce-active' );
299
- }
300
-
301
- if ( false !== buttonsInit && 'undefined' !== typeof window.QTags ) {
302
- window.QTags._buttonsInit();
303
- }
304
-
305
- };
306
-
307
- /**
308
- * Destroys a wysiwyg editor instance.
309
- *
310
- * @since 2.2.3
311
- *
312
- * @param {string} id Editor id.
313
- *
314
- * @return {void}
315
- */
316
- wysiwyg.destroy = function( id ) {
317
- if ( ! cmb.canTinyMCE() ) {
318
- // Nothing to see here.
319
- return;
320
- }
321
-
322
- // The editor might not be initialized yet. But we need to destroy it once it is.
323
- var editor = tinyMCE.get( id );
324
-
325
- if ( editor !== null && typeof( editor ) !== 'undefined' ) {
326
- editor.destroy();
327
-
328
- if ( 'undefined' === typeof( tinyMCEPreInit.mceInit[ id ] ) ) {
329
- delete tinyMCEPreInit.mceInit[ id ];
330
- }
331
-
332
- if ( 'undefined' === typeof( tinyMCEPreInit.qtInit[ id ] ) ) {
333
- delete tinyMCEPreInit.qtInit[ id ];
334
- }
335
-
336
- } else if ( -1 === toBeDestroyed.indexOf( id ) ) {
337
- toBeDestroyed.push( id );
338
- window.setTimeout( delayedDestroy, 100 );
339
- }
340
- };
341
-
342
- // Hook in our event callbacks.
343
- $( document ).on( 'cmb_init', wysiwyg.initAll );
344
-
345
- } )( window, document, jQuery, window.CMB2, window.CMB2.wysiwyg );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/js/cmb2.js DELETED
@@ -1,1348 +0,0 @@
1
- /**
2
- * Controls the behaviours of custom metabox fields.
3
- *
4
- * @author CMB2 team
5
- * @see https://github.com/CMB2/CMB2
6
- */
7
-
8
- /**
9
- * Custom jQuery for Custom Metaboxes and Fields
10
- */
11
- window.CMB2 = window.CMB2 || {};
12
- (function(window, document, $, cmb, undefined){
13
- 'use strict';
14
-
15
- // localization strings
16
- var l10n = window.cmb2_l10;
17
- var setTimeout = window.setTimeout;
18
- var $document;
19
- var $id = function( selector ) {
20
- return $( document.getElementById( selector ) );
21
- };
22
- cmb.$id = $id;
23
- var defaults = {
24
- idNumber : false,
25
- repeatEls : 'input:not([type="button"],[id^=filelist]),select,textarea,.cmb2-media-status',
26
- noEmpty : 'input:not([type="button"]):not([type="radio"]):not([type="checkbox"]),textarea',
27
- repeatUpdate : 'input:not([type="button"]),select,textarea,label',
28
- styleBreakPoint : 450,
29
- mediaHandlers : {},
30
- defaults : {
31
- time_picker : l10n.defaults.time_picker,
32
- date_picker : l10n.defaults.date_picker,
33
- color_picker : l10n.defaults.color_picker || {},
34
- code_editor : l10n.defaults.code_editor,
35
- },
36
- media : {
37
- frames : {},
38
- },
39
- };
40
-
41
- cmb.init = function() {
42
- $document = $( document );
43
-
44
- // Setup the CMB2 object defaults.
45
- $.extend( cmb, defaults );
46
-
47
- cmb.trigger( 'cmb_pre_init' );
48
-
49
- var $metabox = cmb.metabox();
50
- var $repeatGroup = $metabox.find('.cmb-repeatable-group');
51
-
52
- // Init time/date/color pickers
53
- cmb.initPickers( $metabox.find('input[type="text"].cmb2-timepicker'), $metabox.find('input[type="text"].cmb2-datepicker'), $metabox.find('input[type="text"].cmb2-colorpicker') );
54
-
55
- // Init code editors.
56
- cmb.initCodeEditors( $metabox.find( '.cmb2-textarea-code:not(.disable-codemirror)' ) );
57
-
58
- // Insert toggle button into DOM wherever there is multicheck. credit: Genesis Framework
59
- $( '<p><span class="button-secondary cmb-multicheck-toggle">' + l10n.strings.check_toggle + '</span></p>' ).insertBefore( '.cmb2-checkbox-list:not(.no-select-all)' );
60
-
61
- // Make File List drag/drop sortable:
62
- cmb.makeListSortable();
63
- // Make Repeatable fields drag/drop sortable:
64
- cmb.makeRepeatableSortable();
65
-
66
- $metabox
67
- .on( 'change', '.cmb2_upload_file', function() {
68
- cmb.media.field = $( this ).attr( 'id' );
69
- $id( cmb.media.field + '_id' ).val('');
70
- })
71
- // Media/file management
72
- .on( 'click', '.cmb-multicheck-toggle', cmb.toggleCheckBoxes )
73
- .on( 'click', '.cmb2-upload-button', cmb.handleMedia )
74
- .on( 'click', '.cmb-attach-list li, .cmb2-media-status .img-status img, .cmb2-media-status .file-status > span', cmb.handleFileClick )
75
- .on( 'click', '.cmb2-remove-file-button', cmb.handleRemoveMedia )
76
- // Repeatable content
77
- .on( 'click', '.cmb-add-group-row', cmb.addGroupRow )
78
- .on( 'click', '.cmb-add-row-button', cmb.addAjaxRow )
79
- .on( 'click', '.cmb-remove-group-row', cmb.removeGroupRow )
80
- .on( 'click', '.cmb-remove-row-button', cmb.removeAjaxRow )
81
- // Ajax oEmbed display
82
- .on( 'keyup paste focusout', '.cmb2-oembed', cmb.maybeOembed )
83
- // Reset titles when removing a row
84
- .on( 'cmb2_remove_row', '.cmb-repeatable-group', cmb.resetTitlesAndIterator )
85
- .on( 'click', '.cmbhandle, .cmbhandle + .cmbhandle-title', cmb.toggleHandle );
86
-
87
- if ( $repeatGroup.length ) {
88
- $repeatGroup
89
- .on( 'cmb2_add_row', cmb.emptyValue )
90
- .on( 'cmb2_add_row', cmb.setDefaults )
91
- .filter('.sortable').each( function() {
92
- // Add sorting arrows
93
- $( this ).find( '.cmb-remove-group-row-button' ).before( '<a class="button-secondary cmb-shift-rows move-up alignleft" href="#"><span class="'+ l10n.up_arrow_class +'"></span></a> <a class="button-secondary cmb-shift-rows move-down alignleft" href="#"><span class="'+ l10n.down_arrow_class +'"></span></a>' );
94
- })
95
- .on( 'click', '.cmb-shift-rows', cmb.shiftRows );
96
- }
97
-
98
- // on pageload
99
- setTimeout( cmb.resizeoEmbeds, 500);
100
- // and on window resize
101
- $( window ).on( 'resize', cmb.resizeoEmbeds );
102
-
103
- if ( $id( 'addtag' ).length ) {
104
- cmb.listenTagAdd();
105
- }
106
-
107
- $( document ).on( 'cmb_init', cmb.mceEnsureSave );
108
-
109
- cmb.trigger( 'cmb_init' );
110
- };
111
-
112
- // Handles updating tiny mce instances when saving a gutenberg post.
113
- // https://github.com/CMB2/CMB2/issues/1156
114
- cmb.mceEnsureSave = function() {
115
- // If no wp.data, do not proceed (no gutenberg)
116
- if ( ! wp.data || ! wp.data.hasOwnProperty('subscribe') ) {
117
- return;
118
- }
119
-
120
- // If the current user cannot richedit, or MCE is not available, bail.
121
- if ( ! cmb.canTinyMCE() ) {
122
- return;
123
- }
124
-
125
- wp.data.subscribe( function() {
126
- var editor = wp.data.hasOwnProperty('select') ? wp.data.select( 'core/editor' ) : null;
127
-
128
- // the post is currently being saved && we have tinymce editors
129
- if ( editor && editor.isSavingPost && editor.isSavingPost() && window.tinyMCE.editors.length ) {
130
- for ( var i = 0; i < window.tinyMCE.editors.length; i++ ) {
131
- if ( window.tinyMCE.activeEditor !== window.tinyMCE.editors[i] ) {
132
- window.tinyMCE.editors[i].save();
133
- }
134
- }
135
- }
136
- });
137
- };
138
-
139
- cmb.canTinyMCE = function() {
140
- return l10n.user_can_richedit && window.tinyMCE;
141
- };
142
-
143
- cmb.listenTagAdd = function() {
144
- $document.ajaxSuccess( function( evt, xhr, settings ) {
145
- if ( settings.data && settings.data.length && -1 !== settings.data.indexOf( 'action=add-tag' ) ) {
146
- cmb.resetBoxes( $id( 'addtag' ).find( '.cmb2-wrap > .cmb2-metabox' ) );
147
- }
148
- });
149
- };
150
-
151
- cmb.resetBoxes = function( $boxes ) {
152
- $.each( $boxes, function() {
153
- cmb.resetBox( $( this ) );
154
- });
155
- };
156
-
157
- cmb.resetBox = function( $box ) {
158
- $box.find( '.wp-picker-clear' ).trigger( 'click' );
159
- $box.find( '.cmb2-remove-file-button' ).trigger( 'click' );
160
- $box.find( '.cmb-row.cmb-repeatable-grouping:not(:first-of-type) .cmb-remove-group-row' ).click();
161
- $box.find( '.cmb-repeat-row:not(:first-child)' ).remove();
162
-
163
- $box.find( 'input:not([type="button"]),select,textarea' ).each( function() {
164
- var $element = $( this );
165
- var tagName = $element.prop('tagName');
166
-
167
- if ( 'INPUT' === tagName ) {
168
- var elType = $element.attr( 'type' );
169
- if ( 'checkbox' === elType || 'radio' === elType ) {
170
- $element.prop( 'checked', false );
171
- } else {
172
- $element.val( '' );
173
- }
174
- }
175
- if ( 'SELECT' === tagName ) {
176
- $( 'option:selected', this ).prop( 'selected', false );
177
- }
178
- if ( 'TEXTAREA' === tagName ) {
179
- $element.html( '' );
180
- }
181
- });
182
- };
183
-
184
- cmb.resetTitlesAndIterator = function( evt ) {
185
- if ( ! evt.group ) {
186
- return;
187
- }
188
-
189
- // Loop repeatable group tables
190
- $( '.cmb-repeatable-group.repeatable' ).each( function() {
191
- var $table = $( this );
192
- var groupTitle = $table.find( '.cmb-add-group-row' ).data( 'grouptitle' );
193
-
194
- // Loop repeatable group table rows
195
- $table.find( '.cmb-repeatable-grouping' ).each( function( rowindex ) {
196
- var $row = $( this );
197
- var $rowTitle = $row.find( 'h3.cmb-group-title' );
198
- // Reset rows iterator
199
- $row.data( 'iterator', rowindex );
200
- // Reset rows title
201
- if ( $rowTitle.length ) {
202
- $rowTitle.text( groupTitle.replace( '{#}', ( rowindex + 1 ) ) );
203
- }
204
- });
205
- });
206
- };
207
-
208
- cmb.toggleHandle = function( evt ) {
209
- evt.preventDefault();
210
- cmb.trigger( 'postbox-toggled', $( this ).parent('.postbox').toggleClass('closed') );
211
- };
212
-
213
- cmb.toggleCheckBoxes = function( evt ) {
214
- evt.preventDefault();
215
- var $this = $( this );
216
- var $multicheck = $this.closest( '.cmb-td' ).find( 'input[type=checkbox]:not([disabled])' );
217
-
218
- // If the button has already been clicked once...
219
- if ( $this.data( 'checked' ) ) {
220
- // clear the checkboxes and remove the flag
221
- $multicheck.prop( 'checked', false );
222
- $this.data( 'checked', false );
223
- }
224
- // Otherwise mark the checkboxes and add a flag
225
- else {
226
- $multicheck.prop( 'checked', true );
227
- $this.data( 'checked', true );
228
- }
229
- };
230
-
231
- cmb.handleMedia = function( evt ) {
232
- evt.preventDefault();
233
-
234
- var $el = $( this );
235
- cmb.attach_id = ! $el.hasClass( 'cmb2-upload-list' ) ? $el.closest( '.cmb-td' ).find( '.cmb2-upload-file-id' ).val() : false;
236
- // Clean up default 0 value
237
- cmb.attach_id = '0' !== cmb.attach_id ? cmb.attach_id : false;
238
-
239
- cmb._handleMedia( $el.prev('input.cmb2-upload-file').attr('id'), $el.hasClass( 'cmb2-upload-list' ) );
240
- };
241
-
242
- cmb.handleFileClick = function( evt ) {
243
- if ( $( evt.target ).is( 'a' ) ) {
244
- return;
245
- }
246
-
247
- evt.preventDefault();
248
-
249
- var $el = $( this );
250
- var $td = $el.closest( '.cmb-td' );
251
- var isList = $td.find( '.cmb2-upload-button' ).hasClass( 'cmb2-upload-list' );
252
- cmb.attach_id = isList ? $el.find( 'input[type="hidden"]' ).data( 'id' ) : $td.find( '.cmb2-upload-file-id' ).val();
253
-
254
- if ( cmb.attach_id ) {
255
- cmb._handleMedia( $td.find( 'input.cmb2-upload-file' ).attr( 'id' ), isList, cmb.attach_id );
256
- }
257
- };
258
-
259
- cmb._handleMedia = function( id, isList ) {
260
- if ( ! wp ) {
261
- return;
262
- }
263
-
264
- var media, handlers;
265
-
266
- handlers = cmb.mediaHandlers;
267
- media = cmb.media;
268
- media.field = id;
269
- media.$field = $id( media.field );
270
- media.fieldData = media.$field.data();
271
- media.previewSize = media.fieldData.previewsize;
272
- media.sizeName = media.fieldData.sizename;
273
- media.fieldName = media.$field.attr('name');
274
- media.isList = isList;
275
-
276
- // If this field's media frame already exists, reopen it.
277
- if ( id in media.frames ) {
278
- return media.frames[ id ].open();
279
- }
280
-
281
- // Create the media frame.
282
- media.frames[ id ] = wp.media( {
283
- title: cmb.metabox().find('label[for="' + id + '"]').text(),
284
- library : media.fieldData.queryargs || {},
285
- button: {
286
- text: l10n.strings[ isList ? 'upload_files' : 'upload_file' ]
287
- },
288
- multiple: isList ? 'add' : false
289
- } );
290
-
291
- // Enable the additional media filters: https://github.com/CMB2/CMB2/issues/873
292
- media.frames[ id ].states.first().set( 'filterable', 'all' );
293
-
294
- cmb.trigger( 'cmb_media_modal_init', media );
295
-
296
- handlers.list = function( selection, returnIt ) {
297
-
298
- // Setup our fileGroup array
299
- var fileGroup = [];
300
- var attachmentHtml;
301
-
302
- if ( ! handlers.list.templates ) {
303
- handlers.list.templates = {
304
- image : wp.template( 'cmb2-list-image' ),
305
- file : wp.template( 'cmb2-list-file' ),
306
- };
307
- }
308
-
309
- // Loop through each attachment
310
- selection.each( function( attachment ) {
311
-
312
- // Image preview or standard generic output if it's not an image.
313
- attachmentHtml = handlers.getAttachmentHtml( attachment, 'list' );
314
-
315
- // Add our file to our fileGroup array
316
- fileGroup.push( attachmentHtml );
317
- });
318
-
319
- if ( ! returnIt ) {
320
- // Append each item from our fileGroup array to .cmb2-media-status
321
- media.$field.siblings( '.cmb2-media-status' ).append( fileGroup );
322
- } else {
323
- return fileGroup;
324
- }
325
-
326
- };
327
-
328
- handlers.single = function( selection ) {
329
- if ( ! handlers.single.templates ) {
330
- handlers.single.templates = {
331
- image : wp.template( 'cmb2-single-image' ),
332
- file : wp.template( 'cmb2-single-file' ),
333
- };
334
- }
335
-
336
- // Only get one file from the uploader
337
- var attachment = selection.first();
338
-
339
- media.$field.val( attachment.get( 'url' ) );
340
- $id( media.field +'_id' ).val( attachment.get( 'id' ) );
341
-
342
- // Image preview or standard generic output if it's not an image.
343
- var attachmentHtml = handlers.getAttachmentHtml( attachment, 'single' );
344
-
345
- // add/display our output
346
- media.$field.siblings( '.cmb2-media-status' ).slideDown().html( attachmentHtml );
347
- };
348
-
349
- handlers.getAttachmentHtml = function( attachment, templatesId ) {
350
- var isImage = 'image' === attachment.get( 'type' );
351
- var data = handlers.prepareData( attachment, isImage );
352
-
353
- // Image preview or standard generic output if it's not an image.
354
- return handlers[ templatesId ].templates[ isImage ? 'image' : 'file' ]( data );
355
- };
356
-
357
- handlers.prepareData = function( data, image ) {
358
- if ( image ) {
359
- // Set the correct image size data
360
- handlers.getImageData.call( data, 50 );
361
- }
362
-
363
- data = data.toJSON();
364
- data.mediaField = media.field;
365
- data.mediaFieldName = media.fieldName;
366
- data.stringRemoveImage = l10n.strings.remove_image;
367
- data.stringFile = l10n.strings.file;
368
- data.stringDownload = l10n.strings.download;
369
- data.stringRemoveFile = l10n.strings.remove_file;
370
-
371
- return data;
372
- };
373
-
374
- handlers.getImageData = function( fallbackSize ) {
375
-
376
- // Preview size dimensions
377
- var previewW = media.previewSize[0] || fallbackSize;
378
- var previewH = media.previewSize[1] || fallbackSize;
379
-
380
- // Image dimensions and url
381
- var url = this.get( 'url' );
382
- var width = this.get( 'width' );
383
- var height = this.get( 'height' );
384
- var sizes = this.get( 'sizes' );
385
-
386
- // Get the correct dimensions and url if a named size is set and exists
387
- // fallback to the 'large' size
388
- if ( sizes ) {
389
- if ( sizes[ media.sizeName ] ) {
390
- url = sizes[ media.sizeName ].url;
391
- width = sizes[ media.sizeName ].width;
392
- height = sizes[ media.sizeName ].height;
393
- } else if ( sizes.large ) {
394
- url = sizes.large.url;
395
- width = sizes.large.width;
396
- height = sizes.large.height;
397
- }
398
- }
399
-
400
- // Fit the image in to the preview size, keeping the correct aspect ratio
401
- if ( width > previewW ) {
402
- height = Math.floor( previewW * height / width );
403
- width = previewW;
404
- }
405
-
406
- if ( height > previewH ) {
407
- width = Math.floor( previewH * width / height );
408
- height = previewH;
409
- }
410
-
411
- if ( ! width ) {
412
- width = previewW;
413
- }
414
-
415
- if ( ! height ) {
416
- height = 'svg' === this.get( 'filename' ).split( '.' ).pop() ? '100%' : previewH;
417
- }
418
-
419
- this.set( 'sizeUrl', url );
420
- this.set( 'sizeWidth', width );
421
- this.set( 'sizeHeight', height );
422
-
423
- return this;
424
- };
425
-
426
- handlers.selectFile = function() {
427
- var selection = media.frames[ id ].state().get( 'selection' );
428
- var type = isList ? 'list' : 'single';
429
-
430
- if ( cmb.attach_id && isList ) {
431
- $( '[data-id="'+ cmb.attach_id +'"]' ).parents( 'li' ).replaceWith( handlers.list( selection, true ) );
432
- } else {
433
- handlers[type]( selection );
434
- }
435
-
436
- cmb.trigger( 'cmb_media_modal_select', selection, media );
437
- };
438
-
439
- handlers.openModal = function() {
440
- var selection = media.frames[ id ].state().get( 'selection' );
441
- var attach;
442
-
443
- if ( ! cmb.attach_id ) {
444
- selection.reset();
445
- } else {
446
- attach = wp.media.attachment( cmb.attach_id );
447
- attach.fetch();
448
- selection.set( attach ? [ attach ] : [] );
449
- }
450
-
451
- cmb.trigger( 'cmb_media_modal_open', selection, media );
452
- };
453
-
454
- // When a file is selected, run a callback.
455
- media.frames[ id ]
456
- .on( 'select', handlers.selectFile )
457
- .on( 'open', handlers.openModal );
458
-
459
- // Finally, open the modal
460
- media.frames[ id ].open();
461
- };
462
-
463
- cmb.handleRemoveMedia = function( evt ) {
464
- evt.preventDefault();
465
- var $this = $( this );
466
- if ( $this.is( '.cmb-attach-list .cmb2-remove-file-button' ) ) {
467
- $this.parents( '.cmb2-media-item' ).remove();
468
- return false;
469
- }
470
-
471
- cmb.media.field = $this.attr('rel');
472
-
473
- cmb.metabox().find( document.getElementById( cmb.media.field ) ).val('');
474
- cmb.metabox().find( document.getElementById( cmb.media.field + '_id' ) ).val('');
475
- $this.parents('.cmb2-media-status').html('');
476
-
477
- return false;
478
- };
479
-
480
- cmb.cleanRow = function( $row, prevNum, group ) {
481
- var $elements = $row.find( cmb.repeatUpdate );
482
- if ( group ) {
483
-
484
- var $other = $row.find( '[id]' ).not( cmb.repeatUpdate );
485
-
486
- // Remove extra ajaxed rows
487
- $row.find('.cmb-repeat-table .cmb-repeat-row:not(:first-child)').remove();
488
-
489
- // Update all elements w/ an ID
490
- if ( $other.length ) {
491
- $other.each( function() {
492
- var $_this = $( this );
493
- var oldID = $_this.attr( 'id' );
494
- var newID = oldID.replace( '_'+ prevNum, '_'+ cmb.idNumber );
495
- var $buttons = $row.find('[data-selector="'+ oldID +'"]');
496
- $_this.attr( 'id', newID );
497
-
498
- // Replace data-selector vars
499
- if ( $buttons.length ) {
500
- $buttons.attr( 'data-selector', newID ).data( 'selector', newID );
501
- }
502
- });
503
- }
504
- }
505
-
506
- $elements.filter( ':checked' ).removeAttr( 'checked' );
507
- $elements.find( ':checked' ).removeAttr( 'checked' );
508
- $elements.filter( ':selected' ).removeAttr( 'selected' );
509
- $elements.find( ':selected' ).removeAttr( 'selected', false );
510
-
511
- if ( $row.find('h3.cmb-group-title').length ) {
512
- $row.find( 'h3.cmb-group-title' ).text( $row.data( 'title' ).replace( '{#}', ( cmb.idNumber + 1 ) ) );
513
- }
514
-
515
- $elements.each( function() {
516
- cmb.elReplacements( $( this ), prevNum, group );
517
- } );
518
-
519
- return cmb;
520
- };
521
-
522
- cmb.elReplacements = function( $newInput, prevNum, group ) {
523
- var oldFor = $newInput.attr( 'for' );
524
- var oldVal = $newInput.val();
525
- var type = $newInput.prop( 'type' );
526
- var defVal = cmb.getFieldArg( $newInput, 'default' );
527
- var newVal = 'undefined' !== typeof defVal && false !== defVal ? defVal : '';
528
- var tagName = $newInput.prop('tagName');
529
- var checkable = 'radio' === type || 'checkbox' === type ? oldVal : false;
530
- var attrs = {};
531
- var newID, oldID;
532
- if ( oldFor ) {
533
- attrs = { 'for' : oldFor.replace( '_'+ prevNum, '_'+ cmb.idNumber ) };
534
- } else {
535
- var oldName = $newInput.attr( 'name' );
536
- var newName;
537
- oldID = $newInput.attr( 'id' );
538
-
539
- // Handle adding groups vs rows.
540
- if ( group ) {
541
- // Expect another bracket after group's index closing bracket.
542
- newName = oldName ? oldName.replace( '['+ prevNum +'][', '['+ cmb.idNumber +'][' ) : '';
543
- // Expect another underscore after group's index trailing underscore.
544
- newID = oldID ? oldID.replace( '_' + prevNum + '_', '_' + cmb.idNumber + '_' ) : '';
545
- }
546
- else {
547
- // Row indexes are at the very end of the string.
548
- newName = oldName ? cmb.replaceLast( oldName, '[' + prevNum + ']', '[' + cmb.idNumber + ']' ) : '';
549
- newID = oldID ? cmb.replaceLast( oldID, '_' + prevNum, '_' + cmb.idNumber ) : '';
550
- }
551
-
552
- attrs = {
553
- id: newID,
554
- name: newName
555
- };
556
-
557
- }
558
-
559
- // Clear out textarea values
560
- if ( 'TEXTAREA' === tagName ) {
561
- $newInput.html( newVal );
562
- }
563
-
564
- if ( 'SELECT' === tagName && 'undefined' !== typeof defVal ) {
565
- var $toSelect = $newInput.find( '[value="'+ defVal + '"]' );
566
- if ( $toSelect.length ) {
567
- $toSelect.attr( 'selected', 'selected' ).prop( 'selected', 'selected' );
568
- }
569
- }
570
-
571
- if ( checkable ) {
572
- $newInput.removeAttr( 'checked' );
573
- if ( 'undefined' !== typeof defVal && oldVal === defVal ) {
574
- $newInput.attr( 'checked', 'checked' ).prop( 'checked', 'checked' );
575
- }
576
- }
577
-
578
- if ( ! group && $newInput[0].hasAttribute( 'data-iterator' ) ) {
579
- attrs['data-iterator'] = cmb.idNumber;
580
- }
581
-
582
- $newInput
583
- .removeClass( 'hasDatepicker' )
584
- .val( checkable ? checkable : newVal ).attr( attrs );
585
-
586
- return $newInput;
587
- };
588
-
589
- cmb.newRowHousekeeping = function( $row ) {
590
- var $colorPicker = $row.find( '.wp-picker-container' );
591
- var $list = $row.find( '.cmb2-media-status' );
592
-
593
- if ( $colorPicker.length ) {
594
- // Need to clean-up colorpicker before appending
595
- $colorPicker.each( function() {
596
- var $td = $( this ).parent();
597
- $td.html( $td.find( 'input[type="text"].cmb2-colorpicker' ).attr('style', '') );
598
- });
599
- }
600
-
601
- // Need to clean-up colorpicker before appending
602
- if ( $list.length ) {
603
- $list.empty();
604
- }
605
-
606
- return cmb;
607
- };
608
-
609
- cmb.afterRowInsert = function( $row ) {
610
- // Init pickers from new row
611
- cmb.initPickers( $row.find('input[type="text"].cmb2-timepicker'), $row.find('input[type="text"].cmb2-datepicker'), $row.find('input[type="text"].cmb2-colorpicker') );
612
- };
613
-
614
- cmb.updateNameAttr = function () {
615
- var $this = $( this );
616
- var name = $this.attr( 'name' ); // get current name
617
-
618
- // If name is defined
619
- if ( 'undefined' !== typeof name ) {
620
- var prevNum = parseInt( $this.parents( '.cmb-repeatable-grouping' ).data( 'iterator' ), 10 );
621
- var newNum = prevNum - 1; // Subtract 1 to get new iterator number
622
-
623
- // Update field name attributes so data is not orphaned when a row is removed and post is saved
624
- var $newName = name.replace( '[' + prevNum + ']', '[' + newNum + ']' );
625
-
626
- // New name with replaced iterator
627
- $this.attr( 'name', $newName );
628
- }
629
- };
630
-
631
- cmb.emptyValue = function( evt, row ) {
632
- $( cmb.noEmpty, row ).val( '' );
633
- };
634
-
635
- cmb.setDefaults = function( evt, row ) {
636
- $( cmb.noEmpty, row ).each( function() {
637
- var $el = $(this);
638
- var defVal = cmb.getFieldArg( $el, 'default' );
639
- if ( 'undefined' !== typeof defVal && false !== defVal ) {
640
- $el.val( defVal );
641
- }
642
- });
643
- };
644
-
645
- cmb.addGroupRow = function( evt ) {
646
- evt.preventDefault();
647
-
648
- var $this = $( this );
649
-
650
- // before anything significant happens
651
- cmb.triggerElement( $this, 'cmb2_add_group_row_start', $this );
652
-
653
- var $table = $id( $this.data('selector') );
654
- var $oldRow = $table.find('.cmb-repeatable-grouping').last();
655
- var prevNum = parseInt( $oldRow.data('iterator'), 10 );
656
- cmb.idNumber = parseInt( prevNum, 10 ) + 1;
657
- var $row = $oldRow.clone();
658
- var nodeName = $row.prop('nodeName') || 'div';
659
- var getRowId = function( id ) {
660
- id = id.split('-');
661
- id.splice(id.length - 1, 1);
662
- id.push( cmb.idNumber );
663
- return id.join('-');
664
- };
665
-
666
- // Make sure the next number doesn't exist.
667
- while ( $table.find( '.cmb-repeatable-grouping[data-iterator="'+ cmb.idNumber +'"]' ).length > 0 ) {
668
- cmb.idNumber++;
669
- }
670
-
671
- cmb.newRowHousekeeping( $row.data( 'title', $this.data( 'grouptitle' ) ) ).cleanRow( $row, prevNum, true );
672
- $row.find( '.cmb-add-row-button' ).prop( 'disabled', false );
673
-
674
- var $newRow = $( '<' + nodeName + ' id="'+ getRowId( $oldRow.attr('id') ) +'" class="postbox cmb-row cmb-repeatable-grouping" data-iterator="'+ cmb.idNumber +'">'+ $row.html() +'</' + nodeName + '>' );
675
- $oldRow.after( $newRow );
676
-
677
- cmb.afterRowInsert( $newRow );
678
-
679
- cmb.triggerElement( $table, { type: 'cmb2_add_row', group: true }, $newRow );
680
-
681
- };
682
-
683
- cmb.addAjaxRow = function( evt ) {
684
- evt.preventDefault();
685
-
686
- var $this = $( this );
687
- var $table = $id( $this.data('selector') );
688
- var $row = $table.find('.empty-row');
689
- var prevNum = parseInt( $row.find('[data-iterator]').data('iterator'), 10 );
690
- cmb.idNumber = parseInt( prevNum, 10 ) + 1;
691
- var $emptyrow = $row.clone();
692
-
693
- cmb.newRowHousekeeping( $emptyrow ).cleanRow( $emptyrow, prevNum );
694
-
695
- $row.removeClass('empty-row hidden').addClass('cmb-repeat-row');
696
- $row.after( $emptyrow );
697
-
698
- cmb.afterRowInsert( $emptyrow );
699
-
700
- cmb.triggerElement( $table, { type: 'cmb2_add_row', group: false }, $emptyrow, $row );
701
- };
702
-
703
- cmb.removeGroupRow = function( evt ) {
704
- evt.preventDefault();
705
-
706
- var $this = $( this );
707
- var confirmation = $this.data('confirm');
708
-
709
- // Process further only if deletion confirmation enabled and user agreed.
710
- if ( confirmation && ! window.confirm( confirmation ) ) {
711
- return;
712
- }
713
-
714
- var $table = $id( $this.data('selector') );
715
- var $parent = $this.parents('.cmb-repeatable-grouping');
716
- var number = $table.find('.cmb-repeatable-grouping').length;
717
-
718
- if ( number < 2 ) {
719
- return cmb.resetRow( $parent.parents('.cmb-repeatable-group').find( '.cmb-add-group-row' ), $this );
720
- }
721
-
722
- cmb.triggerElement( $table, 'cmb2_remove_group_row_start', $this );
723
-
724
- // When a group is removed, loop through all next groups and update fields names.
725
- $parent.nextAll( '.cmb-repeatable-grouping' ).find( cmb.repeatEls ).each( cmb.updateNameAttr );
726
-
727
- $parent.remove();
728
-
729
- cmb.triggerElement( $table, { type: 'cmb2_remove_row', group: true } );
730
- };
731
-
732
- cmb.removeAjaxRow = function( evt ) {
733
- evt.preventDefault();
734
-
735
- var $this = $( this );
736
-
737
- // Check if disabled
738
- if ( $this.hasClass( 'button-disabled' ) ) {
739
- return;
740
- }
741
-
742
- var $parent = $this.parents('.cmb-row');
743
- var $table = $this.parents('.cmb-repeat-table');
744
- var number = $table.find('.cmb-row').length;
745
-
746
- if ( number <= 2 ) {
747
- return cmb.resetRow( $parent.find( '.cmb-add-row-button' ), $this );
748
- }
749
-
750
- if ( $parent.hasClass('empty-row') ) {
751
- $parent.prev().addClass( 'empty-row' ).removeClass('cmb-repeat-row');
752
- }
753
-
754
- $this.parents('.cmb-repeat-table .cmb-row').remove();
755
-
756
-
757
- cmb.triggerElement( $table, { type: 'cmb2_remove_row', group: false } );
758
- };
759
-
760
- cmb.resetRow = function( $addNewBtn, $removeBtn ) {
761
- // Click the "add new" button followed by the "remove this" button
762
- // in order to reset the repeat row to empty values.
763
- $addNewBtn.trigger( 'click' );
764
- $removeBtn.trigger( 'click' );
765
- };
766
-
767
- cmb.shiftRows = function( evt ) {
768
-
769
- evt.preventDefault();
770
-
771
- var $this = $( this );
772
- var $from = $this.parents( '.cmb-repeatable-grouping' );
773
- var $goto = $this.hasClass( 'move-up' ) ? $from.prev( '.cmb-repeatable-grouping' ) : $from.next( '.cmb-repeatable-grouping' );
774
-
775
- // Before shift occurs.
776
- cmb.triggerElement( $this, 'cmb2_shift_rows_enter', $this, $from, $goto );
777
-
778
- if ( ! $goto.length ) {
779
- return;
780
- }
781
-
782
- // About to shift
783
- cmb.triggerElement( $this, 'cmb2_shift_rows_start', $this, $from, $goto );
784
-
785
- var inputVals = [];
786
- // Loop this item's fields
787
- $from.find( cmb.repeatEls ).each( function() {
788
- var $element = $( this );
789
- var elType = $element.attr( 'type' );
790
- var val;
791
-
792
- if ( $element.hasClass('cmb2-media-status') ) {
793
- // special case for image previews
794
- val = $element.html();
795
- } else if ( 'checkbox' === elType || 'radio' === elType ) {
796
- val = $element.is(':checked');
797
- } else if ( 'select' === $element.prop('tagName') ) {
798
- val = $element.is(':selected');
799
- } else {
800
- val = $element.val();
801
- }
802
-
803
- // Get all the current values per element
804
- inputVals.push( { val: val, $: $element } );
805
- });
806
- // And swap them all
807
- $goto.find( cmb.repeatEls ).each( function( index ) {
808
- var $element = $( this );
809
- var elType = $element.attr( 'type' );
810
- var val;
811
-
812
- if ( $element.hasClass('cmb2-media-status') ) {
813
- var toRowId = $element.closest('.cmb-repeatable-grouping').attr('data-iterator');
814
- var fromRowId = inputVals[ index ].$.closest('.cmb-repeatable-grouping').attr('data-iterator');
815
-
816
- // special case for image previews
817
- val = $element.html();
818
- $element.html( inputVals[ index ].val );
819
- inputVals[ index ].$.html( val );
820
-
821
- inputVals[ index ].$.find( 'input' ).each(function() {
822
- var name = $( this ).attr( 'name' );
823
- name = name.replace( '['+toRowId+']', '['+fromRowId+']' );
824
- $( this ).attr( 'name', name );
825
- });
826
- $element.find('input').each(function() {
827
- var name = $( this ).attr('name');
828
- name = name.replace('['+fromRowId+']', '['+toRowId+']');
829
- $( this ).attr('name', name);
830
- });
831
-
832
- }
833
- // handle checkbox swapping
834
- else if ( 'checkbox' === elType ) {
835
- inputVals[ index ].$.prop( 'checked', $element.is(':checked') );
836
- $element.prop( 'checked', inputVals[ index ].val );
837
- }
838
- // handle radio swapping
839
- else if ( 'radio' === elType ) {
840
- if ( $element.is( ':checked' ) ) {
841
- inputVals[ index ].$.attr( 'data-checked', 'true' );
842
- }
843
- if ( inputVals[ index ].$.is( ':checked' ) ) {
844
- $element.attr( 'data-checked', 'true' );
845
- }
846
- }
847
- // handle select swapping
848
- else if ( 'select' === $element.prop('tagName') ) {
849
- inputVals[ index ].$.prop( 'selected', $element.is(':selected') );
850
- $element.prop( 'selected', inputVals[ index ].val );
851
- }
852
- // handle normal input swapping
853
- else {
854
- inputVals[ index ].$.val( $element.val() );
855
- $element.val( inputVals[ index ].val );
856
- }
857
- });
858
-
859
- $from.find( 'input[data-checked=true]' ).prop( 'checked', true ).removeAttr( 'data-checked' );
860
- $goto.find( 'input[data-checked=true]' ).prop( 'checked', true ).removeAttr( 'data-checked' );
861
-
862
- // trigger color picker change event
863
- $from.find( 'input[type="text"].cmb2-colorpicker' ).trigger( 'change' );
864
- $goto.find( 'input[type="text"].cmb2-colorpicker' ).trigger( 'change' );
865
-
866
- // shift done
867
- cmb.triggerElement( $this, 'cmb2_shift_rows_complete', $this, $from, $goto );
868
- };
869
-
870
- cmb.initPickers = function( $timePickers, $datePickers, $colorPickers ) {
871
- cmb.trigger( 'cmb_init_pickers', {
872
- time: $timePickers,
873
- date: $datePickers,
874
- color: $colorPickers
875
- } );
876
-
877
- // Initialize jQuery UI timepickers
878
- cmb.initDateTimePickers( $timePickers, 'timepicker', 'time_picker' );
879
- // Initialize jQuery UI datepickers
880
- cmb.initDateTimePickers( $datePickers, 'datepicker', 'date_picker' );
881
- // Initialize color picker
882
- cmb.initColorPickers( $colorPickers );
883
- };
884
-
885
- cmb.initDateTimePickers = function( $selector, method, defaultKey ) {
886
- if ( $selector.length ) {
887
- $selector[ method ]( 'destroy' ).each( function() {
888
- var $this = $( this );
889
- var fieldOpts = $this.data( method ) || {};
890
- var options = $.extend( {}, cmb.defaults[ defaultKey ], fieldOpts );
891
- $this[ method ]( cmb.datePickerSetupOpts( fieldOpts, options, method ) );
892
- } );
893
- }
894
- };
895
-
896
- cmb.datePickerSetupOpts = function( fieldOpts, options, method ) {
897
- var existing = $.extend( {}, options );
898
-
899
- options.beforeShow = function( input, inst ) {
900
- if ( 'timepicker' === method ) {
901
- cmb.addTimePickerClasses( inst.dpDiv );
902
- }
903
-
904
- // Wrap datepicker w/ class to narrow the scope of jQuery UI CSS and prevent conflicts
905
- $id( 'ui-datepicker-div' ).addClass( 'cmb2-element' );
906
-
907
- // Let's be sure to call beforeShow if it was added
908
- if ( 'function' === typeof existing.beforeShow ) {
909
- existing.beforeShow( input, inst );
910
- }
911
- };
912
-
913
- if ( 'timepicker' === method ) {
914
- options.onChangeMonthYear = function( year, month, inst, picker ) {
915
- cmb.addTimePickerClasses( inst.dpDiv );
916
-
917
- // Let's be sure to call onChangeMonthYear if it was added
918
- if ( 'function' === typeof existing.onChangeMonthYear ) {
919
- existing.onChangeMonthYear( year, month, inst, picker );
920
- }
921
- };
922
- }
923
-
924
- options.onClose = function( dateText, inst ) {
925
- // Remove the class when we're done with it (and hide to remove FOUC).
926
- var $picker = $id( 'ui-datepicker-div' ).removeClass( 'cmb2-element' ).hide();
927
- if ( 'timepicker' === method && ! $( inst.input ).val() ) {
928
- // Set the timepicker field value if it's empty.
929
- inst.input.val( $picker.find( '.ui_tpicker_time' ).text() );
930
- }
931
-
932
- // Let's be sure to call onClose if it was added
933
- if ( 'function' === typeof existing.onClose ) {
934
- existing.onClose( dateText, inst );
935
- }
936
- };
937
-
938
- return options;
939
- };
940
-
941
- // Adds classes to timepicker buttons.
942
- cmb.addTimePickerClasses = function( $picker ) {
943
- var func = cmb.addTimePickerClasses;
944
- func.count = func.count || 0;
945
-
946
- // Wait a bit to let the timepicker render, since these are pre-render events.
947
- setTimeout( function() {
948
- if ( $picker.find( '.ui-priority-secondary' ).length ) {
949
- $picker.find( '.ui-priority-secondary' ).addClass( 'button-secondary' );
950
- $picker.find( '.ui-priority-primary' ).addClass( 'button-primary' );
951
- func.count = 0;
952
- } else if ( func.count < 5 ) {
953
- func.count++;
954
- func( $picker );
955
- }
956
- }, 10 );
957
- };
958
-
959
- cmb.initColorPickers = function( $selector ) {
960
- if ( ! $selector.length ) {
961
- return;
962
- }
963
- if ( 'object' === typeof jQuery.wp && 'function' === typeof jQuery.wp.wpColorPicker ) {
964
-
965
- $selector.each( function() {
966
- var $this = $( this );
967
- var fieldOpts = $this.data( 'colorpicker' ) || {};
968
- $this.wpColorPicker( $.extend( {}, cmb.defaults.color_picker, fieldOpts ) );
969
- } );
970
-
971
- } else {
972
- $selector.each( function( i ) {
973
- $( this ).after( '<div id="picker-' + i + '" style="z-index: 1000; background: #EEE; border: 1px solid #CCC; position: absolute; display: block;"></div>' );
974
- $id( 'picker-' + i ).hide().farbtastic( $( this ) );
975
- } )
976
- .focus( function() {
977
- $( this ).next().show();
978
- } )
979
- .blur( function() {
980
- $( this ).next().hide();
981
- } );
982
- }
983
- };
984
-
985
- cmb.initCodeEditors = function( $selector ) {
986
- cmb.trigger( 'cmb_init_code_editors', $selector );
987
-
988
- if ( ! cmb.defaults.code_editor || ! wp || ! wp.codeEditor || ! $selector.length ) {
989
- return;
990
- }
991
-
992
- $selector.each( function() {
993
- wp.codeEditor.initialize(
994
- this.id,
995
- cmb.codeEditorArgs( $( this ).data( 'codeeditor' ) )
996
- );
997
- } );
998
- };
999
-
1000
- cmb.codeEditorArgs = function( overrides ) {
1001
- var props = [ 'codemirror', 'csslint', 'jshint', 'htmlhint' ];
1002
- var args = $.extend( {}, cmb.defaults.code_editor );
1003
- overrides = overrides || {};
1004
-
1005
- for ( var i = props.length - 1; i >= 0; i-- ) {
1006
- if ( overrides.hasOwnProperty( props[i] ) ) {
1007
- args[ props[i] ] = $.extend( {}, args[ props[i] ] || {}, overrides[ props[i] ] );
1008
- }
1009
- }
1010
-
1011
- return args;
1012
- };
1013
-
1014
- cmb.makeListSortable = function() {
1015
- var $filelist = cmb.metabox().find( '.cmb2-media-status.cmb-attach-list' );
1016
- if ( $filelist.length ) {
1017
- $filelist.sortable({ cursor: 'move' }).disableSelection();
1018
- }
1019
- };
1020
-
1021
- cmb.makeRepeatableSortable = function() {
1022
- var $repeatables = cmb.metabox().find( '.cmb-repeat-table .cmb-field-list' );
1023
-
1024
- if ( $repeatables.length ) {
1025
- $repeatables.sortable({
1026
- items : '.cmb-repeat-row',
1027
- cursor: 'move',
1028
- // The default "cancel" attributes are: "input,textarea,button,select,option".
1029
- // We are appending .CodeMirror.
1030
- // See https://api.jqueryui.com/sortable/#option-cancel
1031
- cancel: 'input,textarea,button,select,option,.CodeMirror'
1032
- });
1033
- }
1034
- };
1035
-
1036
- cmb.maybeOembed = function( evt ) {
1037
- var $this = $( this );
1038
-
1039
- var m = {
1040
- focusout : function() {
1041
- setTimeout( function() {
1042
- // if it's been 2 seconds, hide our spinner
1043
- cmb.spinner( '.cmb2-metabox', true );
1044
- }, 2000);
1045
- },
1046
- keyup : function() {
1047
- var betw = function( min, max ) {
1048
- return ( evt.which <= max && evt.which >= min );
1049
- };
1050
- // Only Ajax on normal keystrokes
1051
- if ( betw( 48, 90 ) || betw( 96, 111 ) || betw( 8, 9 ) || evt.which === 187 || evt.which === 190 ) {
1052
- // fire our ajax function
1053
- cmb.doAjax( $this, evt );
1054
- }
1055
- },
1056
- paste : function() {
1057
- // paste event is fired before the value is filled, so wait a bit
1058
- setTimeout( function() { cmb.doAjax( $this ); }, 100);
1059
- }
1060
- };
1061
-
1062
- m[ evt.type ]();
1063
- };
1064
-
1065
- /**
1066
- * Resize oEmbed videos to fit in their respective metaboxes
1067
- *
1068
- * @since 0.9.4
1069
- *
1070
- * @return {return}
1071
- */
1072
- cmb.resizeoEmbeds = function() {
1073
- cmb.metabox().each( function() {
1074
- var $this = $( this );
1075
- var $tableWrap = $this.parents('.inside');
1076
- var isSide = $this.parents('.inner-sidebar').length || $this.parents( '#side-sortables' ).length;
1077
- var isSmall = isSide;
1078
- var isSmallest = false;
1079
- if ( ! $tableWrap.length ) {
1080
- return true; // continue
1081
- }
1082
-
1083
- // Calculate new width
1084
- var tableW = $tableWrap.width();
1085
-
1086
- if ( cmb.styleBreakPoint > tableW ) {
1087
- isSmall = true;
1088
- isSmallest = ( cmb.styleBreakPoint - 62 ) > tableW;
1089
- }
1090
-
1091
- tableW = isSmall ? tableW : Math.round(($tableWrap.width() * 0.82)*0.97);
1092
- var newWidth = tableW - 30;
1093
- if ( isSmall && ! isSide && ! isSmallest ) {
1094
- newWidth = newWidth - 75;
1095
- }
1096
- if ( newWidth > 639 ) {
1097
- return true; // continue
1098
- }
1099
-
1100
- var $embeds = $this.find('.cmb-type-oembed .embed-status');
1101
- var $children = $embeds.children().not('.cmb2-remove-wrapper');
1102
- if ( ! $children.length ) {
1103
- return true; // continue
1104
- }
1105
-
1106
- $children.each( function() {
1107
- var $this = $( this );
1108
- var iwidth = $this.width();
1109
- var iheight = $this.height();
1110
- var _newWidth = newWidth;
1111
- if ( $this.parents( '.cmb-repeat-row' ).length && ! isSmall ) {
1112
- // Make room for our repeatable "remove" button column
1113
- _newWidth = newWidth - 91;
1114
- _newWidth = 785 > tableW ? _newWidth - 15 : _newWidth;
1115
- }
1116
- // Calc new height
1117
- var newHeight = Math.round((_newWidth * iheight)/iwidth);
1118
- $this.width(_newWidth).height(newHeight);
1119
- });
1120
- });
1121
- };
1122
-
1123
- // function for running our ajax
1124
- cmb.doAjax = function( $obj ) {
1125
- // get typed value
1126
- var oembed_url = $obj.val();
1127
- // only proceed if the field contains more than 6 characters
1128
- if ( oembed_url.length < 6 ) {
1129
- return;
1130
- }
1131
-
1132
- // get field id
1133
- var field_id = $obj.attr('id');
1134
- var $context = $obj.closest( '.cmb-td' );
1135
- var $embed_container = $context.find( '.embed-status' );
1136
- var $embed_wrap = $context.find( '.embed_wrap' );
1137
- var $child_el = $embed_container.find( ':first-child' );
1138
- var oembed_width = $embed_container.length && $child_el.length ? $child_el.width() : $obj.width();
1139
-
1140
- cmb.log( 'oembed_url', oembed_url, field_id );
1141
-
1142
- // show our spinner
1143
- cmb.spinner( $context );
1144
- // clear out previous results
1145
- $embed_wrap.html('');
1146
- // and run our ajax function
1147
- setTimeout( function() {
1148
- // if they haven't typed in 500 ms
1149
- if ( $( '.cmb2-oembed:focus' ).val() !== oembed_url ) {
1150
- return;
1151
- }
1152
- $.ajax({
1153
- type : 'post',
1154
- dataType : 'json',
1155
- url : l10n.ajaxurl,
1156
- data : {
1157
- 'action' : 'cmb2_oembed_handler',
1158
- 'oembed_url' : oembed_url,
1159
- 'oembed_width' : oembed_width > 300 ? oembed_width : 300,
1160
- 'field_id' : field_id,
1161
- 'object_id' : $obj.data( 'objectid' ),
1162
- 'object_type' : $obj.data( 'objecttype' ),
1163
- 'cmb2_ajax_nonce' : l10n.ajax_nonce
1164
- },
1165
- success: function(response) {
1166
- cmb.log( response );
1167
- // hide our spinner
1168
- cmb.spinner( $context, true );
1169
- // and populate our results from ajax response
1170
- $embed_wrap.html( response.data );
1171
- }
1172
- });
1173
-
1174
- }, 500);
1175
-
1176
- };
1177
-
1178
- /**
1179
- * Gets jQuery object containing all CMB metaboxes. Caches the result.
1180
- *
1181
- * @since 1.0.2
1182
- *
1183
- * @return {Object} jQuery object containing all CMB metaboxes.
1184
- */
1185
- cmb.metabox = function() {
1186
- if ( cmb.$metabox ) {
1187
- return cmb.$metabox;
1188
- }
1189
- cmb.$metabox = $('.cmb2-wrap > .cmb2-metabox');
1190
- return cmb.$metabox;
1191
- };
1192
-
1193
- /**
1194
- * Starts/stops contextual spinner.
1195
- *
1196
- * @since 1.0.1
1197
- *
1198
- * @param {object} $context The jQuery parent/context object.
1199
- * @param {bool} hide Whether to hide the spinner (will show by default).
1200
- *
1201
- * @return {void}
1202
- */
1203
- cmb.spinner = function( $context, hide ) {
1204
- var m = hide ? 'removeClass' : 'addClass';
1205
- $('.cmb-spinner', $context )[ m ]( 'is-active' );
1206
- };
1207
-
1208
- /**
1209
- * Triggers a jQuery event on the document object.
1210
- *
1211
- * @since 2.2.3
1212
- *
1213
- * @param {string} evtName The name of the event to trigger.
1214
- *
1215
- * @return {void}
1216
- */
1217
- cmb.trigger = function( evtName ) {
1218
- var args = Array.prototype.slice.call( arguments, 1 );
1219
- args.push( cmb );
1220
- $document.trigger( evtName, args );
1221
- };
1222
-
1223
- /**
1224
- * Triggers a jQuery event on the given jQuery object.
1225
- *
1226
- * @since 2.2.3
1227
- *
1228
- * @param {object} $el The jQuery element object.
1229
- * @param {string} evtName The name of the event to trigger.
1230
- *
1231
- * @return {void}
1232
- */
1233
- cmb.triggerElement = function( $el, evtName ) {
1234
- var args = Array.prototype.slice.call( arguments, 2 );
1235
- args.push( cmb );
1236
- $el.trigger( evtName, args );
1237
- };
1238
-
1239
- /**
1240
- * Get an argument for a given field.
1241
- *
1242
- * @since 2.5.0
1243
- *
1244
- * @param {string|object} hash The field hash, id, or a jQuery object for a field.
1245
- * @param {string} arg The argument to get on the field.
1246
- *
1247
- * @return {mixed} The argument value.
1248
- */
1249
- cmb.getFieldArg = function( hash, arg ) {
1250
- return cmb.getField( hash )[ arg ];
1251
- };
1252
-
1253
- /**
1254
- * Get a field object instances. Can be filtered by passing in a filter callback function.
1255
- * e.g. `const fileFields = CMB2.getFields(f => 'file' === f.type);`
1256
- *
1257
- * @since 2.5.0
1258
- *
1259
- * @param {mixed} filterCb An optional filter callback function.
1260
- *
1261
- * @return array An array of field object instances.
1262
- */
1263
- cmb.getFields = function( filterCb ) {
1264
- if ( 'function' === typeof filterCb ) {
1265
- var fields = [];
1266
- $.each( l10n.fields, function( hash, field ) {
1267
- if ( filterCb( field, hash ) ) {
1268
- fields.push( field );
1269
- }
1270
- });
1271
- return fields;
1272
- }
1273
-
1274
- return l10n.fields;
1275
- };
1276
-
1277
- /**
1278
- * Get a field object instance by hash or id.
1279
- *
1280
- * @since 2.5.0
1281
- *
1282
- * @param {string|object} hash The field hash, id, or a jQuery object for a field.
1283
- *
1284
- * @return {object} The field object or an empty object.
1285
- */
1286
- cmb.getField = function( hash ) {
1287
- var field = {};
1288
- hash = hash instanceof jQuery ? hash.data( 'hash' ) : hash;
1289
- if ( hash ) {
1290
- try {
1291
- if ( l10n.fields[ hash ] ) {
1292
- throw new Error( hash );
1293
- }
1294
-
1295
- cmb.getFields( function( field ) {
1296
- if ( 'function' === typeof hash ) {
1297
- if ( hash( field ) ) {
1298
- throw new Error( field.hash );
1299
- }
1300
- } else if ( field.id && field.id === hash ) {
1301
- throw new Error( field.hash );
1302
- }
1303
- });
1304
- } catch( e ) {
1305
- field = l10n.fields[ e.message ];
1306
- }
1307
- }
1308
-
1309
- return field;
1310
- };
1311
-
1312
- /**
1313
- * Safely log things if query var is set. Accepts same parameters as console.log.
1314
- *
1315
- * @since 1.0.0
1316
- *
1317
- * @return {void}
1318
- */
1319
- cmb.log = function() {
1320
- if ( l10n.script_debug && console && 'function' === typeof console.log ) {
1321
- console.log.apply(console, arguments);
1322
- }
1323
- };
1324
-
1325
- /**
1326
- * Replace the last occurrence of a string.
1327
- *
1328
- * @since 2.2.6
1329
- *
1330
- * @param {string} string String to search/replace.
1331
- * @param {string} search String to search.
1332
- * @param {string} replace String to replace search with.
1333
- *
1334
- * @return {string} Possibly modified string.
1335
- */
1336
- cmb.replaceLast = function( string, search, replace ) {
1337
- // find the index of last time word was used
1338
- var n = string.lastIndexOf( search );
1339
-
1340
- // slice the string in 2, one from the start to the lastIndexOf
1341
- // and then replace the word in the rest
1342
- return string.slice( 0, n ) + string.slice( n ).replace( search, replace );
1343
- };
1344
-
1345
- // Kick it off!
1346
- $( cmb.init );
1347
-
1348
- })(window, document, jQuery, window.CMB2);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/cmb2/js/cmb2.min.js DELETED
@@ -1 +0,0 @@
1
- window.CMB2=window.CMB2||{},function(window,document,$,cmb,undefined){"use strict";var $document,l10n=window.cmb2_l10,setTimeout=window.setTimeout,$id=function(selector){return $(document.getElementById(selector))};cmb.$id=$id;var defaults={idNumber:!1,repeatEls:'input:not([type="button"],[id^=filelist]),select,textarea,.cmb2-media-status',noEmpty:'input:not([type="button"]):not([type="radio"]):not([type="checkbox"]),textarea',repeatUpdate:'input:not([type="button"]),select,textarea,label',styleBreakPoint:450,mediaHandlers:{},defaults:{time_picker:l10n.defaults.time_picker,date_picker:l10n.defaults.date_picker,color_picker:l10n.defaults.color_picker||{},code_editor:l10n.defaults.code_editor},media:{frames:{}}};cmb.init=function(){$document=$(document),$.extend(cmb,defaults),cmb.trigger("cmb_pre_init");var $metabox=cmb.metabox(),$repeatGroup=$metabox.find(".cmb-repeatable-group");cmb.initPickers($metabox.find('input[type="text"].cmb2-timepicker'),$metabox.find('input[type="text"].cmb2-datepicker'),$metabox.find('input[type="text"].cmb2-colorpicker')),cmb.initCodeEditors($metabox.find(".cmb2-textarea-code:not(.disable-codemirror)")),$('<p><span class="button-secondary cmb-multicheck-toggle">'+l10n.strings.check_toggle+"</span></p>").insertBefore(".cmb2-checkbox-list:not(.no-select-all)"),cmb.makeListSortable(),cmb.makeRepeatableSortable(),$metabox.on("change",".cmb2_upload_file",function(){cmb.media.field=$(this).attr("id"),$id(cmb.media.field+"_id").val("")}).on("click",".cmb-multicheck-toggle",cmb.toggleCheckBoxes).on("click",".cmb2-upload-button",cmb.handleMedia).on("click",".cmb-attach-list li, .cmb2-media-status .img-status img, .cmb2-media-status .file-status > span",cmb.handleFileClick).on("click",".cmb2-remove-file-button",cmb.handleRemoveMedia).on("click",".cmb-add-group-row",cmb.addGroupRow).on("click",".cmb-add-row-button",cmb.addAjaxRow).on("click",".cmb-remove-group-row",cmb.removeGroupRow).on("click",".cmb-remove-row-button",cmb.removeAjaxRow).on("keyup paste focusout",".cmb2-oembed",cmb.maybeOembed).on("cmb2_remove_row",".cmb-repeatable-group",cmb.resetTitlesAndIterator).on("click",".cmbhandle, .cmbhandle + .cmbhandle-title",cmb.toggleHandle),$repeatGroup.length&&$repeatGroup.on("cmb2_add_row",cmb.emptyValue).on("cmb2_add_row",cmb.setDefaults).filter(".sortable").each(function(){$(this).find(".cmb-remove-group-row-button").before('<a class="button-secondary cmb-shift-rows move-up alignleft" href="#"><span class="'+l10n.up_arrow_class+'"></span></a> <a class="button-secondary cmb-shift-rows move-down alignleft" href="#"><span class="'+l10n.down_arrow_class+'"></span></a>')}).on("click",".cmb-shift-rows",cmb.shiftRows),setTimeout(cmb.resizeoEmbeds,500),$(window).on("resize",cmb.resizeoEmbeds),$id("addtag").length&&cmb.listenTagAdd(),$(document).on("cmb_init",cmb.mceEnsureSave),cmb.trigger("cmb_init")},cmb.mceEnsureSave=function(){wp.data&&wp.data.hasOwnProperty("subscribe")&&cmb.canTinyMCE()&&wp.data.subscribe(function(){var editor=wp.data.hasOwnProperty("select")?wp.data.select("core/editor"):null;if(editor&&editor.isSavingPost&&editor.isSavingPost()&&window.tinyMCE.editors.length)for(var i=0;i<window.tinyMCE.editors.length;i++)window.tinyMCE.activeEditor!==window.tinyMCE.editors[i]&&window.tinyMCE.editors[i].save()})},cmb.canTinyMCE=function(){return l10n.user_can_richedit&&window.tinyMCE},cmb.listenTagAdd=function(){$document.ajaxSuccess(function(evt,xhr,settings){settings.data&&settings.data.length&&-1!==settings.data.indexOf("action=add-tag")&&cmb.resetBoxes($id("addtag").find(".cmb2-wrap > .cmb2-metabox"))})},cmb.resetBoxes=function($boxes){$.each($boxes,function(){cmb.resetBox($(this))})},cmb.resetBox=function($box){$box.find(".wp-picker-clear").trigger("click"),$box.find(".cmb2-remove-file-button").trigger("click"),$box.find(".cmb-row.cmb-repeatable-grouping:not(:first-of-type) .cmb-remove-group-row").click(),$box.find(".cmb-repeat-row:not(:first-child)").remove(),$box.find('input:not([type="button"]),select,textarea').each(function(){var $element=$(this),tagName=$element.prop("tagName");if("INPUT"===tagName){var elType=$element.attr("type");"checkbox"===elType||"radio"===elType?$element.prop("checked",!1):$element.val("")}"SELECT"===tagName&&$("option:selected",this).prop("selected",!1),"TEXTAREA"===tagName&&$element.html("")})},cmb.resetTitlesAndIterator=function(evt){evt.group&&$(".cmb-repeatable-group.repeatable").each(function(){var $table=$(this),groupTitle=$table.find(".cmb-add-group-row").data("grouptitle");$table.find(".cmb-repeatable-grouping").each(function(rowindex){var $row=$(this),$rowTitle=$row.find("h3.cmb-group-title");$row.data("iterator",rowindex),$rowTitle.length&&$rowTitle.text(groupTitle.replace("{#}",rowindex+1))})})},cmb.toggleHandle=function(evt){evt.preventDefault(),cmb.trigger("postbox-toggled",$(this).parent(".postbox").toggleClass("closed"))},cmb.toggleCheckBoxes=function(evt){evt.preventDefault();var $this=$(this),$multicheck=$this.closest(".cmb-td").find("input[type=checkbox]:not([disabled])");$this.data("checked")?($multicheck.prop("checked",!1),$this.data("checked",!1)):($multicheck.prop("checked",!0),$this.data("checked",!0))},cmb.handleMedia=function(evt){evt.preventDefault();var $el=$(this);cmb.attach_id=!$el.hasClass("cmb2-upload-list")&&$el.closest(".cmb-td").find(".cmb2-upload-file-id").val(),cmb.attach_id="0"!==cmb.attach_id&&cmb.attach_id,cmb._handleMedia($el.prev("input.cmb2-upload-file").attr("id"),$el.hasClass("cmb2-upload-list"))},cmb.handleFileClick=function(evt){if(!$(evt.target).is("a")){evt.preventDefault();var $el=$(this),$td=$el.closest(".cmb-td"),isList=$td.find(".cmb2-upload-button").hasClass("cmb2-upload-list");cmb.attach_id=isList?$el.find('input[type="hidden"]').data("id"):$td.find(".cmb2-upload-file-id").val(),cmb.attach_id&&cmb._handleMedia($td.find("input.cmb2-upload-file").attr("id"),isList,cmb.attach_id)}},cmb._handleMedia=function(id,isList){if(wp){var media,handlers;if(handlers=cmb.mediaHandlers,media=cmb.media,media.field=id,media.$field=$id(media.field),media.fieldData=media.$field.data(),media.previewSize=media.fieldData.previewsize,media.sizeName=media.fieldData.sizename,media.fieldName=media.$field.attr("name"),media.isList=isList,id in media.frames)return media.frames[id].open();media.frames[id]=wp.media({title:cmb.metabox().find('label[for="'+id+'"]').text(),library:media.fieldData.queryargs||{},button:{text:l10n.strings[isList?"upload_files":"upload_file"]},multiple:!!isList&&"add"}),media.frames[id].states.first().set("filterable","all"),cmb.trigger("cmb_media_modal_init",media),handlers.list=function(selection,returnIt){var attachmentHtml,fileGroup=[];if(handlers.list.templates||(handlers.list.templates={image:wp.template("cmb2-list-image"),file:wp.template("cmb2-list-file")}),selection.each(function(attachment){attachmentHtml=handlers.getAttachmentHtml(attachment,"list"),fileGroup.push(attachmentHtml)}),returnIt)return fileGroup;media.$field.siblings(".cmb2-media-status").append(fileGroup)},handlers.single=function(selection){handlers.single.templates||(handlers.single.templates={image:wp.template("cmb2-single-image"),file:wp.template("cmb2-single-file")});var attachment=selection.first();media.$field.val(attachment.get("url")),$id(media.field+"_id").val(attachment.get("id"));var attachmentHtml=handlers.getAttachmentHtml(attachment,"single");media.$field.siblings(".cmb2-media-status").slideDown().html(attachmentHtml)},handlers.getAttachmentHtml=function(attachment,templatesId){var isImage="image"===attachment.get("type"),data=handlers.prepareData(attachment,isImage);return handlers[templatesId].templates[isImage?"image":"file"](data)},handlers.prepareData=function(data,image){return image&&handlers.getImageData.call(data,50),data=data.toJSON(),data.mediaField=media.field,data.mediaFieldName=media.fieldName,data.stringRemoveImage=l10n.strings.remove_image,data.stringFile=l10n.strings.file,data.stringDownload=l10n.strings.download,data.stringRemoveFile=l10n.strings.remove_file,data},handlers.getImageData=function(fallbackSize){var previewW=media.previewSize[0]||fallbackSize,previewH=media.previewSize[1]||fallbackSize,url=this.get("url"),width=this.get("width"),height=this.get("height"),sizes=this.get("sizes");return sizes&&(sizes[media.sizeName]?(url=sizes[media.sizeName].url,width=sizes[media.sizeName].width,height=sizes[media.sizeName].height):sizes.large&&(url=sizes.large.url,width=sizes.large.width,height=sizes.large.height)),width>previewW&&(height=Math.floor(previewW*height/width),width=previewW),height>previewH&&(width=Math.floor(previewH*width/height),height=previewH),width||(width=previewW),height||(height="svg"===this.get("filename").split(".").pop()?"100%":previewH),this.set("sizeUrl",url),this.set("sizeWidth",width),this.set("sizeHeight",height),this},handlers.selectFile=function(){var selection=media.frames[id].state().get("selection"),type=isList?"list":"single";cmb.attach_id&&isList?$('[data-id="'+cmb.attach_id+'"]').parents("li").replaceWith(handlers.list(selection,!0)):handlers[type](selection),cmb.trigger("cmb_media_modal_select",selection,media)},handlers.openModal=function(){var attach,selection=media.frames[id].state().get("selection");cmb.attach_id?(attach=wp.media.attachment(cmb.attach_id),attach.fetch(),selection.set(attach?[attach]:[])):selection.reset(),cmb.trigger("cmb_media_modal_open",selection,media)},media.frames[id].on("select",handlers.selectFile).on("open",handlers.openModal),media.frames[id].open()}},cmb.handleRemoveMedia=function(evt){evt.preventDefault();var $this=$(this);return $this.is(".cmb-attach-list .cmb2-remove-file-button")?($this.parents(".cmb2-media-item").remove(),!1):(cmb.media.field=$this.attr("rel"),cmb.metabox().find(document.getElementById(cmb.media.field)).val(""),cmb.metabox().find(document.getElementById(cmb.media.field+"_id")).val(""),$this.parents(".cmb2-media-status").html(""),!1)},cmb.cleanRow=function($row,prevNum,group){var $elements=$row.find(cmb.repeatUpdate);if(group){var $other=$row.find("[id]").not(cmb.repeatUpdate);$row.find(".cmb-repeat-table .cmb-repeat-row:not(:first-child)").remove(),$other.length&&$other.each(function(){var $_this=$(this),oldID=$_this.attr("id"),newID=oldID.replace("_"+prevNum,"_"+cmb.idNumber),$buttons=$row.find('[data-selector="'+oldID+'"]');$_this.attr("id",newID),$buttons.length&&$buttons.attr("data-selector",newID).data("selector",newID)})}return $elements.filter(":checked").removeAttr("checked"),$elements.find(":checked").removeAttr("checked"),$elements.filter(":selected").removeAttr("selected"),$elements.find(":selected").removeAttr("selected",!1),$row.find("h3.cmb-group-title").length&&$row.find("h3.cmb-group-title").text($row.data("title").replace("{#}",cmb.idNumber+1)),$elements.each(function(){cmb.elReplacements($(this),prevNum,group)}),cmb},cmb.elReplacements=function($newInput,prevNum,group){var newID,oldID,oldFor=$newInput.attr("for"),oldVal=$newInput.val(),type=$newInput.prop("type"),defVal=cmb.getFieldArg($newInput,"default"),newVal=void 0!==defVal&&!1!==defVal?defVal:"",tagName=$newInput.prop("tagName"),checkable=("radio"===type||"checkbox"===type)&&oldVal,attrs={};if(oldFor)attrs={for:oldFor.replace("_"+prevNum,"_"+cmb.idNumber)};else{var newName,oldName=$newInput.attr("name");oldID=$newInput.attr("id"),group?(newName=oldName?oldName.replace("["+prevNum+"][","["+cmb.idNumber+"]["):"",newID=oldID?oldID.replace("_"+prevNum+"_","_"+cmb.idNumber+"_"):""):(newName=oldName?cmb.replaceLast(oldName,"["+prevNum+"]","["+cmb.idNumber+"]"):"",newID=oldID?cmb.replaceLast(oldID,"_"+prevNum,"_"+cmb.idNumber):""),attrs={id:newID,name:newName}}if("TEXTAREA"===tagName&&$newInput.html(newVal),"SELECT"===tagName&&void 0!==defVal){var $toSelect=$newInput.find('[value="'+defVal+'"]');$toSelect.length&&$toSelect.attr("selected","selected").prop("selected","selected")}return checkable&&($newInput.removeAttr("checked"),void 0!==defVal&&oldVal===defVal&&$newInput.attr("checked","checked").prop("checked","checked")),!group&&$newInput[0].hasAttribute("data-iterator")&&(attrs["data-iterator"]=cmb.idNumber),$newInput.removeClass("hasDatepicker").val(checkable||newVal).attr(attrs),$newInput},cmb.newRowHousekeeping=function($row){var $colorPicker=$row.find(".wp-picker-container"),$list=$row.find(".cmb2-media-status");return $colorPicker.length&&$colorPicker.each(function(){var $td=$(this).parent();$td.html($td.find('input[type="text"].cmb2-colorpicker').attr("style",""))}),$list.length&&$list.empty(),cmb},cmb.afterRowInsert=function($row){cmb.initPickers($row.find('input[type="text"].cmb2-timepicker'),$row.find('input[type="text"].cmb2-datepicker'),$row.find('input[type="text"].cmb2-colorpicker'))},cmb.updateNameAttr=function(){var $this=$(this),name=$this.attr("name");if(void 0!==name){var prevNum=parseInt($this.parents(".cmb-repeatable-grouping").data("iterator"),10),newNum=prevNum-1,$newName=name.replace("["+prevNum+"]","["+newNum+"]");$this.attr("name",$newName)}},cmb.emptyValue=function(evt,row){$(cmb.noEmpty,row).val("")},cmb.setDefaults=function(evt,row){$(cmb.noEmpty,row).each(function(){var $el=$(this),defVal=cmb.getFieldArg($el,"default");void 0!==defVal&&!1!==defVal&&$el.val(defVal)})},cmb.addGroupRow=function(evt){evt.preventDefault();var $this=$(this);cmb.triggerElement($this,"cmb2_add_group_row_start",$this);var $table=$id($this.data("selector")),$oldRow=$table.find(".cmb-repeatable-grouping").last(),prevNum=parseInt($oldRow.data("iterator"),10);cmb.idNumber=parseInt(prevNum,10)+1;for(var $row=$oldRow.clone(),nodeName=$row.prop("nodeName")||"div",getRowId=function(id){return id=id.split("-"),id.splice(id.length-1,1),id.push(cmb.idNumber),id.join("-")};$table.find('.cmb-repeatable-grouping[data-iterator="'+cmb.idNumber+'"]').length>0;)cmb.idNumber++;cmb.newRowHousekeeping($row.data("title",$this.data("grouptitle"))).cleanRow($row,prevNum,!0),$row.find(".cmb-add-row-button").prop("disabled",!1);var $newRow=$("<"+nodeName+' id="'+getRowId($oldRow.attr("id"))+'" class="postbox cmb-row cmb-repeatable-grouping" data-iterator="'+cmb.idNumber+'">'+$row.html()+"</"+nodeName+">");$oldRow.after($newRow),cmb.afterRowInsert($newRow),cmb.triggerElement($table,{type:"cmb2_add_row",group:!0},$newRow)},cmb.addAjaxRow=function(evt){evt.preventDefault();var $this=$(this),$table=$id($this.data("selector")),$row=$table.find(".empty-row"),prevNum=parseInt($row.find("[data-iterator]").data("iterator"),10);cmb.idNumber=parseInt(prevNum,10)+1;var $emptyrow=$row.clone();cmb.newRowHousekeeping($emptyrow).cleanRow($emptyrow,prevNum),$row.removeClass("empty-row hidden").addClass("cmb-repeat-row"),$row.after($emptyrow),cmb.afterRowInsert($emptyrow),cmb.triggerElement($table,{type:"cmb2_add_row",group:!1},$emptyrow,$row)},cmb.removeGroupRow=function(evt){evt.preventDefault();var $this=$(this),confirmation=$this.data("confirm");if(!confirmation||window.confirm(confirmation)){var $table=$id($this.data("selector")),$parent=$this.parents(".cmb-repeatable-grouping");if($table.find(".cmb-repeatable-grouping").length<2)return cmb.resetRow($parent.parents(".cmb-repeatable-group").find(".cmb-add-group-row"),$this);cmb.triggerElement($table,"cmb2_remove_group_row_start",$this),$parent.nextAll(".cmb-repeatable-grouping").find(cmb.repeatEls).each(cmb.updateNameAttr),$parent.remove(),cmb.triggerElement($table,{type:"cmb2_remove_row",group:!0})}},cmb.removeAjaxRow=function(evt){evt.preventDefault();var $this=$(this);if(!$this.hasClass("button-disabled")){var $parent=$this.parents(".cmb-row"),$table=$this.parents(".cmb-repeat-table");if($table.find(".cmb-row").length<=2)return cmb.resetRow($parent.find(".cmb-add-row-button"),$this);$parent.hasClass("empty-row")&&$parent.prev().addClass("empty-row").removeClass("cmb-repeat-row"),$this.parents(".cmb-repeat-table .cmb-row").remove(),cmb.triggerElement($table,{type:"cmb2_remove_row",group:!1})}},cmb.resetRow=function($addNewBtn,$removeBtn){$addNewBtn.trigger("click"),$removeBtn.trigger("click")},cmb.shiftRows=function(evt){evt.preventDefault();var $this=$(this),$from=$this.parents(".cmb-repeatable-grouping"),$goto=$this.hasClass("move-up")?$from.prev(".cmb-repeatable-grouping"):$from.next(".cmb-repeatable-grouping");if(cmb.triggerElement($this,"cmb2_shift_rows_enter",$this,$from,$goto),$goto.length){cmb.triggerElement($this,"cmb2_shift_rows_start",$this,$from,$goto);var inputVals=[];$from.find(cmb.repeatEls).each(function(){var val,$element=$(this),elType=$element.attr("type");val=$element.hasClass("cmb2-media-status")?$element.html():"checkbox"===elType||"radio"===elType?$element.is(":checked"):"select"===$element.prop("tagName")?$element.is(":selected"):$element.val(),inputVals.push({val:val,$:$element})}),$goto.find(cmb.repeatEls).each(function(index){var val,$element=$(this),elType=$element.attr("type");if($element.hasClass("cmb2-media-status")){var toRowId=$element.closest(".cmb-repeatable-grouping").attr("data-iterator"),fromRowId=inputVals[index].$.closest(".cmb-repeatable-grouping").attr("data-iterator");val=$element.html(),$element.html(inputVals[index].val),inputVals[index].$.html(val),inputVals[index].$.find("input").each(function(){var name=$(this).attr("name");name=name.replace("["+toRowId+"]","["+fromRowId+"]"),$(this).attr("name",name)}),$element.find("input").each(function(){var name=$(this).attr("name");name=name.replace("["+fromRowId+"]","["+toRowId+"]"),$(this).attr("name",name)})}else"checkbox"===elType?(inputVals[index].$.prop("checked",$element.is(":checked")),$element.prop("checked",inputVals[index].val)):"radio"===elType?($element.is(":checked")&&inputVals[index].$.attr("data-checked","true"),inputVals[index].$.is(":checked")&&$element.attr("data-checked","true")):"select"===$element.prop("tagName")?(inputVals[index].$.prop("selected",$element.is(":selected")),$element.prop("selected",inputVals[index].val)):(inputVals[index].$.val($element.val()),$element.val(inputVals[index].val))}),$from.find("input[data-checked=true]").prop("checked",!0).removeAttr("data-checked"),$goto.find("input[data-checked=true]").prop("checked",!0).removeAttr("data-checked"),$from.find('input[type="text"].cmb2-colorpicker').trigger("change"),$goto.find('input[type="text"].cmb2-colorpicker').trigger("change"),cmb.triggerElement($this,"cmb2_shift_rows_complete",$this,$from,$goto)}},cmb.initPickers=function($timePickers,$datePickers,$colorPickers){cmb.trigger("cmb_init_pickers",{time:$timePickers,date:$datePickers,color:$colorPickers}),cmb.initDateTimePickers($timePickers,"timepicker","time_picker"),cmb.initDateTimePickers($datePickers,"datepicker","date_picker"),cmb.initColorPickers($colorPickers)},cmb.initDateTimePickers=function($selector,method,defaultKey){$selector.length&&$selector[method]("destroy").each(function(){var $this=$(this),fieldOpts=$this.data(method)||{},options=$.extend({},cmb.defaults[defaultKey],fieldOpts);$this[method](cmb.datePickerSetupOpts(fieldOpts,options,method))})},cmb.datePickerSetupOpts=function(fieldOpts,options,method){var existing=$.extend({},options);return options.beforeShow=function(input,inst){"timepicker"===method&&cmb.addTimePickerClasses(inst.dpDiv),$id("ui-datepicker-div").addClass("cmb2-element"),"function"==typeof existing.beforeShow&&existing.beforeShow(input,inst)},"timepicker"===method&&(options.onChangeMonthYear=function(year,month,inst,picker){cmb.addTimePickerClasses(inst.dpDiv),"function"==typeof existing.onChangeMonthYear&&existing.onChangeMonthYear(year,month,inst,picker)}),options.onClose=function(dateText,inst){var $picker=$id("ui-datepicker-div").removeClass("cmb2-element").hide();"timepicker"!==method||$(inst.input).val()||inst.input.val($picker.find(".ui_tpicker_time").text()),"function"==typeof existing.onClose&&existing.onClose(dateText,inst)},options},cmb.addTimePickerClasses=function($picker){var func=cmb.addTimePickerClasses;func.count=func.count||0,setTimeout(function(){$picker.find(".ui-priority-secondary").length?($picker.find(".ui-priority-secondary").addClass("button-secondary"),$picker.find(".ui-priority-primary").addClass("button-primary"),func.count=0):func.count<5&&(func.count++,func($picker))},10)},cmb.initColorPickers=function($selector){$selector.length&&("object"==typeof jQuery.wp&&"function"==typeof jQuery.wp.wpColorPicker?$selector.each(function(){var $this=$(this),fieldOpts=$this.data("colorpicker")||{};$this.wpColorPicker($.extend({},cmb.defaults.color_picker,fieldOpts))}):$selector.each(function(i){$(this).after('<div id="picker-'+i+'" style="z-index: 1000; background: #EEE; border: 1px solid #CCC; position: absolute; display: block;"></div>'),$id("picker-"+i).hide().farbtastic($(this))}).focus(function(){$(this).next().show()}).blur(function(){$(this).next().hide()}))},cmb.initCodeEditors=function($selector){cmb.trigger("cmb_init_code_editors",$selector),cmb.defaults.code_editor&&wp&&wp.codeEditor&&$selector.length&&$selector.each(function(){wp.codeEditor.initialize(this.id,cmb.codeEditorArgs($(this).data("codeeditor")))})},cmb.codeEditorArgs=function(overrides){var props=["codemirror","csslint","jshint","htmlhint"],args=$.extend({},cmb.defaults.code_editor);overrides=overrides||{};for(var i=props.length-1;i>=0;i--)overrides.hasOwnProperty(props[i])&&(args[props[i]]=$.extend({},args[props[i]]||{},overrides[props[i]]));return args},cmb.makeListSortable=function(){var $filelist=cmb.metabox().find(".cmb2-media-status.cmb-attach-list");$filelist.length&&$filelist.sortable({cursor:"move"}).disableSelection()},cmb.makeRepeatableSortable=function(){var $repeatables=cmb.metabox().find(".cmb-repeat-table .cmb-field-list");$repeatables.length&&$repeatables.sortable({items:".cmb-repeat-row",cursor:"move",cancel:"input,textarea,button,select,option,.CodeMirror"})},cmb.maybeOembed=function(evt){var $this=$(this);({focusout:function(){setTimeout(function(){cmb.spinner(".cmb2-metabox",!0)},2e3)},keyup:function(){var betw=function(min,max){return evt.which<=max&&evt.which>=min};(betw(48,90)||betw(96,111)||betw(8,9)||187===evt.which||190===evt.which)&&cmb.doAjax($this,evt)},paste:function(){setTimeout(function(){cmb.doAjax($this)},100)}})[evt.type]()},cmb.resizeoEmbeds=function(){cmb.metabox().each(function(){var $this=$(this),$tableWrap=$this.parents(".inside"),isSide=$this.parents(".inner-sidebar").length||$this.parents("#side-sortables").length,isSmall=isSide,isSmallest=!1;if(!$tableWrap.length)return!0;var tableW=$tableWrap.width();cmb.styleBreakPoint>tableW&&(isSmall=!0,isSmallest=cmb.styleBreakPoint-62>tableW),tableW=isSmall?tableW:Math.round(.82*$tableWrap.width()*.97);var newWidth=tableW-30;if(!isSmall||isSide||isSmallest||(newWidth-=75),newWidth>639)return!0;var $embeds=$this.find(".cmb-type-oembed .embed-status"),$children=$embeds.children().not(".cmb2-remove-wrapper");if(!$children.length)return!0;$children.each(function(){var $this=$(this),iwidth=$this.width(),iheight=$this.height(),_newWidth=newWidth;$this.parents(".cmb-repeat-row").length&&!isSmall&&(_newWidth=newWidth-91,_newWidth=785>tableW?_newWidth-15:_newWidth);var newHeight=Math.round(_newWidth*iheight/iwidth);$this.width(_newWidth).height(newHeight)})})},cmb.doAjax=function($obj){var oembed_url=$obj.val();if(!(oembed_url.length<6)){var field_id=$obj.attr("id"),$context=$obj.closest(".cmb-td"),$embed_container=$context.find(".embed-status"),$embed_wrap=$context.find(".embed_wrap"),$child_el=$embed_container.find(":first-child"),oembed_width=$embed_container.length&&$child_el.length?$child_el.width():$obj.width();cmb.log("oembed_url",oembed_url,field_id),cmb.spinner($context),$embed_wrap.html(""),setTimeout(function(){$(".cmb2-oembed:focus").val()===oembed_url&&$.ajax({type:"post",dataType:"json",url:l10n.ajaxurl,data:{action:"cmb2_oembed_handler",oembed_url:oembed_url,oembed_width:oembed_width>300?oembed_width:300,field_id:field_id,object_id:$obj.data("objectid"),object_type:$obj.data("objecttype"),cmb2_ajax_nonce:l10n.ajax_nonce},success:function(response){cmb.log(response),cmb.spinner($context,!0),$embed_wrap.html(response.data)}})},500)}},cmb.metabox=function(){return cmb.$metabox?cmb.$metabox:(cmb.$metabox=$(".cmb2-wrap > .cmb2-metabox"),cmb.$metabox)},cmb.spinner=function($context,hide){var m=hide?"removeClass":"addClass";$(".cmb-spinner",$context)[m]("is-active")},cmb.trigger=function(evtName){var args=Array.prototype.slice.call(arguments,1);args.push(cmb),$document.trigger(evtName,args)},cmb.triggerElement=function($el,evtName){var args=Array.prototype.slice.call(arguments,2);args.push(cmb),$el.trigger(evtName,args)},cmb.getFieldArg=function(hash,arg){return cmb.getField(hash)[arg]},cmb.getFields=function(filterCb){if("function"==typeof filterCb){var fields=[];return $.each(l10n.fields,function(hash,field){filterCb(field,hash)&&fields.push(field)}),fields}return l10n.fields},cmb.getField=function(hash){var field={};if(hash=hash instanceof jQuery?hash.data("hash"):hash)try{if(l10n.fields[hash])throw new Error(hash);cmb.getFields(function(field){if("function"==typeof hash){if(hash(field))throw new Error(field.hash)}else if(field.id&&field.id===hash)throw new Error(field.hash)})}catch(e){field=l10n.fields[e.message]}return field},cmb.log=function(){l10n.script_debug&&console&&"function"==typeof console.log&&console.log.apply(console,arguments)},cmb.replaceLast=function(string,search,replace){var n=string.lastIndexOf(search);return string.slice(0,n)+string.slice(n).replace(search,replace)},$(cmb.init)}(window,document,jQuery,window.CMB2),window.CMB2=window.CMB2||{},window.CMB2.wysiwyg=window.CMB2.wysiwyg||{},function(window,document,$,cmb,wysiwyg,undefined){"use strict";function delayedInit(){0===toBeDestroyed.length?toBeInitialized.forEach(function(toInit){toBeInitialized.splice(toBeInitialized.indexOf(toInit),1),wysiwyg.init.apply(wysiwyg,toInit)}):window.setTimeout(delayedInit,100)}function delayedDestroy(){toBeDestroyed.forEach(function(id){toBeDestroyed.splice(toBeDestroyed.indexOf(id),1),wysiwyg.destroy(id)})}function getGroupData(data){var groupid=data.groupid,fieldid=data.fieldid;return all[groupid]&&all[groupid][fieldid]||(all[groupid]=all[groupid]||{},all[groupid][fieldid]={template:wp.template("cmb2-wysiwyg-"+groupid+"-"+fieldid),defaults:{mce:$.extend({},tinyMCEPreInit.mceInit["cmb2_i_"+groupid+fieldid]),qt:$.extend({},tinyMCEPreInit.qtInit["cmb2_i_"+groupid+fieldid])}},delete tinyMCEPreInit.mceInit["cmb2_i_"+groupid+fieldid],delete tinyMCEPreInit.qtInit["cmb2_i_"+groupid+fieldid]),all[groupid][fieldid]}function initOptions(options){var prop,newSettings,newQTS,nameRegex=new RegExp("cmb2_n_"+options.groupid+options.fieldid,"g"),idRegex=new RegExp("cmb2_i_"+options.groupid+options.fieldid,"g");if(void 0===tinyMCEPreInit.mceInit[options.id]){newSettings=$.extend({},options.defaults.mce);for(prop in newSettings)"string"==typeof newSettings[prop]&&(newSettings[prop]=newSettings[prop].replace(idRegex,options.id).replace(nameRegex,options.name));tinyMCEPreInit.mceInit[options.id]=newSettings}if(void 0===tinyMCEPreInit.qtInit[options.id]){newQTS=$.extend({},options.defaults.qt);for(prop in newQTS)"string"==typeof newQTS[prop]&&(newQTS[prop]=newQTS[prop].replace(idRegex,options.id).replace(nameRegex,options.name));tinyMCEPreInit.qtInit[options.id]=newQTS}}var toBeDestroyed=[],toBeInitialized=[],all=wysiwyg.all={};wysiwyg.initAll=function(){var $this,data,initiated;$(".cmb2-wysiwyg-placeholder").each(function(){$this=$(this),data=$this.data(),data.groupid&&(data.id=$this.attr("id"),data.name=$this.attr("name"),data.value=$this.val(),wysiwyg.init($this,data,!1),initiated=!0)}),!0===initiated&&(void 0!==window.QTags&&window.QTags._buttonsInit(),$(document).on("cmb2_add_row",wysiwyg.addRow).on("cmb2_remove_group_row_start",wysiwyg.destroyRowEditors).on("cmb2_shift_rows_start",wysiwyg.shiftStart).on("cmb2_shift_rows_complete",wysiwyg.shiftComplete))},wysiwyg.addRow=function(evt,$row){wysiwyg.initRow($row,evt)},wysiwyg.destroyRowEditors=function(evt,$btn){wysiwyg.destroy($btn.parents(".cmb-repeatable-grouping").find(".wp-editor-area").attr("id"))},wysiwyg.shiftStart=function(evt,$btn,$from,$to){$from.add($to).find(".wp-editor-wrap textarea").each(function(){wysiwyg.destroy($(this).attr("id"))})},wysiwyg.shiftComplete=function(evt,$btn,$from,$to){$from.add($to).each(function(){wysiwyg.initRow($(this),evt)})},wysiwyg.initRow=function($row,evt){var $toReplace,data,defVal;$row.find(".cmb2-wysiwyg-inner-wrap").each(function(){$toReplace=$(this),data=$toReplace.data(),defVal=cmb.getFieldArg(data.hash,"default",""),defVal=void 0!==defVal&&!1!==defVal?defVal:"",data.iterator=$row.data("iterator"),data.fieldid=data.id,data.id=data.groupid+"_"+data.iterator+"_"+data.fieldid,data.name=data.groupid+"["+data.iterator+"]["+data.fieldid+"]",data.value="cmb2_add_row"!==evt.type&&$toReplace.find(".wp-editor-area").length?$toReplace.find(".wp-editor-area").val():defVal,0===toBeDestroyed.length?wysiwyg.init($toReplace,data):(toBeInitialized.push([$toReplace,data]),window.setTimeout(delayedInit,100))})},wysiwyg.init=function($toReplace,data,buttonsInit){if(!data.groupid)return!1;var mceActive=cmb.canTinyMCE(),qtActive="function"==typeof window.quicktags;$.extend(data,getGroupData(data)),initOptions(data),$toReplace.repl