Shortcodes by Angie Makes - Version 1.58

Version Description

Download this release

Release Info

Developer cbaldelomar
Plugin Icon wp plugin Shortcodes by Angie Makes
Version 1.58
Comparing to
See all releases

Code changes from version 1.57 to 1.58

Files changed (45) hide show
  1. README.md +11 -1
  2. includes/css/admin.css +0 -207
  3. includes/functions.php +8 -34
  4. includes/img/print.png +0 -0
  5. includes/mce/js/shortcodes-tinymce-4.js +5 -5
  6. includes/mce/js/shortcodes_tinymce.js +1 -1
  7. includes/options.php +299 -658
  8. includes/settings.php +0 -645
  9. includes/shortcode-functions.php +25 -3
  10. includes/templates/box/entry-meta.php +1 -1
  11. includes/vendors/wpc-settings-framework/class-wpc-settings-framework-sanitize.php +626 -0
  12. includes/vendors/wpc-settings-framework/class-wpc-settings-framework.php +526 -0
  13. includes/vendors/wpc-settings-framework/css/index.php +1 -0
  14. includes/vendors/wpc-settings-framework/css/media-uploader.css +18 -0
  15. includes/vendors/wpc-settings-framework/css/options.css +151 -0
  16. includes/vendors/wpc-settings-framework/img/index.php +1 -0
  17. includes/vendors/wpc-settings-framework/init.php +13 -0
  18. includes/vendors/wpc-settings-framework/js/index.php +1 -0
  19. includes/{js/admin.js → vendors/wpc-settings-framework/js/media-uploader.js} +19 -15
  20. includes/vendors/wpc-settings-framework/js/options.js +46 -0
  21. includes/vendors/wpc-settings-framework/views/group.php +11 -0
  22. includes/vendors/wpc-settings-framework/views/index.php +1 -0
  23. includes/vendors/wpc-settings-framework/views/page.php +30 -0
  24. includes/vendors/wpc-settings-framework/views/settings-error.php +10 -0
  25. includes/vendors/wpc-settings-framework/views/settings/background-options.php +56 -0
  26. includes/vendors/wpc-settings-framework/views/settings/border-fields.php +28 -0
  27. includes/vendors/wpc-settings-framework/views/settings/checkbox-field.php +13 -0
  28. includes/vendors/wpc-settings-framework/views/settings/color-field.php +10 -0
  29. includes/vendors/wpc-settings-framework/views/settings/custom-checkboxes.php +18 -0
  30. includes/vendors/wpc-settings-framework/views/settings/custom-dropdown.php +19 -0
  31. includes/vendors/wpc-settings-framework/views/settings/custom-radio.php +15 -0
  32. includes/vendors/wpc-settings-framework/views/settings/decimal-input-field.php +13 -0
  33. includes/vendors/wpc-settings-framework/views/settings/gallery-fields.php +22 -0
  34. includes/vendors/wpc-settings-framework/views/settings/image-field.php +23 -0
  35. includes/vendors/wpc-settings-framework/views/settings/input-field.php +10 -0
  36. includes/vendors/wpc-settings-framework/views/settings/number-input-field.php +13 -0
  37. includes/vendors/wpc-settings-framework/views/settings/order-show-hide.php +35 -0
  38. includes/vendors/wpc-settings-framework/views/settings/pixel-input-field.php +13 -0
  39. includes/vendors/wpc-settings-framework/views/settings/positive-pixel-input-field.php +13 -0
  40. includes/vendors/wpc-settings-framework/views/settings/textarea-field.php +8 -0
  41. includes/vendors/wpc-settings-framework/views/settings/wp-editor.php +11 -0
  42. includes/vendors/wpc-settings-framework/views/tabs.php +85 -0
  43. includes/widgets.php +2 -2
  44. readme.txt +11 -1
  45. wc-shortcodes.php +8 -3
README.md CHANGED
@@ -56,7 +56,7 @@ Thank you so much for even considering supporting my work. If you have benefited
56
  1. Uzip the `wc-shortcodes.zip` folder.
57
  2. Upload the `wc-shortcodes` folder to your `/wp-content/plugins` directory.
58
  3. In your WordPress dashboard, head over to the *Plugins* section.
59
- 4. Activate *WordPress Canvas Shortcodes*.
60
 
61
  ## Frequently Asked Questions ##
62
 
@@ -66,6 +66,16 @@ Use the shortcode manager in the TinyMCE text editor
66
 
67
  ## Changelog ##
68
 
 
 
 
 
 
 
 
 
 
 
69
  ### Version 1.57
70
 
71
  * Fixed overflow style bug with wc_posts
56
  1. Uzip the `wc-shortcodes.zip` folder.
57
  2. Upload the `wc-shortcodes` folder to your `/wp-content/plugins` directory.
58
  3. In your WordPress dashboard, head over to the *Plugins* section.
59
+ 4. Activate *WP Canvas - Shortcodes*.
60
 
61
  ## Frequently Asked Questions ##
62
 
66
 
67
  ## Changelog ##
68
 
69
+ ### Version 1.58
70
+
71
+ * Added date_format attribute to posts shortcode
72
+ * Added alt text to social icon images thus fixing validation errors
73
+ * adding settings link in plugin list page
74
+ * Added Print Share Button Option
75
+ * New options framework library
76
+ * Changed name of social media image icon widget
77
+ * Code cleanup
78
+
79
  ### Version 1.57
80
 
81
  * Fixed overflow style bug with wc_posts
includes/css/admin.css DELETED
@@ -1,207 +0,0 @@
1
- /**
2
- * CSS Hacks
3
- *
4
- * Needed common CSS trick
5
- */
6
-
7
- .wc-shortcodes-clearfix:after {
8
- visibility: hidden;
9
- display: block;
10
- font-size: 0;
11
- content: " ";
12
- clear: both;
13
- height: 0;
14
- }
15
-
16
- .wc-shortcodes-clearfix { display: inline-block; }
17
-
18
- * html .wc-shortcodes-clearfix {
19
- height: 1%;
20
- }
21
-
22
- .wc-shortcodes-clearfix { display: block; }
23
-
24
-
25
- /**
26
- * Google Fonts
27
- *
28
- * Styles for Fonts subpage in Wordpress dashboard
29
- */
30
-
31
- .wc-shortcodes-font-table {
32
- height: 300px;
33
- width: 450px;
34
- overflow-y: scroll;
35
- overflow-x: hidden;
36
- border: 1px solid #e5e5e5;
37
- }
38
-
39
- .wc-shortcodes-font-row {
40
- clear: both;
41
- }
42
-
43
- .wc-shortcodes-font-row:nth-child(even) {
44
- background-color: #e5e5e5;
45
- }
46
-
47
- .wc-shortcodes-font-title {
48
- width: 200px;
49
- float: left;
50
- padding-right: 10px;
51
- text-align: right;
52
- white-space: nowrap;
53
- }
54
-
55
- .wc-shortcodes-font-variants {
56
- width: 200px;
57
- float: left;
58
- }
59
-
60
- #wc-shortcodes-font-preview {
61
- font-size: 28px;
62
- line-height: 1.5;
63
- }
64
-
65
- .wc-shortcodes-font-preview-text {
66
- margin-right: 10px;
67
- }
68
-
69
- .wc-shortcodes-font-row-remove {
70
- vertical-align: middle;
71
- }
72
-
73
- .wc-shortcodes-font-preview-row {
74
- margin-bottom: 15px;
75
- }
76
-
77
-
78
- /**
79
- * Less Variables
80
- */
81
-
82
- .wc-shortcodes-variables-preview {
83
- margin-right: 190px;
84
- }
85
-
86
- .wc-shortcodes-variables-table {
87
- border: 1px solid #e5e5e5;
88
- width: 97%;
89
- }
90
-
91
- .wc-shortcodes-variables-table tr:nth-child(even) {
92
- background-color: #e5e5e5;
93
- }
94
-
95
- .wc-shortcodes-variables-table td {
96
- padding: 3px;
97
- }
98
-
99
-
100
- /**
101
- * Border Fields
102
- */
103
-
104
- .wc-shortcodes-font-hover-fields .wc-shortcodes-text-decoration,
105
- .wc-shortcodes-border-fields .wc-shortcodes-border-style,
106
- .wc-shortcodes-border-fields .wp-border-width,
107
- .wc-shortcodes-border-fields .wp-picker-container {
108
- margin-bottom: 7px;
109
- }
110
-
111
-
112
- /**
113
- * Font Fields
114
- */
115
-
116
- .wc-shortcodes-font-fields .wc-shortcodes-font-teaser,
117
- .wc-shortcodes-font-fields .wp-picker-container,
118
- .wc-shortcodes-font-fields select,
119
- .wc-shortcodes-font-fields input {
120
- margin-bottom: 7px;
121
- }
122
-
123
- .wc-shortcodes-font-teaser {
124
- display: block;
125
- line-height: 1.5;
126
- }
127
-
128
- .wc-shortcodes-font-appearance-fields select,
129
- .wc-shortcodes-font-appearance-fields .wp-picker-container {
130
- margin-bottom: 7px;
131
- }
132
-
133
-
134
- /**
135
- * Media Gallery
136
- *
137
- * Styles for media gallery
138
- */
139
-
140
- .wp-media-buttons-icon {
141
- background: url('../../../../../../../wp-admin/images/media-button.png') no-repeat top left;
142
- display: inline-block;
143
- width: 16px;
144
- height: 16px;
145
- vertical-align: text-top;
146
- margin: 0 2px;
147
- }
148
-
149
- .wc-shortcodes-preview-image img {
150
- max-width: 700px;
151
- max-height: 200px;
152
- background: #FAFAFA;
153
- border-color: #ccc #eee #eee #ccc;
154
- border-style: solid;
155
- border-width: 1px;
156
- padding: 5px;
157
- }
158
-
159
- .widget .wc-shortcodes-preview-image img {
160
- padding: 0;
161
- border-width: 0;
162
- max-width: 100%;
163
- }
164
-
165
- .wc-shortcodes-preview-image {
166
- margin-bottom: 5px;
167
- }
168
-
169
- .wc-shortcodes-upload-font-textarea {
170
- max-width: 900px;
171
- height: 210px;
172
- width: 97%;
173
- }
174
-
175
- .wc-shortcodes-social-media-field .button,
176
- .wc-shortcodes-social-media-field input,
177
- .wc-shortcodes-image-field .button,
178
- .wc-shortcodes-image-field input,
179
- .wc-shortcodes-background-options .button,
180
- .wc-shortcodes-background-options select,
181
- .wc-shortcodes-background-options input {
182
- margin-bottom: 7px;
183
- }
184
-
185
-
186
- /**
187
- * Theme Options Display
188
- *
189
- * Specific style for theme options pages
190
- */
191
-
192
- .wc-shortcodes-theme-options-display .form-table tr:nth-child(odd) {
193
- background-color: #f2f2f2;
194
- }
195
-
196
- .wc-shortcodes-textarea {
197
- max-width: 900px;
198
- height: 150px;
199
- width: 97%;
200
- }
201
-
202
- .wc-shortcodes-ajax-submit-button #submit {
203
- outline: 0;
204
- }
205
- .wc-shortcodes-ajax-submit-button #compile-status {
206
- margin-left: 5px;
207
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/functions.php CHANGED
@@ -14,41 +14,15 @@ function wc_shortcodes_check_supports() {
14
  }
15
  add_action( 'init', 'wc_shortcodes_check_supports' );
16
 
17
- /*
18
- * On New Version
19
- */
20
- function wc_shortcodes_options_activation() {
21
- global $wc_shortcodes_options;
22
-
23
- $initialize = false;
24
-
25
- if ( ! WC_SHORTCODES_CURRENT_VERSION ) {
26
- $initialize = true;
27
- }
28
- else if ( version_compare( WC_SHORTCODES_VERSION, WC_SHORTCODES_CURRENT_VERSION ) > 0 ) {
29
- $initialize = true;
30
- }
31
-
32
- if ( $initialize ) {
33
- update_option( WC_SHORTCODES_PREFIX . 'current_version', WC_SHORTCODES_VERSION );
34
-
35
- foreach ( $wc_shortcodes_options as $o ) {
36
- foreach ( $o['sections'] as $oo ) {
37
- foreach ( $oo['options'] as $ooo ) {
38
- $option_name = WC_SHORTCODES_PREFIX . $ooo['id'];
39
- if ( WC_SHORTCODES_PREFIX . 'social_icons_display' == $option_name ) {
40
- $default = wc_shortcodes_default_social_icons();
41
- add_option( $option_name, $default );
42
- }
43
- else {
44
- add_option( $option_name, $ooo['default'] );
45
- }
46
- }
47
- }
48
- }
49
- }
50
  }
51
- add_action( 'init', 'wc_shortcodes_options_activation', 200 );
52
 
53
  /**
54
  * filter social url. For example, we want to add
14
  }
15
  add_action( 'init', 'wc_shortcodes_check_supports' );
16
 
17
+ function wc_shortcodes_add_action_links( $links ) {
18
+ return array_merge(
19
+ array(
20
+ 'settings' => '<a href="' . admin_url( 'themes.php?page=wc-shortcodes' ) . '">' . __( 'Settings', 'wc-shortcodes' ) . '</a>'
21
+ ),
22
+ $links
23
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
25
+ add_filter( 'plugin_action_links_' . WC_SHORTCODES_PLUGIN_BASENAME, 'wc_shortcodes_add_action_links' );
26
 
27
  /**
28
  * filter social url. For example, we want to add
includes/img/print.png ADDED
Binary file
includes/mce/js/shortcodes-tinymce-4.js CHANGED
@@ -121,7 +121,7 @@
121
  {
122
  text: "Testimonial",
123
  onclick: function(){
124
- editor.insertContent('[wc_testimonial by="Wordpress Canvas" url="" position="left"]' + wcDummyContent + '[/wc_testimonial]');
125
  }
126
  },
127
  {
@@ -158,25 +158,25 @@
158
  {
159
  text: "Masonry - Box",
160
  onclick: function(){
161
- editor.insertContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="large" filtering="yes" columns="3" gutter_space="20" heading_type="h2" layout="masonry" template="box" excerpt_length="30"][/wc_posts]');
162
  }
163
  },
164
  {
165
  text: "Masonry - Borderless",
166
  onclick: function(){
167
- editor.insertContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="large" filtering="yes" columns="3" gutter_space="40" heading_type="h2" layout="masonry" template="borderless" excerpt_length="30"][/wc_posts]');
168
  }
169
  },
170
  {
171
  text: "Grid - Box",
172
  onclick: function(){
173
- editor.insertContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="wccarousel" filtering="yes" columns="3" gutter_space="20" heading_type="h2" layout="grid" template="box" excerpt_length="15"][/wc_posts]');
174
  }
175
  },
176
  {
177
  text: "Grid - Borderless",
178
  onclick: function(){
179
- editor.insertContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="wccarousel" filtering="yes" columns="3" gutter_space="40" heading_type="h2" layout="grid" template="borderless" excerpt_length="15"][/wc_posts]');
180
  }
181
  }
182
  ]
121
  {
122
  text: "Testimonial",
123
  onclick: function(){
124
+ editor.insertContent('[wc_testimonial by="Author" url="" position="left"]' + wcDummyContent + '[/wc_testimonial]');
125
  }
126
  },
127
  {
158
  {
159
  text: "Masonry - Box",
160
  onclick: function(){
161
+ editor.insertContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" date_format="M j, Y" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="large" filtering="yes" columns="3" gutter_space="20" heading_type="h2" layout="masonry" template="box" excerpt_length="30"][/wc_posts]');
162
  }
163
  },
164
  {
165
  text: "Masonry - Borderless",
166
  onclick: function(){
167
+ editor.insertContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" date_format="M j, Y" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="large" filtering="yes" columns="3" gutter_space="40" heading_type="h2" layout="masonry" template="borderless" excerpt_length="30"][/wc_posts]');
168
  }
169
  },
170
  {
171
  text: "Grid - Box",
172
  onclick: function(){
173
+ editor.insertContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" date_format="M j, Y" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="wccarousel" filtering="yes" columns="3" gutter_space="20" heading_type="h2" layout="grid" template="box" excerpt_length="15"][/wc_posts]');
174
  }
175
  },
176
  {
177
  text: "Grid - Borderless",
178
  onclick: function(){
179
+ editor.insertContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" date_format="M j, Y" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="wccarousel" filtering="yes" columns="3" gutter_space="40" heading_type="h2" layout="grid" template="borderless" excerpt_length="15"][/wc_posts]');
180
  }
181
  }
182
  ]
includes/mce/js/shortcodes_tinymce.js CHANGED
@@ -347,7 +347,7 @@
347
 
348
  //Testimonial
349
  if(id === "testimonial") {
350
- tinyMCE.activeEditor.selection.setContent('[wc_testimonial by="Wordpress Canvas" url="" position="left"]' + wcDummyContent + '[/wc_testimonial]');
351
  }
352
 
353
 
347
 
348
  //Testimonial
349
  if(id === "testimonial") {
350
+ tinyMCE.activeEditor.selection.setContent('[wc_testimonial by="Author" url="" position="left"]' + wcDummyContent + '[/wc_testimonial]');
351
  }
352
 
353
 
includes/options.php CHANGED
@@ -1,711 +1,352 @@
1
  <?php
2
- function wc_shortcodes_set_options() {
3
  global $wc_shortcodes_share_buttons;
4
  global $wc_shortcodes_social_icons;
5
- global $wc_shortcodes_options;
6
  global $wc_shortcodes_theme_support;
7
 
8
- $wc_shortcodes_options['social-media'] = array(
9
- 'title' => 'Social Media',
10
- 'sections' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  array(
12
- 'section' => 'wc-shortcodes-options-social-display-section',
13
- 'title' => 'Display',
14
- 'options' => array(
15
- array(
16
- 'id' => 'social_icons_display',
17
- 'title' => 'Order / Show / Hide',
18
- 'default' => $wc_shortcodes_social_icons,
19
- 'description' => '',
20
- 'type' => 'social_icons',
21
- ),
22
  array(
23
- 'id' => 'social_icons_format',
24
- 'title' => 'Format',
25
- 'default' => $wc_shortcodes_theme_support['social_icons_format'],
26
- 'description' => '',
27
- 'type' => 'dropdown',
28
  'options' => array(
29
- 'icon' => 'Icon',
30
- 'image' => 'Image',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  ),
32
  ),
33
- ),
34
- ),
35
- array(
36
- 'section' => 'wc-shortcodes-options-facebook-section',
37
- 'title' => 'Facebook',
38
- 'options' => array(
39
- array(
40
- 'id' => 'facebook_link',
41
- 'title' => 'Link',
42
- 'default' => '',
43
- 'description' => '',
44
- 'type' => 'input',
45
- ),
46
- array(
47
- 'id' => 'facebook_font_icon',
48
- 'title' => 'Font Icon',
49
- 'default' => $wc_shortcodes_theme_support['facebook_font_icon'],
50
- 'description' => '',
51
- 'type' => 'input',
52
- ),
53
- array(
54
- 'id' => 'facebook_icon',
55
- 'title' => 'Image Icon',
56
- 'default' => $wc_shortcodes_theme_support['facebook_social_icon'],
57
- 'description' => '',
58
- 'type' => 'image',
59
- ),
60
- ),
61
- ),
62
- array(
63
- 'section' => 'wc-shortcodes-options-twitter-section',
64
- 'title' => 'Twitter',
65
- 'options' => array(
66
- array(
67
- 'id' => 'twitter_link',
68
- 'title' => 'Link',
69
- 'default' => '',
70
- 'description' => '',
71
- 'type' => 'input',
72
- ),
73
- array(
74
- 'id' => 'twitter_font_icon',
75
- 'title' => 'Font Icon',
76
- 'default' => $wc_shortcodes_theme_support['twitter_font_icon'],
77
- 'description' => '',
78
- 'type' => 'input',
79
- ),
80
- array(
81
- 'id' => 'twitter_icon',
82
- 'title' => 'Image Icon',
83
- 'default' => $wc_shortcodes_theme_support['twitter_social_icon'],
84
- 'description' => '',
85
- 'type' => 'image',
86
- ),
87
- ),
88
- ),
89
- array(
90
- 'section' => 'wc-shortcodes-options-pinterest-section',
91
- 'title' => 'Pinterest',
92
- 'options' => array(
93
- array(
94
- 'id' => 'pinterest_link',
95
- 'title' => 'Link',
96
- 'default' => '',
97
- 'description' => '',
98
- 'type' => 'input',
99
- ),
100
- array(
101
- 'id' => 'pinterest_font_icon',
102
- 'title' => 'Font Icon',
103
- 'default' => $wc_shortcodes_theme_support['pinterest_font_icon'],
104
- 'description' => '',
105
- 'type' => 'input',
106
- ),
107
- array(
108
- 'id' => 'pinterest_icon',
109
- 'title' => 'Image Icon',
110
- 'default' => $wc_shortcodes_theme_support['pinterest_social_icon'],
111
- 'description' => '',
112
- 'type' => 'image',
113
- ),
114
- ),
115
- ),
116
- array(
117
- 'section' => 'wc-shortcodes-options-google-section',
118
- 'title' => 'Google',
119
- 'options' => array(
120
- array(
121
- 'id' => 'google_link',
122
- 'title' => 'Link',
123
- 'default' => '',
124
- 'description' => '',
125
- 'type' => 'input',
126
- ),
127
- array(
128
- 'id' => 'google_font_icon',
129
- 'title' => 'Font Icon',
130
- 'default' => $wc_shortcodes_theme_support['google_font_icon'],
131
- 'description' => '',
132
- 'type' => 'input',
133
- ),
134
- array(
135
- 'id' => 'google_icon',
136
- 'title' => 'Image Icon',
137
- 'default' => $wc_shortcodes_theme_support['google_social_icon'],
138
- 'description' => '',
139
- 'type' => 'image',
140
- ),
141
- ),
142
- ),
143
- array(
144
- 'section' => 'wc-shortcodes-options-bloglovin-section',
145
- 'title' => 'BlogLovin',
146
- 'options' => array(
147
- array(
148
- 'id' => 'bloglovin_link',
149
- 'title' => 'Link',
150
- 'default' => '',
151
- 'description' => '',
152
- 'type' => 'input',
153
- ),
154
- array(
155
- 'id' => 'bloglovin_font_icon',
156
- 'title' => 'Font Icon',
157
- 'default' => $wc_shortcodes_theme_support['bloglovin_font_icon'],
158
- 'description' => '',
159
- 'type' => 'input',
160
- ),
161
- array(
162
- 'id' => 'bloglovin_icon',
163
- 'title' => 'Image Icon',
164
- 'default' => $wc_shortcodes_theme_support['bloglovin_social_icon'],
165
- 'description' => '',
166
- 'type' => 'image',
167
- ),
168
- ),
169
- ),
170
- array(
171
- 'section' => 'wc-shortcodes-options-email-section',
172
- 'title' => 'Email',
173
- 'options' => array(
174
- array(
175
- 'id' => 'email_link',
176
- 'title' => 'Link',
177
- 'default' => '',
178
- 'description' => '',
179
- 'type' => 'input',
180
- ),
181
- array(
182
- 'id' => 'email_font_icon',
183
- 'title' => 'Font Icon',
184
- 'default' => $wc_shortcodes_theme_support['email_font_icon'],
185
- 'description' => '',
186
- 'type' => 'input',
187
- ),
188
- array(
189
- 'id' => 'email_icon',
190
- 'title' => 'Image Icon',
191
- 'default' => $wc_shortcodes_theme_support['email_social_icon'],
192
- 'description' => '',
193
- 'type' => 'image',
194
- ),
195
- ),
196
- ),
197
- array(
198
- 'section' => 'wc-shortcodes-options-flickr-section',
199
- 'title' => 'Flickr',
200
- 'options' => array(
201
- array(
202
- 'id' => 'flickr_link',
203
- 'title' => 'Link',
204
- 'default' => '',
205
- 'description' => '',
206
- 'type' => 'input',
207
- ),
208
- array(
209
- 'id' => 'flickr_font_icon',
210
- 'title' => 'Font Icon',
211
- 'default' => $wc_shortcodes_theme_support['flickr_font_icon'],
212
- 'description' => '',
213
- 'type' => 'input',
214
- ),
215
- array(
216
- 'id' => 'flickr_icon',
217
- 'title' => 'Image Icon',
218
- 'default' => $wc_shortcodes_theme_support['flickr_social_icon'],
219
- 'description' => '',
220
- 'type' => 'image',
221
- ),
222
- ),
223
- ),
224
- array(
225
- 'section' => 'wc-shortcodes-options-instagram-section',
226
- 'title' => 'Instagram',
227
- 'options' => array(
228
- array(
229
- 'id' => 'instagram_link',
230
- 'title' => 'Link',
231
- 'default' => '',
232
- 'description' => '',
233
- 'type' => 'input',
234
- ),
235
- array(
236
- 'id' => 'instagram_font_icon',
237
- 'title' => 'Font Icon',
238
- 'default' => $wc_shortcodes_theme_support['instagram_font_icon'],
239
- 'description' => '',
240
- 'type' => 'input',
241
- ),
242
- array(
243
- 'id' => 'instagram_icon',
244
- 'title' => 'Image Icon',
245
- 'default' => $wc_shortcodes_theme_support['instagram_social_icon'],
246
- 'description' => '',
247
- 'type' => 'image',
248
- ),
249
- ),
250
- ),
251
- array(
252
- 'section' => 'wc-shortcodes-options-rss-section',
253
- 'title' => 'Rss',
254
- 'options' => array(
255
- array(
256
- 'id' => 'rss_link',
257
- 'title' => 'Link',
258
- 'default' => '',
259
- 'description' => '',
260
- 'type' => 'input',
261
- ),
262
- array(
263
- 'id' => 'rss_font_icon',
264
- 'title' => 'Font Icon',
265
- 'default' => $wc_shortcodes_theme_support['rss_font_icon'],
266
- 'description' => '',
267
- 'type' => 'input',
268
- ),
269
- array(
270
- 'id' => 'rss_icon',
271
- 'title' => 'Image Icon',
272
- 'default' => $wc_shortcodes_theme_support['rss_social_icon'],
273
- 'description' => '',
274
- 'type' => 'image',
275
- ),
276
- ),
277
- ),
278
- array(
279
- 'section' => 'wc-shortcodes-options-custom1-section',
280
- 'title' => 'Custom 1',
281
- 'options' => array(
282
- array(
283
- 'id' => 'custom1_link',
284
- 'title' => 'Link',
285
- 'default' => '',
286
- 'description' => '',
287
- 'type' => 'input',
288
- ),
289
- array(
290
- 'id' => 'custom1_font_icon',
291
- 'title' => 'Font Icon',
292
- 'default' => $wc_shortcodes_theme_support['custom1_font_icon'],
293
- 'description' => '',
294
- 'type' => 'input',
295
- ),
296
- array(
297
- 'id' => 'custom1_icon',
298
- 'title' => 'Image Icon',
299
- 'default' => $wc_shortcodes_theme_support['custom1_social_icon'],
300
- 'description' => '',
301
- 'type' => 'image',
302
- ),
303
- ),
304
- ),
305
- array(
306
- 'section' => 'wc-shortcodes-options-custom2-section',
307
- 'title' => 'Custom 2',
308
- 'options' => array(
309
- array(
310
- 'id' => 'custom2_link',
311
- 'title' => 'Link',
312
- 'default' => '',
313
- 'description' => '',
314
- 'type' => 'input',
315
- ),
316
- array(
317
- 'id' => 'custom2_font_icon',
318
- 'title' => 'Font Icon',
319
- 'default' => $wc_shortcodes_theme_support['custom2_font_icon'],
320
- 'description' => '',
321
- 'type' => 'input',
322
- ),
323
- array(
324
- 'id' => 'custom2_icon',
325
- 'title' => 'Image Icon',
326
- 'default' => $wc_shortcodes_theme_support['custom2_social_icon'],
327
- 'description' => '',
328
- 'type' => 'image',
329
- ),
330
- ),
331
- ),
332
- array(
333
- 'section' => 'wc-shortcodes-options-custom3-section',
334
- 'title' => 'Custom 3',
335
- 'options' => array(
336
- array(
337
- 'id' => 'custom3_link',
338
- 'title' => 'Link',
339
- 'default' => '',
340
- 'description' => '',
341
- 'type' => 'input',
342
- ),
343
- array(
344
- 'id' => 'custom3_font_icon',
345
- 'title' => 'Font Icon',
346
- 'default' => $wc_shortcodes_theme_support['custom3_font_icon'],
347
- 'description' => '',
348
- 'type' => 'input',
349
- ),
350
- array(
351
- 'id' => 'custom3_icon',
352
- 'title' => 'Image Icon',
353
- 'default' => $wc_shortcodes_theme_support['custom3_social_icon'],
354
- 'description' => '',
355
- 'type' => 'image',
356
- ),
357
- ),
358
- ),
359
- array(
360
- 'section' => 'wc-shortcodes-options-custom4-section',
361
- 'title' => 'Custom 4',
362
- 'options' => array(
363
- array(
364
- 'id' => 'custom4_link',
365
- 'title' => 'Link',
366
- 'default' => '',
367
- 'description' => '',
368
- 'type' => 'input',
369
- ),
370
  array(
371
- 'id' => 'custom4_font_icon',
372
- 'title' => 'Font Icon',
373
- 'default' => $wc_shortcodes_theme_support['custom4_font_icon'],
374
- 'description' => '',
375
- 'type' => 'input',
376
- ),
377
- array(
378
- 'id' => 'custom4_icon',
379
- 'title' => 'Image Icon',
380
- 'default' => $wc_shortcodes_theme_support['custom4_social_icon'],
381
- 'description' => '',
382
- 'type' => 'image',
383
  ),
384
  ),
385
  ),
386
  array(
387
- 'section' => 'wc-shortcodes-options-custom5-section',
388
- 'title' => 'Custom 5',
389
- 'options' => array(
390
- array(
391
- 'id' => 'custom5_link',
392
- 'title' => 'Link',
393
- 'default' => '',
394
- 'description' => '',
395
- 'type' => 'input',
396
- ),
397
- array(
398
- 'id' => 'custom5_font_icon',
399
- 'title' => 'Font Icon',
400
- 'default' => $wc_shortcodes_theme_support['custom5_font_icon'],
401
- 'description' => '',
402
- 'type' => 'input',
403
- ),
404
- array(
405
- 'id' => 'custom5_icon',
406
- 'title' => 'Image Icon',
407
- 'default' => $wc_shortcodes_theme_support['custom5_social_icon'],
408
- 'description' => '',
409
- 'type' => 'image',
410
- ),
411
- ),
412
- ),
413
- ),
414
- );
415
- $wc_shortcodes_options['share-buttons'] = array(
416
- 'title' => 'Share Buttons',
417
- 'sections' => array(
418
- array(
419
- 'section' => 'wc-shortcodes-options-share-display-section',
420
- 'title' => 'Display',
421
- 'options' => array(
422
- array(
423
- 'id' => 'share_buttons_display',
424
- 'title' => 'Order / Show / Hide',
425
- 'default' => $wc_shortcodes_share_buttons,
426
- 'description' => '',
427
- 'type' => 'share_buttons',
428
- ),
429
  array(
430
- 'id' => 'share_buttons_format',
431
- 'title' => 'Format',
432
- 'default' => $wc_shortcodes_theme_support['share_buttons_format'],
433
- 'description' => '',
434
- 'type' => 'dropdown',
435
  'options' => array(
436
- 'icon' => 'Icon',
437
- 'image' => 'Image',
438
- 'icon-text' => 'Icon + Text',
439
- 'text' => 'Text',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  ),
441
  ),
442
- ),
443
- ),
444
- array(
445
- 'section' => 'wc-shortcodes-options-facebook-share-section',
446
- 'title' => 'Facebook',
447
- 'options' => array(
448
- array(
449
- 'id' => 'facebook_share_text',
450
- 'title' => 'Share Text',
451
- 'default' => $wc_shortcodes_theme_support['facebook_share_text'],
452
- 'description' => '',
453
- 'type' => 'input',
454
- ),
455
- array(
456
- 'id' => 'facebook_share_font_icon',
457
- 'title' => 'Font Icon',
458
- 'default' => $wc_shortcodes_theme_support['facebook_share_font_icon'],
459
- 'description' => '',
460
- 'type' => 'input',
461
- ),
462
- array(
463
- 'id' => 'facebook_share_icon',
464
- 'title' => 'Image Icon',
465
- 'default' => $wc_shortcodes_theme_support['facebook_share_button'],
466
- 'description' => '',
467
- 'type' => 'image',
468
- ),
469
- ),
470
- ),
471
- array(
472
- 'section' => 'wc-shortcodes-options-twitter-share-section',
473
- 'title' => 'Twitter',
474
- 'options' => array(
475
- array(
476
- 'id' => 'twitter_share_text',
477
- 'title' => 'Share Text',
478
- 'default' => $wc_shortcodes_theme_support['twitter_share_text'],
479
- 'description' => '',
480
- 'type' => 'input',
481
- ),
482
- array(
483
- 'id' => 'twitter_share_font_icon',
484
- 'title' => 'Font Icon',
485
- 'default' => $wc_shortcodes_theme_support['twitter_share_font_icon'],
486
- 'description' => '',
487
- 'type' => 'input',
488
- ),
489
  array(
490
- 'id' => 'twitter_share_icon',
491
- 'title' => 'Image Icon',
492
- 'default' => $wc_shortcodes_theme_support['twitter_share_button'],
493
- 'description' => '',
494
- 'type' => 'image',
495
  ),
496
  ),
497
  ),
498
  array(
499
- 'section' => 'wc-shortcodes-options-pinterest-share-section',
500
- 'title' => 'Pinterest',
501
- 'options' => array(
502
  array(
503
- 'id' => 'pinterest_share_text',
504
- 'title' => 'Share Text',
505
- 'default' => $wc_shortcodes_theme_support['pinterest_share_text'],
506
- 'description' => '',
507
- 'type' => 'input',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
508
  ),
509
  array(
510
- 'id' => 'pinterest_share_font_icon',
511
- 'title' => 'Font Icon',
512
- 'default' => $wc_shortcodes_theme_support['pinterest_share_font_icon'],
513
- 'description' => '',
514
- 'type' => 'input',
 
 
 
 
 
 
 
515
  ),
516
  array(
517
- 'id' => 'pinterest_share_icon',
518
- 'title' => 'Image Icon',
519
- 'default' => $wc_shortcodes_theme_support['pinterest_share_button'],
520
- 'description' => '',
521
- 'type' => 'image',
522
- ),
523
- ),
524
- ),
525
- array(
526
- 'section' => 'wc-shortcodes-options-google-share-section',
527
- 'title' => 'Google',
528
- 'options' => array(
529
- array(
530
- 'id' => 'google_share_text',
531
- 'title' => 'Share Text',
532
- 'default' => $wc_shortcodes_theme_support['google_share_text'],
533
- 'description' => '',
534
- 'type' => 'input',
 
535
  ),
536
  array(
537
- 'id' => 'google_share_font_icon',
538
- 'title' => 'Font Icon',
539
- 'default' => $wc_shortcodes_theme_support['google_share_font_icon'],
540
- 'description' => '',
541
- 'type' => 'input',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
542
  ),
543
  array(
544
- 'id' => 'google_share_icon',
545
- 'title' => 'Image Icon',
546
- 'default' => $wc_shortcodes_theme_support['google_share_button'],
547
- 'description' => '',
548
- 'type' => 'image',
 
 
 
 
 
 
 
549
  ),
550
  ),
551
  ),
552
  array(
553
- 'section' => 'wc-shortcodes-options-email-share-section',
554
- 'title' => 'Email',
555
- 'options' => array(
556
- array(
557
- 'id' => 'email_share_text',
558
- 'title' => 'Share Text',
559
- 'default' => $wc_shortcodes_theme_support['email_share_text'],
560
- 'description' => '',
561
- 'type' => 'input',
562
- ),
563
  array(
564
- 'id' => 'email_share_font_icon',
565
- 'title' => 'Font Icon',
566
- 'default' => $wc_shortcodes_theme_support['email_share_font_icon'],
567
- 'description' => '',
568
- 'type' => 'input',
569
- ),
570
- array(
571
- 'id' => 'email_share_icon',
572
- 'title' => 'Image Icon',
573
- 'default' => $wc_shortcodes_theme_support['email_share_button'],
574
- 'description' => '',
575
- 'type' => 'image',
 
 
 
 
 
 
 
 
 
576
  ),
577
  ),
578
  ),
579
  ),
580
  );
581
- $number_options = "1\n2\n3\n4\n5";
582
- $event_options = "All Events\nMain Ceremony\nWedding Party";
583
- $admin_email = get_option( 'admin_email' );
584
 
585
- $wc_shortcodes_options['rsvp'] = array(
586
- 'title' => 'RSVP',
587
- 'sections' => array(
588
- array(
589
- 'section' => 'wc-shortcodes-options-rsvp-section',
590
- 'title' => 'RSVP',
591
- 'options' => array(
592
- array(
593
- 'id' => 'rsvp_email',
594
- 'title' => 'Email To',
595
- 'default' => $admin_email,
596
- 'description' => 'Send RSVP notification to the email address above. Separate multiple emails with a comma.',
597
- 'type' => 'emails',
598
- ),
599
- array(
600
- 'id' => 'rsvp_email_title',
601
- 'title' => 'Email Title',
602
- 'default' => 'New RSVP - ' .get_bloginfo('title'),
603
- 'description' => 'The subject tile of your email you will receive',
604
- 'type' => 'input',
605
- ),
606
- array(
607
- 'id' => 'rsvp_success_message',
608
- 'title' => 'Success Message',
609
- 'default' => 'Thanks for attending! We will see you at our wedding.',
610
- 'description' => 'The message to display after a user successfully RSVP\'d',
611
- 'type' => 'input',
612
- ),
613
  ),
614
- ),
615
- array(
616
- 'section' => 'wc-shortcodes-options-rsvp-name-section',
617
- 'title' => 'Name',
618
- 'options' => array(
619
- array(
620
- 'id' => 'rsvp_name_title',
621
- 'title' => 'Title',
622
- 'default' => 'Your Name',
623
- 'description' => '',
624
- 'type' => 'input',
625
- ),
626
  ),
627
- ),
628
- array(
629
- 'section' => 'wc-shortcodes-options-rsvp-number-section',
630
- 'title' => 'Number',
631
- 'options' => array(
632
- array(
633
- 'id' => 'rsvp_number_title',
634
- 'title' => 'Title',
635
- 'default' => 'Number of Guests',
636
- 'description' => '',
637
- 'type' => 'input',
638
- ),
639
- array(
640
- 'id' => 'rsvp_number_options',
641
- 'title' => 'Options',
642
- 'default' => $number_options,
643
- 'description' => '',
644
- 'type' => 'textarea',
645
- ),
646
  ),
647
  ),
648
- array(
649
- 'section' => 'wc-shortcodes-options-rsvp-event-section',
650
- 'title' => 'Event',
651
- 'options' => array(
652
- array(
653
- 'id' => 'rsvp_event_title',
654
- 'title' => 'Title',
655
- 'default' => 'You Will Attend...',
656
- 'description' => '',
657
- 'type' => 'input',
658
- ),
659
- array(
660
- 'id' => 'rsvp_event_options',
661
- 'title' => 'Options',
662
- 'default' => $event_options,
663
- 'description' => '',
664
- 'type' => 'textarea',
665
- ),
 
 
 
 
666
  ),
667
- ),
668
- array(
669
- 'section' => 'wc-shortcodes-options-rsvp-button-section',
670
- 'title' => 'Button',
671
- 'options' => array(
672
- array(
673
- 'id' => 'rsvp_button_title',
674
- 'title' => 'Title',
675
- 'default' => 'I Am Attending',
676
- 'description' => '',
677
- 'type' => 'input',
678
- ),
679
  ),
680
- ),
681
- ),
682
- );
683
- $wc_shortcodes_options['misc'] = array(
684
- 'title' => 'Misc',
685
- 'sections' => array(
686
- array(
687
- 'section' => 'wc-shortcodes-options-misc-section',
688
- 'title' => 'Miscellaneous Options',
689
- 'options' => array(
690
- array(
691
- 'id' => 'enable_shortcode_css',
692
- 'title' => 'Shortcode CSS',
693
- 'default' => '1',
694
- 'description' => '',
695
- 'label' => 'Use shortcode CSS provided by plugin',
696
- 'type' => 'checkbox',
697
- ),
698
- array(
699
- 'id' => 'enable_font_awesome',
700
- 'title' => 'Enable FontAwesome',
701
- 'default' => '1',
702
- 'description' => '',
703
- 'label' => 'Use font icons provided by FontAwesome',
704
- 'type' => 'checkbox',
705
- ),
706
  ),
707
  ),
708
- ),
709
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
710
  }
711
- add_action( 'init', 'wc_shortcodes_set_options', 100 );
1
  <?php
2
+ function wc_shortcodes_options( $options ) {
3
  global $wc_shortcodes_share_buttons;
4
  global $wc_shortcodes_social_icons;
 
5
  global $wc_shortcodes_theme_support;
6
 
7
+ // RSVP
8
+ $number_options = "1\n2\n3\n4\n5";
9
+ $event_options = "All Events\nMain Ceremony\nWedding Party";
10
+ $admin_email = get_option( 'admin_email' );
11
+
12
+ // page
13
+ $menu_slug = 'wc-shortcodes';
14
+
15
+ // Option
16
+ $options[ $menu_slug ] = array(
17
+ 'parent_slug' => 'themes.php',
18
+ 'page_title' => 'Shortcodes',
19
+ 'menu_title' => 'Shortcodes',
20
+ 'capability' => 'manage_options',
21
+ 'option_group' => 'wc-shortcodes-options-group',
22
+ 'tabs' => array(
23
  array(
24
+ 'id' => 'wc-shortcodes-options-social-media-options-tab',
25
+ 'title' => 'Social Media',
26
+ 'sections' => array(
 
 
 
 
 
 
 
27
  array(
28
+ 'id' => 'wc-shortcodes-options-social-media-display-section',
29
+ 'add_section' => true, // Add a new section? Or does it already exists?
30
+ 'title' => 'Display',
 
 
31
  'options' => array(
32
+ array(
33
+ 'option_name' => 'social_icons_display',
34
+ 'title' => 'Order / Show / Hide',
35
+ 'default' => $wc_shortcodes_social_icons,
36
+ 'description' => '',
37
+ 'type' => 'order_show_hide',
38
+ 'callback' => 'wc_shortcodes_sanitize_social_icons',
39
+ ),
40
+ array(
41
+ 'option_name' => 'social_icons_format',
42
+ 'title' => 'Format',
43
+ 'default' => $wc_shortcodes_theme_support['social_icons_format'],
44
+ 'description' => '',
45
+ 'type' => 'dropdown',
46
+ 'options' => array(
47
+ 'icon' => 'Icon',
48
+ 'image' => 'Image',
49
+ ),
50
+ ),
51
  ),
52
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  array(
54
+ 'id' => 'wc-shortcodes-options-social-media-configure-section',
55
+ 'add_section' => true,
56
+ 'title' => 'Customize',
57
+ 'options' => wc_shortcodes_get_social_icons_options(),
 
 
 
 
 
 
 
 
58
  ),
59
  ),
60
  ),
61
  array(
62
+ 'id' => 'wc-shortcodes-options-share-buttons-options-tab',
63
+ 'title' => 'Share Buttons',
64
+ 'sections' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  array(
66
+ 'id' => 'wc-shortcodes-options-share-buttons-display-section',
67
+ 'add_section' => true, // Add a new section? Or does it already exists?
68
+ 'title' => 'Display',
 
 
69
  'options' => array(
70
+ array(
71
+ 'option_name' => 'share_buttons_display',
72
+ 'title' => 'Order / Show / Hide',
73
+ 'default' => $wc_shortcodes_share_buttons,
74
+ 'description' => '',
75
+ 'type' => 'order_show_hide',
76
+ 'callback' => 'wc_shortcodes_sanitize_share_buttons',
77
+ ),
78
+ array(
79
+ 'option_name' => 'share_buttons_format',
80
+ 'title' => 'Format',
81
+ 'default' => $wc_shortcodes_theme_support['share_buttons_format'],
82
+ 'description' => '',
83
+ 'type' => 'dropdown',
84
+ 'options' => array(
85
+ 'icon' => 'Icon',
86
+ 'image' => 'Image',
87
+ 'icon-text' => 'Icon + Text',
88
+ 'text' => 'Text',
89
+ ),
90
+ ),
91
  ),
92
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  array(
94
+ 'id' => 'wc-shortcodes-options-share-buttons-configure-section',
95
+ 'add_section' => true,
96
+ 'title' => 'Customize',
97
+ 'options' => wc_shortcodes_get_share_buttons_options(),
 
98
  ),
99
  ),
100
  ),
101
  array(
102
+ 'id' => 'wc-shortcodes-options-rsvp-options-tab',
103
+ 'title' => 'RSVP',
104
+ 'sections' => array(
105
  array(
106
+ 'id' => 'wc-shortcodes-options-rsvp-section',
107
+ 'add_section' => true,
108
+ 'title' => 'RSVP',
109
+ 'options' => array(
110
+ array(
111
+ 'option_name' => 'rsvp_email',
112
+ 'title' => 'Email To',
113
+ 'default' => $admin_email,
114
+ 'description' => 'Send RSVP notification to the email address above. Separate multiple emails with a comma.',
115
+ 'type' => 'emails',
116
+ ),
117
+ array(
118
+ 'option_name' => 'rsvp_email_title',
119
+ 'title' => 'Email Title',
120
+ 'default' => 'New RSVP - ' .get_bloginfo('title'),
121
+ 'description' => 'The subject tile of your email you will receive',
122
+ 'type' => 'input',
123
+ ),
124
+ array(
125
+ 'option_name' => 'rsvp_success_message',
126
+ 'title' => 'Success Message',
127
+ 'default' => 'Thanks for attending! We will see you at our wedding.',
128
+ 'description' => 'The message to display after a user successfully RSVP\'d',
129
+ 'type' => 'input',
130
+ ),
131
+ ),
132
  ),
133
  array(
134
+ 'id' => 'wc-shortcodes-options-rsvp-name-section',
135
+ 'title' => 'Name',
136
+ 'add_section' => true,
137
+ 'options' => array(
138
+ array(
139
+ 'option_name' => 'rsvp_name_title',
140
+ 'title' => 'Title',
141
+ 'default' => 'Your Name',
142
+ 'description' => '',
143
+ 'type' => 'input',
144
+ ),
145
+ ),
146
  ),
147
  array(
148
+ 'id' => 'wc-shortcodes-options-rsvp-number-section',
149
+ 'title' => 'Number',
150
+ 'add_section' => true,
151
+ 'options' => array(
152
+ array(
153
+ 'option_name' => 'rsvp_number_title',
154
+ 'title' => 'Title',
155
+ 'default' => 'Number of Guests',
156
+ 'description' => '',
157
+ 'type' => 'input',
158
+ ),
159
+ array(
160
+ 'option_name' => 'rsvp_number_options',
161
+ 'title' => 'Options',
162
+ 'default' => $number_options,
163
+ 'description' => '',
164
+ 'type' => 'textarea',
165
+ ),
166
+ ),
167
  ),
168
  array(
169
+ 'id' => 'wc-shortcodes-options-rsvp-event-section',
170
+ 'title' => 'Event',
171
+ 'add_section' => true,
172
+ 'options' => array(
173
+ array(
174
+ 'option_name' => 'rsvp_event_title',
175
+ 'title' => 'Title',
176
+ 'default' => 'You Will Attend...',
177
+ 'description' => '',
178
+ 'type' => 'input',
179
+ ),
180
+ array(
181
+ 'option_name' => 'rsvp_event_options',
182
+ 'title' => 'Options',
183
+ 'default' => $event_options,
184
+ 'description' => '',
185
+ 'type' => 'textarea',
186
+ ),
187
+ ),
188
  ),
189
  array(
190
+ 'id' => 'wc-shortcodes-options-rsvp-button-section',
191
+ 'title' => 'Button',
192
+ 'add_section' => true,
193
+ 'options' => array(
194
+ array(
195
+ 'option_name' => 'rsvp_button_title',
196
+ 'title' => 'Title',
197
+ 'default' => 'I Am Attending',
198
+ 'description' => '',
199
+ 'type' => 'input',
200
+ ),
201
+ ),
202
  ),
203
  ),
204
  ),
205
  array(
206
+ 'id' => 'wc-misc-options-tab',
207
+ 'title' => 'Misc',
208
+ 'sections' => array(
 
 
 
 
 
 
 
209
  array(
210
+ 'id' => 'wc-misc-options-section',
211
+ 'add_section' => true, // Add a new section? Or does it already exists?
212
+ 'title' => 'Miscellaneous Options',
213
+ 'options' => array(
214
+ array(
215
+ 'option_name' => 'enable_shortcode_css',
216
+ 'title' => 'Shortcode CSS',
217
+ 'default' => '1',
218
+ 'description' => '',
219
+ 'label' => 'Use shortcode CSS provided by plugin',
220
+ 'type' => 'checkbox',
221
+ ),
222
+ array(
223
+ 'option_name' => 'enable_font_awesome',
224
+ 'title' => 'Enable FontAwesome',
225
+ 'default' => '1',
226
+ 'description' => '',
227
+ 'label' => 'Use font icons provided by FontAwesome',
228
+ 'type' => 'checkbox',
229
+ ),
230
+ ),
231
  ),
232
  ),
233
  ),
234
  ),
235
  );
 
 
 
236
 
237
+ return $options;
238
+ }
239
+ add_filter( 'wc_shortcodes_wpcsf_options', 'wc_shortcodes_options', 10, 1 );
240
+
241
+ function wc_shortcodes_get_share_buttons_options() {
242
+ global $wc_shortcodes_theme_support;
243
+ global $wc_shortcodes_share_buttons;
244
+
245
+ $options = array();
246
+ foreach ( $wc_shortcodes_share_buttons as $key => $value ) {
247
+ $options[] = array(
248
+ 'id' => $key . '-share',
249
+ 'title' => $value,
250
+ 'description' => '',
251
+ 'group' => array(
252
+ array(
253
+ 'option_name' => $key . '_share_text',
254
+ 'label' => 'Share Text',
255
+ 'default' => $wc_shortcodes_theme_support[ $key . '_share_text'],
256
+ 'description' => '',
257
+ 'type' => 'input',
 
 
 
 
 
 
 
258
  ),
259
+ array(
260
+ 'option_name' => $key . '_share_font_icon',
261
+ 'label' => 'Font Icon',
262
+ 'default' => $wc_shortcodes_theme_support[ $key . '_share_font_icon'],
263
+ 'description' => '<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">See All Icons</a>',
264
+ 'type' => 'input',
 
 
 
 
 
 
265
  ),
266
+ array(
267
+ 'option_name' => $key . '_share_icon',
268
+ 'label' => 'Image Icon',
269
+ 'default' => $wc_shortcodes_theme_support[ $key . '_share_button'],
270
+ 'description' => '',
271
+ 'type' => 'image',
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  ),
273
  ),
274
+ );
275
+ }
276
+
277
+ return $options;
278
+ }
279
+ function wc_shortcodes_get_social_icons_options() {
280
+ global $wc_shortcodes_theme_support;
281
+ global $wc_shortcodes_social_icons;
282
+
283
+ $options = array();
284
+ foreach ( $wc_shortcodes_social_icons as $key => $value ) {
285
+ $options[] = array(
286
+ 'id' => $key,
287
+ 'title' => $value,
288
+ 'description' => '',
289
+ 'group' => array(
290
+ array(
291
+ 'option_name' => $key . '_link',
292
+ 'label' => 'Link',
293
+ 'default' => '',
294
+ 'description' => '',
295
+ 'type' => 'input',
296
  ),
297
+ array(
298
+ 'option_name' => $key . '_font_icon',
299
+ 'label' => 'Font Icon',
300
+ 'default' => $wc_shortcodes_theme_support[ $key . '_font_icon'],
301
+ 'description' => '<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">See All Icons</a>',
302
+ 'type' => 'input',
 
 
 
 
 
 
303
  ),
304
+ array(
305
+ 'option_name' => $key . '_icon',
306
+ 'label' => 'Image Icon',
307
+ 'default' => $wc_shortcodes_theme_support[ $key . '_social_icon'],
308
+ 'description' => '',
309
+ 'type' => 'image',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  ),
311
  ),
312
+ );
313
+ }
314
+
315
+ return $options;
316
+ }
317
+
318
+ function wc_shortcodes_sanitize_share_buttons( $value ) {
319
+ global $wc_shortcodes_share_buttons;
320
+
321
+ $whitelist = $wc_shortcodes_share_buttons;
322
+
323
+ $valid = array();
324
+
325
+ if ( ! is_array( $value ) || empty( $value ) )
326
+ return null;
327
+
328
+ foreach ( $value as $k => $v ) {
329
+ if ( array_key_exists( $k, $whitelist ) )
330
+ $valid[ $k ] = $v;
331
+ }
332
+
333
+ return $valid;
334
+ }
335
+
336
+ function wc_shortcodes_sanitize_social_icons( $value ) {
337
+ global $wc_shortcodes_social_icons;
338
+
339
+ $whitelist = $wc_shortcodes_social_icons;
340
+
341
+ $valid = array();
342
+
343
+ if ( ! is_array( $value ) || empty( $value ) )
344
+ return null;
345
+
346
+ foreach ( $value as $k => $v ) {
347
+ if ( array_key_exists( $k, $whitelist ) )
348
+ $valid[ $k ] = $v;
349
+ }
350
+
351
+ return $valid;
352
  }
 
includes/settings.php DELETED
@@ -1,645 +0,0 @@
1
- <?php
2
- function wc_shortcodes_options_enqueue_scripts() {
3
- global $wc_shortcodes_plugin_screen_hook_suffix;
4
-
5
- if ( ! isset( $wc_shortcodes_plugin_screen_hook_suffix ) ) {
6
- return;
7
- }
8
-
9
- $screen = get_current_screen();
10
-
11
- if ( $wc_shortcodes_plugin_screen_hook_suffix == $screen->id ) {
12
- wp_register_style( 'wc-shortcodes-options', WC_SHORTCODES_PLUGIN_URL . 'includes/css/admin.css', array(), WC_SHORTCODES_VERSION, 'all' );
13
- wp_enqueue_style( 'wc-shortcodes-options' );
14
-
15
- wp_enqueue_media();
16
- wp_register_script( 'wc-shortcodes-options-js', WC_SHORTCODES_PLUGIN_URL . 'includes/js/admin.js', array('jquery'), WC_SHORTCODES_VERSION, true );
17
- wp_enqueue_script( 'wc-shortcodes-options-js' );
18
- }
19
- }
20
- add_action('admin_enqueue_scripts', 'wc_shortcodes_options_enqueue_scripts' );
21
-
22
- function wc_shortcodes_options_init() {
23
- global $wc_shortcodes_options;
24
-
25
- foreach ( $wc_shortcodes_options as $tab => $o ) {
26
- foreach ( $o['sections'] as $oo ) {
27
- add_settings_section( $oo['section'], $oo['title'], '', 'wc-shortcodes-options' . $tab );
28
- foreach ( $oo['options'] as $ooo ) {
29
- $ooo['option_name'] = WC_SHORTCODES_PREFIX . $ooo['id'];
30
- $callback = wc_shortcodes_options_find_sanitize_callback( $ooo['type'] );
31
- register_setting( 'wc-shortcodes-options-'.$tab.'group', WC_SHORTCODES_PREFIX . $ooo['id'], $callback );
32
- add_settings_field('wc_shortcodes_'.$ooo['id'].'', '<label for="wc_shortcodes_'.$ooo['id'].'">'.__($ooo['title'] , 'wc_shortcodes' ).'</label>' , 'wc_shortcodes_options_display_setting', 'wc-shortcodes-options'.$tab, $oo['section'], $ooo );
33
- }
34
- }
35
- }
36
- }
37
- add_action( 'admin_init', 'wc_shortcodes_options_init' );
38
-
39
- function wc_shortcodes_options_admin_menu() {
40
- global $wc_shortcodes_options;
41
- global $wc_shortcodes_plugin_screen_hook_suffix;
42
-
43
- foreach ( $wc_shortcodes_options as $tab => $o ) {
44
- $view_hook_name = add_submenu_page( 'options.php', $o['title'], $o['title'], 'manage_options', 'wc-shortcodes-options-' . $tab, 'wc_shortcodes_options_display_page' );
45
- }
46
-
47
- // add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );
48
- $view_hook_name = add_submenu_page( 'themes.php', 'Shortcodes', 'Shortcodes', 'manage_options', 'wc-shortcodes-options', 'wc_shortcodes_options_display_page' );
49
- $wc_shortcodes_plugin_screen_hook_suffix = $view_hook_name;
50
- }
51
- add_action( 'admin_menu', 'wc_shortcodes_options_admin_menu' );
52
-
53
- function wc_shortcodes_options_display_page() {
54
- global $wc_shortcodes_options, $tab;
55
- wp_reset_vars( array( 'tab' ) );
56
-
57
- // restore last tab visited
58
- if ( empty( $tab ) && isset( $_COOKIE[ WC_SHORTCODES_PREFIX . 'last_tab_visited'] ) ) {
59
- $last_tab = $_COOKIE[ WC_SHORTCODES_PREFIX . 'last_tab_visited'];
60
- if ( isset( $wc_shortcodes_options[ $last_tab ] ) ) {
61
- $tab = $last_tab;
62
- }
63
- }
64
-
65
- ?>
66
- <div class="wrap">
67
- <?php screen_icon(); ?>
68
- <?php
69
- $links = array();
70
- foreach( $wc_shortcodes_options as $id => $page ) :
71
- if ( empty( $tab ) || $id == $tab ) {
72
- $tab = $id;
73
- $links[] = "<a class='nav-tab nav-tab-active' href='themes.php?page=wc-shortcodes-options&tab=".$tab."'>".$page['title']."</a>";
74
- }
75
- else {
76
- $links[] = "<a class='nav-tab' href='themes.php?page=wc-shortcodes-options&tab=".$id."'>".$page['title']."</a>";
77
- }
78
- endforeach;
79
- ?>
80
- <h2 class="nav-tab-wrapper">
81
- <?php echo implode( '', $links ); ?>
82
- </h2>
83
-
84
- <?php if ( isset( $_GET['settings-updated'] ) ) : ?>
85
- <div id="message" class="updated"><p><strong><?php _e( 'Settings saved.' ) ?></strong></p></div>
86
- <?php endif; ?>
87
-
88
- <form id="compile-less-css" method="post" action="options.php">
89
- <?php
90
- // settings_fields( $option_group )
91
- // @option_group A settings group name. This should match the group name used in register_setting()
92
- settings_fields( 'wc-shortcodes-options-'.$tab.'group' );
93
-
94
- // do_settings_sections( $page )
95
- // The slug name of the page whose settings sections you want to output. This should match the page name used in add_settings_section()
96
- do_settings_sections( 'wc-shortcodes-options'.$tab );
97
- ?>
98
-
99
- <p class="submit">
100
- <?php submit_button( null, 'primary', 'submit', false ); ?>
101
- </p>
102
- </form>
103
- </div>
104
- <?php
105
- }
106
-
107
- /*
108
- * Display Options
109
- */
110
- function wc_shortcodes_options_display_setting( $args ) {
111
- if ( !isset( $args['type'] ) )
112
- return;
113
-
114
- if ( !isset( $args['option_name'] ) )
115
- return;
116
-
117
- if ( !isset( $args['default'] ) )
118
- return;
119
-
120
- switch ( $args['type'] ) {
121
- case 'image' :
122
- wc_shortcodes_options_display_image_field( $args );
123
- break;
124
- case 'dropdown' :
125
- wc_shortcodes_options_display_custom_dropdown( $args );
126
- break;
127
- case 'background' :
128
- wc_shortcodes_options_display_background_fields( $args );
129
- break;
130
- case 'checkbox' :
131
- wc_shortcodes_options_display_checkbox_field( $args );
132
- break;
133
- case 'textarea' :
134
- wc_shortcodes_options_display_textarea_field( $args );
135
- break;
136
- case 'positive_pixel' :
137
- wc_shortcodes_options_display_positive_pixel_input_field( $args );
138
- break;
139
- case 'pixel' :
140
- wc_shortcodes_options_display_pixel_input_field( $args );
141
- break;
142
- case 'share_buttons' :
143
- wc_shortcodes_options_display_share_buttons_field( $args );
144
- break;
145
- case 'social_icons' :
146
- wc_shortcodes_options_display_social_icons_field( $args );
147
- break;
148
- case 'emails' :
149
- default :
150
- wc_shortcodes_options_input_field( $args );
151
- break;
152
- }
153
- }
154
-
155
- function wc_shortcodes_options_input_field( $args ) {
156
- extract( $args );
157
-
158
- $val = get_option( $option_name, $default );
159
- ?>
160
-
161
- <?php if ( isset( $label ) ) : ?>
162
- <label for="<?php echo esc_attr($option_name); ?>"><?php echo $label; ?></label>&nbsp;
163
- <?php endif; ?>
164
-
165
- <input name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>" type="text" value="<?php echo esc_attr($val); ?>" class="regular-text" />
166
- <?php if ( isset( $description ) && !empty( $description ) ) : ?>
167
- <p class="description"><?php echo $description; ?></p>
168
- <?php endif; ?>
169
- <?php
170
- }
171
- function wc_shortcodes_options_display_share_buttons_field( $args ) {
172
- global $wc_shortcodes_share_buttons;
173
-
174
- extract( $args );
175
-
176
- $val = get_option( $option_name, $default );
177
- $not_selected = $wc_shortcodes_share_buttons;
178
-
179
- ?>
180
-
181
- <?php if ( isset( $label ) ) : ?>
182
- <label for="<?php echo esc_attr($option_name); ?>"><?php echo $label; ?></label>&nbsp;
183
- <?php endif; ?>
184
-
185
- <ul class="wc-shortcodes-clearfix wc-shortcodes-share-buttons">
186
- <?php if ( is_array( $val ) && ! empty( $val ) ) : ?>
187
- <?php foreach ( $val as $key => $name ) : ?>
188
- <li>
189
- <p style="width:300px;background-color:#f7f7f7;border:1px solid #dfdfdf;padding:5px 5px;line-height:1;margin:0;text-align:left;cursor:move;">
190
- <input type="checkbox" name="<?php echo $option_name; ?>[<?php echo $key; ?>]" value="<?php echo $name; ?>" <?php checked( true, true ); ?> />
191
- <?php echo $name; ?>
192
- </p>
193
- </li>
194
- <?php unset( $not_selected[ $key ] ); ?>
195
- <?php endforeach; ?>
196
- <?php endif; ?>
197
-
198
- <?php foreach ( $not_selected as $key => $name ) : ?>
199
- <li>
200
- <p style="width:300px;background-color:#f7f7f7;border:1px solid #dfdfdf;padding:5px 5px;line-height:1;margin:0;text-align:left;cursor:move;">
201
- <input type="checkbox" name="<?php echo $option_name; ?>[<?php echo $key; ?>]" value="<?php echo $name; ?>" <?php checked( true, false ); ?> />
202
- <?php echo $name; ?>
203
- </p>
204
- </li>
205
- <?php unset( $not_selected[ $key ] ); ?>
206
- <?php endforeach; ?>
207
- </ul>
208
-
209
- <?php if ( isset( $description ) && !empty( $description ) ) : ?>
210
- <p class="description"><?php echo $description; ?></p>
211
- <?php endif; ?>
212
- <?php
213
- }
214
- function wc_shortcodes_options_display_social_icons_field( $args ) {
215
- global $wc_shortcodes_social_icons;
216
-
217
- extract( $args );
218
-
219
- $val = get_option( $option_name, $default );
220
- $not_selected = $wc_shortcodes_social_icons;
221
-
222
- ?>
223
-
224
- <?php if ( isset( $label ) ) : ?>
225
- <label for="<?php echo esc_attr($option_name); ?>"><?php echo $label; ?></label>&nbsp;
226
- <?php endif; ?>
227
-
228
- <ul class="wc-shortcodes-clearfix wc-shortcodes-share-buttons">
229
- <?php if ( is_array( $val ) && ! empty( $val ) ) : ?>
230
- <?php foreach ( $val as $key => $name ) : ?>
231
- <li>
232
- <p style="width:300px;background-color:#f7f7f7;border:1px solid #dfdfdf;padding:5px 5px;line-height:1;margin:0;text-align:left;cursor:move;">
233
- <input type="checkbox" name="<?php echo $option_name; ?>[<?php echo $key; ?>]" value="<?php echo $name; ?>" <?php checked( true, true ); ?> />
234
- <?php echo $name; ?>
235
- </p>
236
- </li>
237
- <?php unset( $not_selected[ $key ] ); ?>
238
- <?php endforeach; ?>
239
- <?php endif; ?>
240
-
241
- <?php foreach ( $not_selected as $key => $name ) : ?>
242
- <li>
243
- <p style="width:300px;background-color:#f7f7f7;border:1px solid #dfdfdf;padding:5px 5px;line-height:1;margin:0;text-align:left;cursor:move;">
244
- <input type="checkbox" name="<?php echo $option_name; ?>[<?php echo $key; ?>]" value="<?php echo $name; ?>" <?php checked( true, false ); ?> />
245
- <?php echo $name; ?>
246
- </p>
247
- </li>
248
- <?php unset( $not_selected[ $key ] ); ?>
249
- <?php endforeach; ?>
250
- </ul>
251
-
252
- <?php if ( isset( $description ) && !empty( $description ) ) : ?>
253
- <p class="description"><?php echo $description; ?></p>
254
- <?php endif; ?>
255
- <?php
256
- }
257
- function wc_shortcodes_options_display_positive_pixel_input_field( $args ) {
258
- extract( $args );
259
-
260
- $val = get_option( $option_name, $default );
261
- $val = preg_replace("/[^0-9]/", "",$val);
262
- ?>
263
-
264
- <?php if ( isset( $label ) ) : ?>
265
- <label for="<?php echo $option_name; ?>"><?php echo $label; ?></label>&nbsp;
266
- <?php endif; ?>
267
-
268
- <input type="number" min="0" class="small-text" name="<?php echo esc_attr($option_name); ?>" id="<?php echo $option_name; ?>" value="<?php echo esc_attr($val); ?>" />&nbsp;
269
-
270
- <?php if ( isset( $description ) && !empty( $description ) ) : ?>
271
- <p class="description"><?php echo $description; ?></p>
272
- <?php endif; ?>
273
-
274
- <?php
275
- }
276
- function wc_shortcodes_options_display_pixel_input_field( $args ) {
277
- extract( $args );
278
-
279
- $val = get_option( $option_name, $default );
280
- $val = preg_replace("/[^0-9\-]/", "",$val);
281
- ?>
282
-
283
- <?php if ( isset( $label ) ) : ?>
284
- <label for="<?php echo $option_name; ?>"><?php echo $label; ?></label>&nbsp;
285
- <?php endif; ?>
286
-
287
- <input type="number" class="small-text" name="<?php echo esc_attr($option_name); ?>" id="<?php echo $option_name; ?>" value="<?php echo esc_attr($val); ?>" />&nbsp;
288
-
289
- <?php if ( isset( $description ) && !empty( $description ) ) : ?>
290
- <p class="description"><?php echo $description; ?></p>
291
- <?php endif; ?>
292
-
293
- <?php
294
- }
295
- function wc_shortcodes_options_display_background_fields( $args ) {
296
- extract( $args );
297
-
298
- $val = get_option( $option_name, $default );
299
-
300
- // preview image default style
301
- $style = '';
302
- if ( empty( $val['image'] ) )
303
- $style = ' style="display:none"';
304
- ?>
305
-
306
- <div class="wc-shortcodes-background-options">
307
- <?php // Background Image ?>
308
- <input name="<?php echo $option_name; ?>[image]" id="<?php echo $option_name; ?>" class="regular-text ltr upload-input" type="text" value="<?php echo esc_attr( $val['image'] ); ?>" />
309
- <br />
310
- <a class="button wc-shortcodes-image-upload" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image" data-frame="select" data-state="wc_shortcodes_insert_single" data-fetch="url" data-title="Insert Image" data-button="Insert" data-class="media-frame wc-shortcodes-custom-uploader" title="Add Media"><span class="wp-media-buttons-icon"></span> Add Media</a>
311
- <a class="button wc-shortcodes-restore-image" data-restore="<?php echo esc_attr( $default['image'] ); ?>" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image">Default</a>
312
- <a class="button wc-shortcodes-delete-image" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image">Delete</a>
313
- <br />
314
- <p class="wc-shortcodes-preview-image"<?php echo $style; ?>><img src="<?php echo esc_attr( $val['image'] ); ?>" /></p>
315
-
316
- <?php // Background Repeat ?>
317
- <select name="<?php echo $option_name; ?>[repeat]" >
318
- <option value="repeat" <?php selected( $val['repeat'], 'repeat'); ?>>Repeat</option>
319
- <option value="repeat-x" <?php echo selected( $val['repeat'], 'repeat-x', false ); ?>>Repeat Horizontal</option>
320
- <option value="repeat-y" <?php echo selected( $val['repeat'], 'repeat-y', false ); ?>>Repeat Vertical</option>
321
- <option value="no-repeat" <?php echo selected( $val['repeat'], 'no-repeat', false ); ?>>No Repeat</option>
322
- <option value="" <?php selected( $val['repeat'], ''); ?>>Inherit</option>
323
- </select>
324
-
325
- <?php // Background position ?>
326
- <select name="<?php echo $option_name; ?>[position]" >
327
- <option value="left top" <?php selected( $val['position'], 'left top'); ?>>Left Top</option>
328
- <option value="left center" <?php selected( $val['position'], 'left center'); ?>>Left Center</option>
329
- <option value="left bottom" <?php selected( $val['position'], 'left bottom'); ?>>Left Bottom</option>
330
- <option value="right top" <?php selected( $val['position'], 'right top'); ?>>Right Top</option>
331
- <option value="right center" <?php selected( $val['position'], 'right center'); ?>>Right Center</option>
332
- <option value="right bottom" <?php selected( $val['position'], 'right bottom'); ?>>Right Bottom</option>
333
- <option value="center top" <?php selected( $val['position'], 'center top'); ?>>Center Top</option>
334
- <option value="center center" <?php selected( $val['position'], 'center center'); ?>>Center Center</option>
335
- <option value="center bottom" <?php selected( $val['position'], 'center bottom'); ?>>Center Bottom</option>
336
- <option value="" <?php selected( $val['position'], ''); ?>>Inherit</option>
337
- </select>
338
-
339
- <?php // Background Attachment ?>
340
- <select name="<?php echo $option_name; ?>[attachment]" >
341
- <option value="scroll" <?php selected( $val['attachment'], 'scroll'); ?>>Scroll</option>
342
- <option value="fixed" <?php selected( $val['attachment'], 'fixed'); ?>>Fixed</option>
343
- <option value="" <?php selected( $val['attachment'], ''); ?>>Inherit</option>
344
- </select>
345
- <br />
346
-
347
- <?php // Background Color ?>
348
- <input name="<?php echo $option_name; ?>[color]" type="text" value="<?php echo $val['color']; ?>" class="wc-shortcodes-color-field" data-default-color="<?php echo $default['color']; ?>" />
349
-
350
- <?php // Description ?>
351
- <?php if ( isset( $description ) && !empty( $description ) ) : ?>
352
- <p class="description"><?php echo $description; ?></p>
353
- <?php endif; ?>
354
- </div>
355
-
356
- <?php
357
- }
358
- function wc_shortcodes_options_display_image_field( $args ) {
359
- extract( $args );
360
-
361
- $val = get_option( $option_name, $default );
362
-
363
- // preview image default style
364
- $style = '';
365
- if ( empty( $val ) ) {
366
- $style = ' style="display:none"';
367
- }
368
- ?>
369
-
370
- <div class="wc-shortcodes-image-field">
371
- <input name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>" class="regular-text ltr upload-input" type="text" value="<?php echo esc_attr($val); ?>" />
372
- <br />
373
- <a class="button wc-shortcodes-image-upload" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image" data-frame="select" data-state="wc_shortcodes_insert_single" data-fetch="url" data-title="Insert Image" data-button="Insert" data-class="media-frame wc-shortcodes-custom-uploader" title="Add Media"><span class="wp-media-buttons-icon"></span> Add Media</a>
374
- <a class="button wc-shortcodes-restore-image" data-restore="<?php echo $default; ?>" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image">Default</a>
375
- <a class="button wc-shortcodes-delete-image" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image">Delete</a>
376
- <p class="wc-shortcodes-preview-image"<?php echo $style; ?>><img src="<?php echo esc_attr($val); ?>" /></p>
377
- <?php if ( isset( $description ) && !empty( $description ) ) : ?>
378
- <p class="description"><?php echo $description; ?></p>
379
- <?php endif; ?>
380
- </div>
381
- <?php
382
- }
383
-
384
- function wc_shortcodes_options_display_checkbox_field( $args ) {
385
- extract( $args );
386
-
387
- $val = get_option( $option_name, $default );
388
- ?>
389
-
390
- <?php if ( isset( $label ) ) : ?>
391
- <label for="<?php echo esc_attr($option_name); ?>">
392
- <?php endif; ?>
393
-
394
- <input name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>" type="checkbox" value="1" <?php checked( true, $val ); ?> />
395
-
396
- <?php if ( isset( $label ) ) : ?>
397
- &nbsp;<?php echo $label; ?></label>&nbsp;
398
- <?php endif; ?>
399
-
400
- <?php if ( isset( $description ) && !empty( $description ) ) : ?>
401
- <p class="description"><?php echo $description; ?></p>
402
- <?php endif; ?>
403
- <?php
404
- }
405
-
406
- function wc_shortcodes_options_display_textarea_field( $args ) {
407
- extract( $args );
408
-
409
- $val = get_option( $option_name, $default );
410
- ?>
411
-
412
- <?php if ( isset( $label ) ) : ?>
413
- <label for="<?php echo esc_attr($option_name); ?>"><?php echo $label; ?></label>&nbsp;
414
- <?php endif; ?>
415
-
416
- <textarea name="<?php echo $option_name; ?>" class="wc-shortcodes-textarea" id="<?php echo $option_name; ?>"><?php echo esc_textarea($val); ?></textarea>
417
- <?php if ( isset( $description ) && !empty( $description ) ) : ?>
418
- <p class="description"><?php echo $description; ?></p>
419
- <?php endif; ?>
420
- <?php
421
- }
422
-
423
- /**
424
- * Display custom dropdown
425
- *
426
- * @since 3.5.2
427
- * @access public
428
- *
429
- * @param array $args
430
- * @return void
431
- */
432
- function wc_shortcodes_options_display_custom_dropdown( $args ) {
433
- extract( $args );
434
-
435
- $val = get_option( $option_name, $default );
436
-
437
- if ( isset( $options_callback ) && ! empty( $options_callback ) )
438
- $options = call_user_func( $options_callback );
439
- ?>
440
-
441
- <?php if ( isset( $label ) ) : ?>
442
- <label for="<?php echo $option_name; ?>"><?php echo $label; ?></label>&nbsp;
443
- <?php endif; ?>
444
-
445
- <select name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>">
446
- <?php foreach ( $options as $key => $name ) : ?>
447
- <option value="<?php echo $key; ?>" <?php selected( $val, $key); ?>><?php echo $name; ?></option>
448
- <?php endforeach; ?>
449
- </select>&nbsp;
450
-
451
- <?php // Description ?>
452
- <?php if ( isset( $description ) && !empty( $description ) ) : ?>
453
- <p class="description"><?php echo $description; ?></p>
454
- <?php endif; ?>
455
- <?php
456
- }
457
-
458
- /*
459
- * Sanitize Options
460
- */
461
- function wc_shortcodes_options_find_sanitize_callback( $type ) {
462
- switch ( $type ) {
463
- case 'color' :
464
- return 'wc_shortcodes_options_sanitize_hex_color';
465
- case 'image' :
466
- return 'esc_url_raw';
467
- case 'checkbox' :
468
- return 'wc_shortcodes_options_sanitize_checkbox';
469
- case 'emails' :
470
- return 'wc_shortcodes_options_sanitize_emails';
471
- case 'background' :
472
- return 'wc_shortcodes_options_sanitize_background_css';
473
- case 'positive_pixel' :
474
- return 'wc_shortcodes_options_sanitize_positive_pixel';
475
- case 'pixel' :
476
- return 'wc_shortcodes_options_sanitize_pixel';
477
- case 'share_buttons' :
478
- return 'wc_shortcodes_options_sanitize_share_buttons';
479
- }
480
-
481
- return '';
482
- }
483
-
484
- function wc_shortcodes_options_sanitize_positive_pixel( $value ) {
485
- $value = preg_replace("/[^0-9]/", "",$value);
486
- $value = intval( $value );
487
-
488
- if ( empty( $value ) )
489
- $value = '0';
490
-
491
- return $value."px";
492
- }
493
-
494
- function wc_shortcodes_options_sanitize_pixel( $value ) {
495
- $value = preg_replace("/[^0-9\-]/", "",$value);
496
- $value = intval( $value );
497
-
498
- if ( empty( $value ) )
499
- $value = '0';
500
-
501
- return $value."px";
502
- }
503
-
504
- function wc_shortcodes_options_sanitize_share_buttons( $value ) {
505
- global $wc_shortcodes_share_buttons;
506
-
507
- $whitelist = $wc_shortcodes_share_buttons;
508
-
509
- $valid = array();
510
-
511
- if ( ! is_array( $value ) || empty( $value ) )
512
- return null;
513
-
514
- foreach ( $value as $k => $v ) {
515
- if ( array_key_exists( $k, $whitelist ) )
516
- $valid[ $k ] = $v;
517
- }
518
-
519
- return $valid;
520
- }
521
-
522
- function wc_shortcodes_options_sanitize_background_css( $value ) {
523
- $background = array(
524
- 'color' => '',
525
- 'image' => '',
526
- 'repeat' => '',
527
- 'position' => '',
528
- 'attachment' => '',
529
- );
530
-
531
- if ( !is_array( $value ) )
532
- return $background;
533
-
534
- foreach ( $value as $k => $v ) {
535
- switch ( $k ) {
536
- case 'color' :
537
- $v = wc_shortcodes_options_sanitize_hex_color( $v );
538
- $background['color'] = $v;
539
- break;
540
- case 'image' :
541
- $v = esc_url_raw( $v );
542
- $background['image'] = $v;
543
- break;
544
- case 'repeat' :
545
- $v = wc_shortcodes_options_sanitize_background_repeat( $v );
546
- $background['repeat'] = $v;
547
- break;
548
- case 'position' :
549
- $v = wc_shortcodes_options_sanitize_background_position( $v );
550
- $background['position'] = $v;
551
- break;
552
- case 'attachment' :
553
- $v = wc_shortcodes_options_sanitize_background_attachment( $v );
554
- $background['attachment'] = $v;
555
- break;
556
- }
557
- }
558
-
559
- return $background;
560
- }
561
-
562
- function wc_shortcodes_options_sanitize_background_repeat( $value ) {
563
- $whitelist = array( 'repeat', 'no-repeat', 'repeat-x', 'repeat-y' );
564
-
565
- if ( in_array( $value, $whitelist ) )
566
- return $value;
567
-
568
- return '';
569
- }
570
-
571
- function wc_shortcodes_options_sanitize_background_position( $value ) {
572
- $whitelist = array(
573
- 'left top',
574
- 'left center',
575
- 'left bottom',
576
- 'right top',
577
- 'right center',
578
- 'right bottom',
579
- 'center top',
580
- 'center center',
581
- 'center bottom',
582
- );
583
-
584
- if ( in_array( $value, $whitelist ) )
585
- return $value;
586
-
587
- return '';
588
- }
589
-
590
- function wc_shortcodes_options_sanitize_background_attachment( $value ) {
591
- $whitelist = array( 'fixed', 'scroll' );
592
-
593
- if ( in_array( $value, $whitelist ) )
594
- return $value;
595
-
596
- return '';
597
- }
598
-
599
- function wc_shortcodes_options_sanitize_checkbox( $val ) {
600
- if ( $val )
601
- return 1;
602
- else
603
- return 0;
604
- }
605
-
606
- function wc_shortcodes_options_sanitize_hex_color( $color ) {
607
- if ( '' === $color )
608
- return '';
609
-
610
- if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) )
611
- return $color;
612
-
613
- return null;
614
- }
615
-
616
- function wc_shortcodes_options_sanitize_emails( $email ) {
617
- $valid = array();
618
-
619
- $email = explode( ',', $email );
620
-
621
- foreach ( $email as $e ) {
622
- $e = trim( $e );
623
- if ( is_email( $e ) )
624
- $valid[] = $e;
625
- }
626
-
627
- if ( ! empty( $valid ) )
628
- return implode( ',', $valid );
629
-
630
- return null;
631
- }
632
-
633
- /*
634
- * Misc
635
- */
636
- function wc_shortcodes_remember_last_options_tab() {
637
- global $page;
638
-
639
- if ( isset( $_GET['page'] ) && $_GET['page'] == 'wc-shortcodes-options' ) {
640
- if ( isset( $_GET['tab'] ) && ! empty( $_GET['tab'] ) ) {
641
- setcookie(WC_SHORTCODES_PREFIX . 'last_tab_visited', $_GET['tab'], time() + ( 2 * DAY_IN_SECONDS ) );
642
- }
643
- }
644
- }
645
- add_action( 'admin_init', 'wc_shortcodes_remember_last_options_tab' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/shortcode-functions.php CHANGED
@@ -376,7 +376,7 @@ if( !function_exists('wc_shortcodes_social_icons') ) {
376
 
377
  $html .= '<li class="wc-shortcodes-social-icon wc-shortcode-social-icon-' . $key . $first_class . '">';
378
  $html .='<a target="_blank" href="'.$social_link.'">';
379
- $html .= '<img src="'.$icon_url.'">';
380
  $html .= '</a>';
381
  $html .= '</li>';
382
  }
@@ -1141,6 +1141,7 @@ if( ! function_exists( 'wc_shortcodes_posts' ) ) {
1141
  'layout' => 'masonry', // blog layout
1142
  'template' => 'box',
1143
  'excerpt_length' => '55',
 
1144
  ), $atts );
1145
 
1146
  // changed default layout name. Let's catch old inputs
@@ -1549,8 +1550,7 @@ if ( ! function_exists('wc_shortcodes_share_buttons') ) {
1549
  break;
1550
  case 'google' :
1551
  $html .= '<li class="wc-shortcodes-share-button-icon wc-shortcode-share-button-icon-' . $key . $first_class . '">';
1552
- $html .='<a href="https://plus.google.com/share?url='.urlencode(get_permalink()).'" onclick="javascript:window.open(this.href,
1553
- \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;">';
1554
  switch ( $format ) {
1555
  case 'image' :
1556
  $html .= '<img src="'.$icon_url.'" alt="'.$icon_text.'">';
@@ -1565,6 +1565,28 @@ if ( ! function_exists('wc_shortcodes_share_buttons') ) {
1565
  $html .= '</a>';
1566
  $html .= '</li>';
1567
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1568
  }
1569
  }
1570
  $html .= '</ul>';
376
 
377
  $html .= '<li class="wc-shortcodes-social-icon wc-shortcode-social-icon-' . $key . $first_class . '">';
378
  $html .='<a target="_blank" href="'.$social_link.'">';
379
+ $html .= '<img src="'.$icon_url.'" alt="'.$value.'">';
380
  $html .= '</a>';
381
  $html .= '</li>';
382
  }
1141
  'layout' => 'masonry', // blog layout
1142
  'template' => 'box',
1143
  'excerpt_length' => '55',
1144
+ 'date_format' => 'M j, Y',
1145
  ), $atts );
1146
 
1147
  // changed default layout name. Let's catch old inputs
1550
  break;
1551
  case 'google' :
1552
  $html .= '<li class="wc-shortcodes-share-button-icon wc-shortcode-share-button-icon-' . $key . $first_class . '">';
1553
+ $html .='<a href="https://plus.google.com/share?url='.urlencode(get_permalink()).'" onclick="javascript:window.open(this.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;">';
 
1554
  switch ( $format ) {
1555
  case 'image' :
1556
  $html .= '<img src="'.$icon_url.'" alt="'.$icon_text.'">';
1565
  $html .= '</a>';
1566
  $html .= '</li>';
1567
  break;
1568
+ case 'print' :
1569
+ $html .= '<li class="wc-shortcodes-share-button-icon wc-shortcode-share-button-icon-' . $key . $first_class . '">';
1570
+ if ( is_single() ) {
1571
+ $html .='<a href="#" onclick="javascript:window.print();return false;">';
1572
+ }
1573
+ else {
1574
+ $html .='<a href="#" onclick="javascript:w=window.open(\''.get_permalink().'\');w.print();w.close();return false;">';
1575
+ }
1576
+ switch ( $format ) {
1577
+ case 'image' :
1578
+ $html .= '<img src="'.$icon_url.'" alt="'.$icon_text.'">';
1579
+ break;
1580
+ case 'icon' :
1581
+ $html .= '<i class="fa '.$icon_class.'"></i>';
1582
+ break;
1583
+ default :
1584
+ $html .= '<i class="fa '.$icon_class.'"></i><span class="wc-share-button-'.$key.'">'.$icon_text.'</span>';
1585
+ break;
1586
+ }
1587
+ $html .= '</a>';
1588
+ $html .= '</li>';
1589
+ break;
1590
  }
1591
  }
1592
  $html .= '</ul>';
includes/templates/box/entry-meta.php CHANGED
@@ -27,7 +27,7 @@
27
  esc_url( get_permalink() ),
28
  esc_attr( sprintf( __( 'Permalink to %s', 'wordpresscanvas' ), the_title_attribute( 'echo=0' ) ) ),
29
  esc_attr( get_the_date( 'c' ) ),
30
- esc_html( sprintf( '%2$s', get_post_format_string( get_post_format() ), get_the_date('M j, Y') ) )
31
  );
32
  }
33
  ?>
27
  esc_url( get_permalink() ),
28
  esc_attr( sprintf( __( 'Permalink to %s', 'wordpresscanvas' ), the_title_attribute( 'echo=0' ) ) ),
29
  esc_attr( get_the_date( 'c' ) ),
30
+ esc_html( sprintf( '%2$s', get_post_format_string( get_post_format() ), get_the_date( $atts['date_format'] ) ) )
31
  );
32
  }
33
  ?>
includes/vendors/wpc-settings-framework/class-wpc-settings-framework-sanitize.php ADDED
@@ -0,0 +1,626 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace WC_Shortcodes;
3
+
4
+ /**
5
+ * This class will store sanitize functions
6
+ *
7
+ * @package WPC_Settings_Framework
8
+ * @author Chris Baldelomar <chris@webplantmedia.com>
9
+ * @license GPL-2.0+
10
+ * @link http://webplantmedia.com
11
+ * @copyright 2014 Chris Baldelomar
12
+ */
13
+ class WPC_Settings_Framework_Sanitize {
14
+ /**
15
+ * Instance of this class.
16
+ *
17
+ * @since 1.0.0
18
+ *
19
+ * @var object
20
+ */
21
+ protected static $instance = null;
22
+
23
+ /**
24
+ * Return an instance of this class.
25
+ *
26
+ * @since 1.0.0
27
+ *
28
+ * @return object A single instance of this class.
29
+ */
30
+ public static function get_instance() {
31
+
32
+ // If the single instance hasn't been set, set it now.
33
+ if ( null == self::$instance ) {
34
+ self::$instance = new self;
35
+ }
36
+
37
+ return self::$instance;
38
+ }
39
+
40
+ /**
41
+ * Given an option type, we will return a string
42
+ * of the callback function used to sanitize
43
+ * the option value
44
+ *
45
+ * @since 3.5.2
46
+ * @access public
47
+ *
48
+ * @param string $type
49
+ * @return string
50
+ */
51
+ public function callback( $type ) {
52
+ switch ( $type ) {
53
+ case 'color' :
54
+ return 'hex_color';
55
+ case 'image' :
56
+ return 'esc_url_raw';
57
+ case 'positive_pixel' :
58
+ return 'positive_pixel';
59
+ case 'pixel' :
60
+ return 'pixel';
61
+ case 'number' :
62
+ return 'number';
63
+ case 'decimal' :
64
+ return 'decimal';
65
+ case 'border' :
66
+ return 'border';
67
+ case 'background' :
68
+ return 'background_css';
69
+ case 'checkbox' :
70
+ return 'checkbox';
71
+ case 'gallery' :
72
+ return 'gallery';
73
+ case 'emails' :
74
+ return 'emails';
75
+ }
76
+
77
+ return 'no_sanitize';
78
+ }
79
+
80
+ /**
81
+ * Validate slideshow data saved to database.
82
+ *
83
+ * @since 3.6
84
+ * @access public
85
+ *
86
+ * @param array $value
87
+ * @return array
88
+ */
89
+ public function gallery( $value ) {
90
+ if ( empty( $value ) )
91
+ return null;
92
+
93
+ $ids = explode( ',', $value );
94
+
95
+ foreach ( $ids as $key => $id ) {
96
+ if ( ! is_numeric( $id ) ) {
97
+ unset( $ids[ $key ] );
98
+ }
99
+ }
100
+
101
+ $value = implode( ',', $ids );
102
+
103
+ return $value;
104
+ }
105
+
106
+ /**
107
+ * Sanitize border values. Border consists
108
+ * of pixel value, border style, and color.
109
+ *
110
+ * @since 3.6
111
+ * @access public
112
+ *
113
+ * @param array $value
114
+ * @return array
115
+ */
116
+ public function border( $value ) {
117
+ $border = array(
118
+ 'width' => '0px',
119
+ 'style' => 'none',
120
+ 'color' => '#ffffff',
121
+ );
122
+
123
+ if ( ! is_array( $value ) )
124
+ return $border;
125
+
126
+ foreach ( $value as $k => $v ) {
127
+ switch ( $k ) {
128
+ case 'width' :
129
+ $v = $this->positive_pixel( $v );
130
+ $border['width'] = $v;
131
+ break;
132
+ case 'style' :
133
+ $v = $this->border_style( $v );
134
+ $border['style'] = $v;
135
+ break;
136
+ case 'color' :
137
+ $v = $this->hex_color( $v );
138
+ $border['color'] = $v;
139
+ break;
140
+ }
141
+ }
142
+
143
+ return $border;
144
+ }
145
+
146
+ /**
147
+ * Strips all non numerica characters and returns
148
+ * intval() of string. Only allows for positive values.
149
+ *
150
+ * @since 3.6
151
+ * @access public
152
+ *
153
+ * @param string $value
154
+ * @return void
155
+ */
156
+ public function positive_pixel( $value ) {
157
+ $value = preg_replace("/[^0-9]/", "",$value);
158
+ $value = intval( $value );
159
+
160
+ if ( empty( $value ) )
161
+ $value = '0';
162
+
163
+ return $value."px";
164
+ }
165
+
166
+ /**
167
+ * Strips all non numerica characters and returns
168
+ * intval() of string. Allows both negative and
169
+ * positive values.
170
+ *
171
+ * @since 3.6
172
+ * @access public
173
+ *
174
+ * @param string $value
175
+ * @return void
176
+ */
177
+ public function pixel( $value ) {
178
+ $value = preg_replace("/[^0-9\-]/", "",$value);
179
+ $value = intval( $value );
180
+
181
+ if ( empty( $value ) )
182
+ $value = '0';
183
+
184
+ return $value."px";
185
+ }
186
+
187
+ public function font( $value ) {
188
+ $font = array(
189
+ 'font_family' => '',
190
+ 'font_size' => '',
191
+ 'text_transform' => '',
192
+ 'font_style' => '',
193
+ 'font_weight' => '',
194
+ 'color' => '',
195
+ );
196
+
197
+ if ( !is_array( $value ) )
198
+ return $font;
199
+
200
+ foreach ( $value as $k => $v ) {
201
+ switch ( $k ) {
202
+ case 'font_family' :
203
+ $font['font_family'] = $v;
204
+ break;
205
+ case 'font_size' :
206
+ $v = $this->pixel( $value['font_size'] );
207
+ $font['font_size'] = $v;
208
+ break;
209
+ case 'text_transform' :
210
+ $font['text_transform'] = $v;
211
+ break;
212
+ case 'font_style' :
213
+ $v = $this->font_style( $v );
214
+ $font['font_style'] = $v;
215
+ break;
216
+ case 'font_weight' :
217
+ $v = $this->font_weight( $v );
218
+ $font['font_weight'] = $v;
219
+ break;
220
+ case 'color' :
221
+ $v = $this->hex_color( $v );
222
+ $font['color'] = $v;
223
+ break;
224
+ }
225
+ }
226
+
227
+ return $font;
228
+ }
229
+
230
+ public function font_hover( $value ) {
231
+ $font = array(
232
+ 'text_decoration' => '',
233
+ 'color' => '',
234
+ );
235
+
236
+ if ( !is_array( $value ) )
237
+ return $font;
238
+
239
+ foreach ( $value as $k => $v ) {
240
+ switch ( $k ) {
241
+ case 'text_decoration' :
242
+ $v = $this->text_decoration( $v );
243
+ $font['text_decoration'] = $v;
244
+ break;
245
+ case 'color' :
246
+ $v = $this->hex_color( $v );
247
+ $font['color'] = $v;
248
+ break;
249
+ }
250
+ }
251
+
252
+ return $font;
253
+ }
254
+
255
+ public function font_appearance( $value ) {
256
+ $font = array(
257
+ 'text_decoration' => '',
258
+ 'font_style' => '',
259
+ 'font_weight' => '',
260
+ 'color' => '',
261
+ );
262
+
263
+ if ( !is_array( $value ) )
264
+ return $font;
265
+
266
+ foreach ( $value as $k => $v ) {
267
+ switch ( $k ) {
268
+ case 'text_decoration' :
269
+ $v = $this->text_decoration( $v );
270
+ $font['text_decoration'] = $v;
271
+ break;
272
+ case 'font_style' :
273
+ $v = $this->font_style( $v );
274
+ $font['font_style'] = $v;
275
+ break;
276
+ case 'font_weight' :
277
+ $v = $this->font_weight( $v );
278
+ $font['font_weight'] = $v;
279
+ break;
280
+ case 'color' :
281
+ $v = $this->hex_color( $v );
282
+ $font['color'] = $v;
283
+ break;
284
+ }
285
+ }
286
+
287
+ return $font;
288
+ }
289
+
290
+ public function text_decoration( $value ) {
291
+ $whitelist = array(
292
+ 'none',
293
+ 'underline',
294
+ 'overline',
295
+ 'line-through',
296
+ );
297
+
298
+ if ( in_array( $value, $whitelist ) )
299
+ return $value;
300
+
301
+ return '';
302
+ }
303
+
304
+ public function text_transform( $value ) {
305
+ $whitelist = array(
306
+ 'none',
307
+ 'capitalize',
308
+ 'uppercase',
309
+ 'lowercase',
310
+ );
311
+
312
+ if ( in_array( $value, $whitelist ) )
313
+ return $value;
314
+
315
+ return '';
316
+ }
317
+
318
+ public function font_style( $value ) {
319
+ $whitelist = array(
320
+ 'normal',
321
+ 'italic',
322
+ 'oblique',
323
+ );
324
+
325
+ if ( in_array( $value, $whitelist ) )
326
+ return $value;
327
+
328
+ return '';
329
+ }
330
+
331
+ public function font_weight( $value ) {
332
+ $whitelist = array(
333
+ 'normal',
334
+ 'bold',
335
+ 'bolder',
336
+ 'lighter',
337
+ '100',
338
+ '200',
339
+ '300',
340
+ '400',
341
+ '500',
342
+ '600',
343
+ '700',
344
+ '800',
345
+ '900',
346
+ );
347
+
348
+ if ( in_array( $value, $whitelist ) )
349
+ return $value;
350
+
351
+ return '';
352
+ }
353
+
354
+ public function background_css( $value ) {
355
+ $background = array(
356
+ 'color' => '',
357
+ 'image' => '',
358
+ 'repeat' => '',
359
+ 'position' => '',
360
+ 'attachment' => '',
361
+ );
362
+
363
+ if ( !is_array( $value ) )
364
+ return $background;
365
+
366
+ foreach ( $value as $k => $v ) {
367
+ switch ( $k ) {
368
+ case 'color' :
369
+ $v = $this->hex_color( $v );
370
+ $background['color'] = $v;
371
+ break;
372
+ case 'image' :
373
+ $v = esc_url_raw( $v );
374
+ $background['image'] = $v;
375
+ break;
376
+ case 'repeat' :
377
+ $v = $this->background_repeat( $v );
378
+ $background['repeat'] = $v;
379
+ break;
380
+ case 'position' :
381
+ $v = $this->background_position( $v );
382
+ $background['position'] = $v;
383
+ break;
384
+ case 'attachment' :
385
+ $v = $this->background_attachment( $v );
386
+ $background['attachment'] = $v;
387
+ break;
388
+ }
389
+ }
390
+
391
+ return $background;
392
+ }
393
+
394
+ public function background_repeat( $value ) {
395
+ $whitelist = array( 'repeat', 'no-repeat', 'repeat-x', 'repeat-y' );
396
+
397
+ if ( in_array( $value, $whitelist ) )
398
+ return $value;
399
+
400
+ return '';
401
+ }
402
+
403
+ public function border_style( $value ) {
404
+ $whitelist = array(
405
+ 'none',
406
+ 'hidden',
407
+ 'dotted',
408
+ 'dashed',
409
+ 'solid',
410
+ 'double',
411
+ 'groove',
412
+ 'ridge',
413
+ 'inset',
414
+ 'outset',
415
+ 'inherit',
416
+ );
417
+
418
+ if ( in_array( $value, $whitelist ) )
419
+ return $value;
420
+
421
+ return 'none';
422
+ }
423
+
424
+ public function background_position( $value ) {
425
+ $whitelist = array(
426
+ 'left top',
427
+ 'left center',
428
+ 'left bottom',
429
+ 'right top',
430
+ 'right center',
431
+ 'right bottom',
432
+ 'center top',
433
+ 'center center',
434
+ 'center bottom',
435
+ );
436
+
437
+ if ( in_array( $value, $whitelist ) )
438
+ return $value;
439
+
440
+ return '';
441
+ }
442
+
443
+ public function background_attachment( $value ) {
444
+ $whitelist = array( 'fixed', 'scroll' );
445
+
446
+ if ( in_array( $value, $whitelist ) )
447
+ return $value;
448
+
449
+ return '';
450
+ }
451
+
452
+ public function hex_color( $color ) {
453
+ if ( '' === $color )
454
+ return '';
455
+
456
+ if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) )
457
+ return $color;
458
+
459
+ return null;
460
+ }
461
+
462
+ /**
463
+ * replace nonalphannumeric charachers with underscore
464
+ * should be safe enought to use as array key
465
+ *
466
+ * @since 3.5.2
467
+ * @access public
468
+ *
469
+ * @param string $key
470
+ * @return string
471
+ */
472
+ public function key( $key ) {
473
+ $key = strtolower( preg_replace( '/[^a-zA-Z0-9]/', '_', $key ) );
474
+
475
+ return $key;
476
+ }
477
+
478
+ /**
479
+ * replace nonalphannumeric charachers with hyphen
480
+ * should be safe enough to use as a CSS id
481
+ *
482
+ * @since 3.5.2
483
+ * @access public
484
+ *
485
+ * @param string $key
486
+ * @return string
487
+ */
488
+ public function id( $id ) {
489
+ $id = strtolower( preg_replace( '/[^a-zA-Z0-9]/', '-', $id ) );
490
+
491
+ return $id;
492
+ }
493
+
494
+ /**
495
+ * return numeric values only
496
+ *
497
+ * @since 3.6
498
+ * @access public
499
+ *
500
+ * @param string $number
501
+ * @return int
502
+ */
503
+ public function number( $number ) {
504
+ $number = (int) preg_replace( "/[^0-9\-]/", "", $number );
505
+
506
+ return $number;
507
+ }
508
+
509
+ /**
510
+ * return decimal number
511
+ *
512
+ * @since 3.6.1
513
+ * @access public
514
+ *
515
+ * @param mixed $number
516
+ * @return void
517
+ */
518
+ public function decimal( $number ) {
519
+ $number = preg_replace( "/[^0-9\.\-]/", "", $number );
520
+
521
+ return $number;
522
+ }
523
+
524
+ /**
525
+ * replace space with plus sign. Should be safe enough
526
+ * to use in Google Font stylesheet link
527
+ *
528
+ * @since 3.5.2
529
+ * @access public
530
+ *
531
+ * @param string $code
532
+ * @return string
533
+ */
534
+ public function google_code( $code ) {
535
+ $code = preg_replace( '/\s/', '+', $code );
536
+
537
+ return $code;
538
+ }
539
+
540
+ /**
541
+ * Parse only friendly characters to use in family name
542
+ * inside css file.
543
+ *
544
+ * @since 3.5.2
545
+ * @access public
546
+ *
547
+ * @param string $name
548
+ * @return string
549
+ */
550
+ public function font_family_name( $name ) {
551
+ $name = preg_replace( '/[^a-zA-Z0-9\-_]/', '', $name );
552
+
553
+ return $name;
554
+ }
555
+
556
+ /**
557
+ * Checkbox should only return 1 or 0
558
+ *
559
+ * @since 3.5.2
560
+ * @access public
561
+ *
562
+ * @param string $val
563
+ * @return void
564
+ */
565
+ public function checkbox( $val ) {
566
+ if ( $val )
567
+ return 1;
568
+ else
569
+ return 0;
570
+ }
571
+
572
+ /**
573
+ * Make sure sidebar is valid
574
+ *
575
+ * @since 3.6.1
576
+ * @access public
577
+ *
578
+ * @param mixed $value
579
+ * @return void
580
+ */
581
+ public function sidebar( $value ) {
582
+ global $wp_registered_sidebars;
583
+
584
+ if ( 'none' == $value )
585
+ return $value;
586
+
587
+ if ( array_key_exists( $value, $wp_registered_sidebars ) )
588
+ return $value;
589
+
590
+ return 'none';
591
+ }
592
+
593
+ /**
594
+ * Sanitize multiple emails
595
+ *
596
+ * @since 3.7.1
597
+ * @access public
598
+ *
599
+ * @param mixed $email
600
+ * @return void
601
+ */
602
+ public function emails( $email ) {
603
+ $valid = array();
604
+
605
+ $email = explode( ',', $email );
606
+
607
+ foreach ( $email as $e ) {
608
+ $e = trim( $e );
609
+ if ( is_email( $e ) )
610
+ $valid[] = $e;
611
+ }
612
+
613
+ if ( ! empty( $valid ) )
614
+ return implode( ',', $valid );
615
+
616
+ return null;
617
+ }
618
+
619
+ public function esc_url_raw( $value ) {
620
+ return esc_url_raw( $value );
621
+ }
622
+
623
+ public function no_sanitize( $value ) {
624
+ return $value;
625
+ }
626
+ }
includes/vendors/wpc-settings-framework/class-wpc-settings-framework.php ADDED
@@ -0,0 +1,526 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace WC_Shortcodes;
3
+
4
+ /**
5
+ * WPC Settings Framework.
6
+ *
7
+ * @package WPC_Settings_Framework
8
+ * @author Chris Baldelomar <chris@webplantmedia.com>
9
+ * @license GPL-2.0+
10
+ * @link http://webplantmedia.com
11
+ * @copyright 2014 Chris Baldelomar
12
+ */
13
+
14
+ /**
15
+ * Settings framework class.
16
+ *
17
+ * @package WPC_Settings_Framework
18
+ * @author Chris Baldelomar <chris@webplantmedia.com>
19
+ */
20
+ class WPC_Settings_Framework {
21
+
22
+ protected $version = '1.0.0';
23
+
24
+ /**
25
+ * Instance of this class.
26
+ *
27
+ * @since 1.0.0
28
+ *
29
+ * @var object
30
+ */
31
+ protected static $instance = null;
32
+ protected $sanitize = null;
33
+ protected $display = null;
34
+
35
+ /**
36
+ * Slug of the plugin screen.
37
+ *
38
+ * @since 1.0.0
39
+ *
40
+ * @var string
41
+ */
42
+ protected $views = array();
43
+
44
+ /**
45
+ * The variable name is used as the text domain when internationalizing strings
46
+ * of text. Its value should match the Text Domain file header in the main
47
+ * plugin file.
48
+ *
49
+ * @since 1.0.0
50
+ *
51
+ * @var string
52
+ */
53
+ protected $plugin_slug = null;
54
+ protected $plugin_prefix = null;
55
+ protected $plugin_version = 0;
56
+ protected $options = array();
57
+ protected $wp_settings_tabs = array();
58
+ protected $tabs = array();
59
+
60
+
61
+ /**
62
+ * Initialize the plugin by loading admin scripts & styles and adding a
63
+ * settings page and menu.
64
+ *
65
+ * @since 1.0.0
66
+ */
67
+ private function __construct() {
68
+
69
+ require_once( 'class-wpc-settings-framework-sanitize.php' );
70
+ $this->sanitize = WPC_Settings_Framework_Sanitize::get_instance();
71
+
72
+ $this->set_slug_prefix();
73
+
74
+ add_action( 'admin_init', array( $this, 'set_plugin_info' ) );
75
+
76
+ add_action( 'init', array( $this, 'set_options' ), 100 );
77
+ add_action( 'admin_init', array( $this, 'options_init' ) );
78
+ add_action( 'admin_init', array( $this, 'options_activation' ), 200 );
79
+ add_action( 'admin_menu', array( $this, 'options_admin_menu' ) );
80
+
81
+ // Load admin style sheet and JavaScript.
82
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
83
+ }
84
+
85
+ /**
86
+ * Return an instance of this class.
87
+ *
88
+ * @since 1.0.0
89
+ *
90
+ * @return object A single instance of this class.
91
+ */
92
+ public static function get_instance() {
93
+
94
+ // If the single instance hasn't been set, set it now.
95
+ if ( null == self::$instance ) {
96
+ self::$instance = new self;
97
+ }
98
+
99
+ return self::$instance;
100
+ }
101
+
102
+ public function set_slug_prefix() {
103
+ $plugin_basename = plugin_basename( __FILE__ );
104
+ $plugin_name = substr( $plugin_basename, 0, strpos( $plugin_basename, '/' ) );
105
+
106
+ if ( empty( $plugin_name ) ) {
107
+ return;
108
+ }
109
+
110
+ $this->plugin_slug = $this->sanitize->id( $plugin_name );
111
+ $this->plugin_prefix = $this->sanitize->key( $plugin_name ) . '_';
112
+ }
113
+
114
+ public function set_plugin_info() {
115
+ $this->plugin_current_version = get_option( $this->plugin_prefix . 'current_version' );
116
+
117
+ $active_plugins = get_option( 'active_plugins' );
118
+ $plugin = get_plugins( '/' . $this->plugin_slug );
119
+ if ( ! empty( $plugin ) ) {
120
+ $plugin = array_shift( $plugin );
121
+ $this->plugin_version = $plugin['Version'];
122
+ }
123
+ }
124
+
125
+ public function set_options() {
126
+ $this->options = apply_filters ( $this->plugin_prefix . 'wpcsf_options' , $this->options );
127
+ }
128
+
129
+ public function options_activation() {
130
+
131
+ $initialize = false;
132
+
133
+ if ( ! $this->plugin_current_version ) {
134
+ $initialize = true;
135
+ }
136
+ else if ( version_compare( $this->plugin_version, $this->plugin_current_version ) > 0 ) {
137
+ $initialize = true;
138
+ }
139
+
140
+ if ( $initialize ) {
141
+ update_option( $this->plugin_prefix . 'current_version', $this->plugin_version );
142
+
143
+ foreach ( $this->options as $menu_slug => $o ) {
144
+ if ( isset( $o['option_group'] ) ) {
145
+ if ( isset( $o['tabs'] ) &&
146
+ is_array( $o['tabs'] ) ) {
147
+ foreach( $o['tabs'] as $key => $oo ) {
148
+ if ( isset( $oo['sections'] ) &&
149
+ is_array( $oo['sections'] ) ) {
150
+ $this->loop_and_init_options( $oo['sections'] );
151
+ }
152
+ }
153
+ }
154
+ else if ( isset( $o['sections'] ) &&
155
+ is_array( $o['sections'] ) ) {
156
+ $this->loop_and_init_options( $o['sections'] );
157
+ }
158
+ }
159
+ }
160
+ }
161
+ }
162
+
163
+ public function loop_and_init_options( $sections ) {
164
+ foreach( $sections as $o ) {
165
+ if ( isset( $o['id'] ) &&
166
+ isset( $o['title'] ) &&
167
+ isset( $o['options'] ) &&
168
+ is_array( $o['options'] ) ) {
169
+ foreach( $o['options'] as $oo ) {
170
+ if ( isset( $oo['group'] ) && is_array( $oo['group'] ) ) {
171
+ foreach ( $oo['group'] as $key => $ooo ) {
172
+ if ( isset( $ooo['option_name'] ) ) {
173
+ $ooo['option_name'] = $this->plugin_prefix . $ooo['option_name'];
174
+ $this->add_option( $ooo['option_name'], $ooo['default'] );
175
+ }
176
+ }
177
+ }
178
+ else {
179
+ if ( isset( $oo['option_name'] ) ) {
180
+ $oo['option_name'] = $this->plugin_prefix . $oo['option_name'];
181
+ $this->add_option( $oo['option_name'], $oo['default'] );
182
+ }
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+
189
+ public function add_option( $option_name, $default ) {
190
+ if ( $this->plugin_prefix . 'social_icons_display' == $option_name ) {
191
+ // $default = wc_shortcodes_default_social_icons();
192
+ // add_option( $option_name, $default );
193
+ }
194
+ else {
195
+ add_option( $option_name, $default );
196
+ }
197
+ }
198
+
199
+ /**
200
+ * Register theme options from user defined options array
201
+ *
202
+ * @since 3.5.2
203
+ * @access public
204
+ *
205
+ * @return void
206
+ */
207
+ public function options_init() {
208
+ register_setting( $this->plugin_slug . '-wpcsf-current-version', $this->plugin_prefix . 'current_version' );
209
+
210
+ foreach ( $this->options as $menu_slug => $o ) {
211
+ if ( isset( $o['option_group'] ) ) {
212
+ if ( isset( $o['tabs'] ) &&
213
+ is_array( $o['tabs'] ) ) {
214
+ foreach( $o['tabs'] as $key => $oo ) {
215
+ if ( isset( $oo['sections'] ) &&
216
+ is_array( $oo['sections'] ) ) {
217
+ $this->loop_sections( $menu_slug, $o['option_group'], $oo['sections'], $oo['id'], $oo['title'] );
218
+ }
219
+ }
220
+ }
221
+ else if ( isset( $o['sections'] ) &&
222
+ is_array( $o['sections'] ) ) {
223
+ $this->loop_sections( $menu_slug, $o['option_group'], $o['sections'] );
224
+ }
225
+ }
226
+ }
227
+ }
228
+
229
+ public function loop_sections( $menu_slug, $option_group, &$sections, $tab_id = null, $tab_title = null ) {
230
+ foreach( $sections as $o ) {
231
+ if ( isset( $o['id'] ) &&
232
+ isset( $o['title'] ) &&
233
+ isset( $o['options'] ) &&
234
+ is_array( $o['options'] ) ) {
235
+ // add_settings_section( $id, $title, $callback, $page );
236
+ // @page should match @menu_slug from add_theme_page
237
+ if ( isset( $o['add_section'] ) && $o['add_section'] ) {
238
+ if ( ! empty( $tab_id ) && ! empty( $tab_title ) ) {
239
+ $this->add_settings_tabs( $tab_id, $tab_title, $o['id'], $o['title'], $menu_slug );
240
+ }
241
+ add_settings_section( $o['id'], $o['title'], '', $menu_slug );
242
+ }
243
+
244
+ foreach( $o['options'] as $oo ) {
245
+ if ( isset( $oo['group'] ) && is_array( $oo['group'] ) ) {
246
+ foreach ( $oo['group'] as $key => $ooo ) {
247
+ if ( isset( $ooo['option_name'] ) ) {
248
+ $ooo['option_name'] = $this->plugin_prefix . $ooo['option_name'];
249
+ $oo['group'][ $key ]['option_name'] = $ooo['option_name'];
250
+
251
+ $callback = $this->get_callback( $ooo );
252
+
253
+ // register_setting( $option_group, $option_name, $callback );
254
+ register_setting( $option_group, $ooo['option_name'], $callback );
255
+ }
256
+ }
257
+ if ( isset( $oo['id'] ) && isset( $oo['title'] ) ) {
258
+ // add_settings_field( $id, $title, $callback, $page, $section, $args );
259
+ // @page should match @menu_slug from add_theme_page
260
+ // @section the section you added with add_settings_section
261
+ add_settings_field($oo['id'], $oo['title'], array( $this, 'display_group' ), $menu_slug, $o['id'], $oo );
262
+ }
263
+ }
264
+ else {
265
+ if ( isset( $oo['option_name'] ) ) {
266
+ $oo['option_name'] = $this->plugin_prefix . $oo['option_name'];
267
+
268
+ $callback = $this->get_callback( $oo );
269
+
270
+ // register_setting( $option_group, $option_name, $callback );
271
+ register_setting( $option_group, $oo['option_name'], $callback );
272
+
273
+ // add_settings_field( $id, $title, $callback, $page, $section, $args );
274
+ // @page should match @menu_slug from add_theme_page
275
+ // @section the section you added with add_settings_section
276
+ add_settings_field( $oo['option_name'], '<label for="'.$oo['option_name'].'">'.$oo['title'].'</label>' , array( $this, 'display_setting' ), $menu_slug, $o['id'], $oo );
277
+ }
278
+ }
279
+ }
280
+ }
281
+ }
282
+ }
283
+
284
+ public function get_callback( &$o ) {
285
+ if ( isset( $o['callback'] ) && ! empty( $o['callback'] ) ) {
286
+ if ( function_exists( $o['callback'] ) ) {
287
+ return $o['callback'];
288
+ }
289
+ }
290
+
291
+ $callback = array(
292
+ $this->sanitize,
293
+ $this->sanitize->callback( $o['type'] ),
294
+ );
295
+
296
+ return $callback;
297
+ }
298
+
299
+ /**
300
+ * Add submenu pages from user defined options array
301
+ *
302
+ * @since 3.5.2
303
+ * @access public
304
+ *
305
+ * @return void
306
+ */
307
+ public function options_admin_menu() {
308
+ if ( ! empty( $this->options ) ) {
309
+ foreach ( $this->options as $menu_slug => $v ) {
310
+ if ( isset( $v['parent_slug'] ) &&
311
+ isset( $v['page_title'] ) &&
312
+ isset( $v['menu_title'] ) &&
313
+ isset( $v['capability'] ) &&
314
+ isset( $v['option_group'] ) ) {
315
+ // add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );
316
+ $view_hook_name = add_submenu_page( $v['parent_slug'], $v['page_title'], $v['menu_title'], $v['capability'], $menu_slug, array( $this, 'display_page' ) );
317
+ $this->views[ $view_hook_name ] = $menu_slug;
318
+ }
319
+ else if ( isset( $v['parent_slug'] ) ) {
320
+ $this->views[ $v['parent_slug'] ] = $menu_slug;
321
+ }
322
+ }
323
+ }
324
+ }
325
+
326
+ public function add_settings_tabs( $id, $title, $section_id, $section_title, $menu_slug ) {
327
+ $this->wp_settings_tabs[ $menu_slug ][ $id ][ $section_id ] = array(
328
+ 'id' => $section_id,
329
+ 'title' => $section_title
330
+ );
331
+
332
+ $this->tabs[ $menu_slug ][ $id ] = array(
333
+ 'id' => $id,
334
+ 'title' => $title,
335
+ );
336
+ }
337
+
338
+ public function fetch_proper_hook_name( $hook ) {
339
+ switch( $hook ) {
340
+ case 'options-general.php' :
341
+ return 'settings_page_general';
342
+ case 'options-writing.php' :
343
+ return 'settings_page_writing';
344
+ case 'options-reading.php' :
345
+ return 'settings_page_reading';
346
+ case 'options-discussion.php' :
347
+ return 'settings_page_discussion';
348
+ case 'options-media.php' :
349
+ return 'settings_page_media';
350
+ case 'options-permalink.php' :
351
+ return 'settings_page_permalink';
352
+ }
353
+
354
+ return $hook;
355
+ }
356
+
357
+ /**
358
+ * Register and enqueue admin-specific JavaScript.
359
+ *
360
+ * @TODO:
361
+ *
362
+ * @since 1.0.0
363
+ *
364
+ * @return null Return early if no settings page is registered.
365
+ */
366
+ public function enqueue_admin_scripts( $hook ) {
367
+
368
+ $hook = $this->fetch_proper_hook_name( $hook );
369
+ // pr($hook);
370
+ // pr($this->views);
371
+
372
+ if ( ! isset( $this->views ) || empty( $this->views ) ) {
373
+ return;
374
+ }
375
+
376
+ if ( array_key_exists( $hook, $this->views ) ) {
377
+ // CSS
378
+ wp_enqueue_style( $this->plugin_slug .'-options-styles', plugins_url( 'css/options.css', __FILE__ ), array(), $this->version );
379
+ wp_enqueue_style( $this->plugin_slug .'-media-uploader-styles', plugins_url( 'css/media-uploader.css', __FILE__ ), array(), $this->version );
380
+ wp_enqueue_style( 'wp-color-picker' );
381
+
382
+ // JS
383
+ wp_enqueue_script( $this->plugin_slug . '-options-script', plugins_url( 'js/options.js', __FILE__ ), array( 'jquery' ), $this->version, true );
384
+ wp_enqueue_media();
385
+ wp_enqueue_script( $this->plugin_slug . '-media-uploader-script', plugins_url( 'js/media-uploader.js', __FILE__ ), array( 'jquery', 'wp-color-picker' ), $this->version, true );
386
+ }
387
+
388
+ }
389
+
390
+ /**
391
+ * Get current filter, check with available views
392
+ * created when adding sub_pages, and return
393
+ * menu slug
394
+ *
395
+ * @since 3.6.1
396
+ * @access public
397
+ *
398
+ * @return void
399
+ */
400
+ function get_current_view() {
401
+ $current_filter = current_filter();
402
+ if ( ! isset ( $this->views[ $current_filter ] ) )
403
+ return false;
404
+
405
+ $menu_slug = $this->views[ $current_filter ];
406
+
407
+ return $menu_slug;
408
+ }
409
+
410
+ /**
411
+ * Display default settings page.
412
+ *
413
+ * @since 3.5.2
414
+ * @access public
415
+ *
416
+ * @return void
417
+ */
418
+ function display_page() {
419
+ if ( ! $menu_slug = $this->get_current_view() )
420
+ return;
421
+
422
+ $o = $this->options[$menu_slug];
423
+ if ( ! empty( $this->wp_settings_tabs ) ) {
424
+ require( 'views/tabs.php' );
425
+ }
426
+ else {
427
+ require( 'views/page.php' );
428
+ }
429
+ }
430
+
431
+ /**
432
+ * Call all the options displays in a given option
433
+ * group
434
+ *
435
+ * @since 3.5.2
436
+ * @access public
437
+ *
438
+ * @param array $args
439
+ * @return void
440
+ */
441
+ function display_group( $args ) {
442
+ require( 'views/group.php' );
443
+ }
444
+
445
+ /**
446
+ * Controls which display function should be called
447
+ * given a option type passed.
448
+ *
449
+ * @since 3.5.2
450
+ * @access public
451
+ *
452
+ * @param array $args
453
+ * @return void
454
+ */
455
+ function display_setting( $args ) {
456
+ if ( ! isset( $args['type'] ) )
457
+ return;
458
+
459
+ if ( ! isset( $args['option_name'] ) )
460
+ return;
461
+
462
+ if ( ! isset( $args['default'] ) )
463
+ return;
464
+
465
+ if ( ! isset( $args['display'] ) || empty( $args['display'] ) )
466
+ $args['display'] = 'default';
467
+
468
+ extract( $args );
469
+ $val = get_option( $option_name, $default );
470
+
471
+ switch ( $args['type'] ) {
472
+ case 'image' :
473
+ require( 'views/settings/image-field.php' );
474
+ break;
475
+ case 'positive_pixel' :
476
+ require( 'views/settings/positive-pixel-input-field.php' );
477
+ break;
478
+ case 'pixel' :
479
+ require( 'views/settings/pixel-input-field.php' );
480
+ break;
481
+ case 'number' :
482
+ require( 'views/settings/number-input-field.php' );
483
+ break;
484
+ case 'decimal' :
485
+ require( 'views/settings/decimal-input-field.php' );
486
+ break;
487
+ case 'radio' :
488
+ require( 'views/settings/custom-radio.php' );
489
+ break;
490
+ case 'checkboxes' :
491
+ require( 'views/settings/custom-checkboxes.php' );
492
+ break;
493
+ case 'dropdown' :
494
+ require( 'views/settings/custom-dropdown.php' );
495
+ break;
496
+ case 'background' :
497
+ require( 'views/settings/background-options.php' );
498
+ break;
499
+ case 'color' :
500
+ require( 'views/settings/color-field.php' );
501
+ break;
502
+ case 'checkbox' :
503
+ require( 'views/settings/checkbox-field.php' );
504
+ break;
505
+ case 'border' :
506
+ require( 'views/settings/border-fields.php' );
507
+ break;
508
+ case 'gallery' :
509
+ require( 'views/settings/gallery-fields.php' );
510
+ break;
511
+ case 'textarea' :
512
+ require( 'views/settings/textarea-field.php' );
513
+ break;
514
+ case 'wp_editor' :
515
+ require( 'views/settings/wp-editor.php' );
516
+ break;
517
+ case 'order_show_hide' :
518
+ require( 'views/settings/order-show-hide.php' );
519
+ break;
520
+ case 'emails' :
521
+ default :
522
+ require( 'views/settings/input-field.php' );
523
+ break;
524
+ }
525
+ }
526
+ }
includes/vendors/wpc-settings-framework/css/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
includes/vendors/wpc-settings-framework/css/media-uploader.css ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Media Upload Popup
3
+ *
4
+ * Could not figure out how to disable the link to field in the
5
+ * media manager, so I'm just hiding it for now
6
+ */
7
+
8
+ /* .wpcsf-custom-uploader .attachment-details, */
9
+ .wpcsf-custom-uploader .attachment-details label.setting,
10
+ .wpcsf-custom-uploader .attachment-display-settings label.setting:nth-child(2),
11
+ .wpcsf-custom-uploader .attachment-display-settings div.setting,
12
+ .wpcsf-custom-uploader .compat-attachment-fields {
13
+ display: none;
14
+ }
15
+
16
+ .wpcsf-custom-uploader-gallery-library .gallery-settings {
17
+ display: none;
18
+ }
includes/vendors/wpc-settings-framework/css/options.css ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * CSS Hacks
3
+ *
4
+ * Needed common CSS trick
5
+ */
6
+
7
+ .wpcsf-clearfix:after {
8
+ visibility: hidden;
9
+ display: block;
10
+ font-size: 0;
11
+ content: " ";
12
+ clear: both;
13
+ height: 0;
14
+ }
15
+
16
+ .wpcsf-clearfix { display: inline-block; }
17
+
18
+ * html .wpcsf-clearfix {
19
+ height: 1%;
20
+ }
21
+
22
+ .wpcsf-clearfix { display: block; }
23
+
24
+
25
+ /**
26
+ * Border Fields
27
+ */
28
+
29
+ .wpcsf-font-hover-fields .wpcsf-text-decoration,
30
+ .wpcsf-border-fields .wpcsf-border-style,
31
+ .wpcsf-border-fields .wp-border-width,
32
+ .wpcsf-border-fields .wp-picker-container {
33
+ margin-bottom: 7px;
34
+ }
35
+
36
+
37
+ /**
38
+ * Media Gallery
39
+ *
40
+ * Styles for media gallery
41
+ */
42
+
43
+ .wpcsf-image-upload {
44
+ padding-left: 5px !important;
45
+ }
46
+ .wpcsf-image-upload .wp-media-buttons-icon {
47
+ background: none repeat scroll 0% 0% transparent;
48
+ display: inline-block;
49
+ width: 18px;
50
+ height: 18px;
51
+ vertical-align: text-top;
52
+ margin: 0px 2px;
53
+ }
54
+ .wpcsf-image-upload .wp-media-buttons-icon:before {
55
+ content: '\f104';
56
+ font: normal 18px/1 'dashicons';
57
+ speak: none;
58
+ -webkit-font-smoothing: antialiased;
59
+ -moz-osx-font-smoothing: grayscale;
60
+ color: #888;
61
+ }
62
+
63
+ .wpcsf-preview-image img {
64
+ max-width: 700px;
65
+ max-height: 200px;
66
+ background: #FAFAFA;
67
+ border-color: #ccc #eee #eee #ccc;
68
+ border-style: solid;
69
+ border-width: 1px;
70
+ padding: 5px;
71
+ }
72
+
73
+ .wpcsf-preview-image {
74
+ margin-bottom: 5px;
75
+ }
76
+
77
+ .wpcsf-upload-font-textarea {
78
+ max-width: 900px;
79
+ height: 210px;
80
+ width: 97%;
81
+ }
82
+
83
+ .wpcsf-social-media-field .button,
84
+ .wpcsf-social-media-field input,
85
+ .wpcsf-image-field .button,
86
+ .wpcsf-image-field input,
87
+ .wpcsf-background-options .button,
88
+ .wpcsf-background-options select,
89
+ .wpcsf-background-options input {
90
+ margin-bottom: 7px;
91
+ }
92
+
93
+
94
+ /**
95
+ * Theme Options Display
96
+ *
97
+ * Specific style for theme options pages
98
+ */
99
+
100
+ .wpcsf-theme-options-display .form-table tr:nth-child(odd) {
101
+ background-color: #f2f2f2;
102
+ }
103
+
104
+ .wpcsf-wp-editor {
105
+ max-width: 900px;
106
+ width: 97%;
107
+ }
108
+
109
+ .wpcsf-textarea {
110
+ max-width: 900px;
111
+ height: 150px;
112
+ width: 97%;
113
+ }
114
+
115
+ /**
116
+ * Nav Tabs
117
+ */
118
+
119
+ .wpcsf-navigation .nav-tab {
120
+ border-bottom: 1px solid #ccc;
121
+ outline: none;
122
+ box-shadow: none;
123
+ }
124
+ .wpcsf-navigation .nav-tab.nav-tab-active {
125
+ border-bottom: 1px solid #f1f1f1;
126
+ }
127
+
128
+ /**
129
+ * Tabs
130
+ */
131
+
132
+ .wpcsf-tab {
133
+ display: none;
134
+ }
135
+ .wpcsf-tab.wpcsf-active-tab {
136
+ display: block;
137
+ }
138
+
139
+ /**
140
+ * Groups
141
+ */
142
+ .wpcsf-group .wpcsf-input-field label,
143
+ .wpcsf-group .wpcsf-image-field label {
144
+ display: inline-block;
145
+ }
146
+ .wpcsf-group .wpcsf-input-field {
147
+ margin-bottom: 5px;
148
+ }
149
+ .wpcsf-group .wpcsf-input-field .description {
150
+ display: inline-block;
151
+ }
includes/vendors/wpc-settings-framework/img/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
includes/vendors/wpc-settings-framework/init.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*----------------------------------------------------------------------------*
3
+ * Dashboard and Administrative Functionality
4
+ *
5
+ * TODO: You must change the namespace here, and in the two class files.
6
+ *----------------------------------------------------------------------------*/
7
+
8
+ if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
9
+
10
+ require_once( 'class-wpc-settings-framework.php' );
11
+
12
+ add_action( 'plugins_loaded', array( 'WC_Shortcodes\\WPC_Settings_Framework', 'get_instance' ) );
13
+ }
includes/vendors/wpc-settings-framework/js/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
includes/{js/admin.js → vendors/wpc-settings-framework/js/media-uploader.js} RENAMED
@@ -1,6 +1,9 @@
1
  /**
2
- * WC Shortcodes Gallery Settings
 
3
  */
 
 
4
  (function($) {
5
  "use strict";
6
 
@@ -21,14 +24,13 @@
21
  });
22
 
23
 
24
- if(options.state === 'gallery-library' && id_array.length && !isNaN(parseInt(id_array[0],10)))
25
- {
26
  options.state = 'gallery-edit';
27
  }
28
  return selection;
29
  };
30
 
31
- $body.on('click', '.wc-shortcodes-image-upload', function( event ) {
32
  event.preventDefault();
33
 
34
  var clicked = $(this),
@@ -56,12 +58,12 @@
56
  selection: prefill
57
  });
58
 
59
- if ( 'wc_shortcodes_insert_single' === options.state ) {
60
  // add the single insert state
61
  file_frame[frame_key].states.add([
62
  // Main states.
63
  new media.controller.Library({
64
- id: 'wc_shortcodes_insert_single',
65
  title: clicked.data( 'title' ),
66
  priority: 20,
67
  toolbar: 'select',
@@ -76,11 +78,11 @@
76
  })
77
  ]);
78
  }
79
- else if ( 'wc_shortcodes_insert_multi' === options.state ) {
80
  // add the single insert state
81
  file_frame[frame_key].states.add([
82
  new media.controller.Library({
83
- id: 'wc_shortcodes_insert_multi',
84
  title: clicked.data( 'title' ),
85
  priority: 20,
86
  toolbar: 'select',
@@ -146,6 +148,9 @@
146
 
147
  if ( target.length ) {
148
  target.val( values.join(',') ).trigger('change');
 
 
 
149
  }
150
 
151
  if ( preview.length ) {
@@ -156,7 +161,7 @@
156
  // Finally, open the modal
157
  file_frame[frame_key].open();
158
  })
159
- .on('click', '.wc-shortcodes-restore-image', function( e ) {
160
  e.preventDefault();
161
 
162
  var clicked = $(this),
@@ -173,8 +178,10 @@
173
  else {
174
  $(preview).html("").hide();
175
  }
 
 
176
  })
177
- .on('click', '.wc-shortcodes-delete-image', function( e ) {
178
  e.preventDefault();
179
 
180
  var clicked = $(this),
@@ -188,10 +195,7 @@
188
  if ( preview.length ) {
189
  $(preview).html("").hide();
190
  }
191
- });
192
-
193
- $(document).ready(function($){
194
- $('.wc-shortcodes-share-buttons').sortable({ axis: "y" });
195
- });
196
 
 
 
197
  })(jQuery);
1
  /**
2
+ * @author Chris Baldelomar
3
+ * @website http://webplantmedia.com/
4
  */
5
+
6
+
7
  (function($) {
8
  "use strict";
9
 
24
  });
25
 
26
 
27
+ if(options.state === 'gallery-library' && id_array.length && !isNaN(parseInt(id_array[0],10))) {
 
28
  options.state = 'gallery-edit';
29
  }
30
  return selection;
31
  };
32
 
33
+ $body.on('click', '.wpcsf-image-upload', function( event ) {
34
  event.preventDefault();
35
 
36
  var clicked = $(this),
58
  selection: prefill
59
  });
60
 
61
+ if ( 'wpc_settings_framework_insert_single' === options.state ) {
62
  // add the single insert state
63
  file_frame[frame_key].states.add([
64
  // Main states.
65
  new media.controller.Library({
66
+ id: 'wpc_settings_framework_insert_single',
67
  title: clicked.data( 'title' ),
68
  priority: 20,
69
  toolbar: 'select',
78
  })
79
  ]);
80
  }
81
+ else if ( 'wpc_settings_framework_insert_multi' === options.state ) {
82
  // add the single insert state
83
  file_frame[frame_key].states.add([
84
  new media.controller.Library({
85
+ id: 'wpc_settings_framework_insert_multi',
86
  title: clicked.data( 'title' ),
87
  priority: 20,
88
  toolbar: 'select',
148
 
149
  if ( target.length ) {
150
  target.val( values.join(',') ).trigger('change');
151
+
152
+ // triggers change in customizer
153
+ target.keyup();
154
  }
155
 
156
  if ( preview.length ) {
161
  // Finally, open the modal
162
  file_frame[frame_key].open();
163
  })
164
+ .on('click', '.wpcsf-restore-image', function( e ) {
165
  e.preventDefault();
166
 
167
  var clicked = $(this),
178
  else {
179
  $(preview).html("").hide();
180
  }
181
+
182
+ $(target).keyup();
183
  })
184
+ .on('click', '.wpcsf-delete-image', function( e ) {
185
  e.preventDefault();
186
 
187
  var clicked = $(this),
195
  if ( preview.length ) {
196
  $(preview).html("").hide();
197
  }
 
 
 
 
 
198
 
199
+ $(target).keyup();
200
+ })
201
  })(jQuery);
includes/vendors/wpc-settings-framework/js/options.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author Chris Baldelomar
3
+ * @website http://wordpresscanvas.com/
4
+ */
5
+
6
+
7
+ (function ($) {
8
+ "use strict";
9
+
10
+ $(document).ready(function() {
11
+ $('.wpcsf-color-field').wpColorPicker();
12
+
13
+ $('.wpcsf-order-show-hide').sortable({ axis: "y" });
14
+
15
+ var $nav = $('.wpcsf-navigation');
16
+ if ( $nav.length > 0 ) {
17
+ var $navTab = $nav.find('.nav-tab');
18
+ var $pageTab = $('.wpcsf-tab');
19
+
20
+ var cookieName = $nav.data('cookieName');
21
+
22
+ $navTab.click( function( event ) {
23
+ event.preventDefault();
24
+
25
+ var $this = $(this);
26
+
27
+ var target = $this.data('target');
28
+ if ( 'string' == typeof target ) {
29
+ $navTab.removeClass('nav-tab-active');
30
+ $pageTab.removeClass('wpcsf-active-tab');
31
+
32
+ $navTab.filter('#nav-'+target).addClass('nav-tab-active');
33
+ $pageTab.filter('#'+target).addClass('wpcsf-active-tab');
34
+
35
+ if ( 'string' == typeof cookieName ) {
36
+ wpCookies.set( cookieName, target, 7 * 24 * 60 * 60 );
37
+ }
38
+ }
39
+
40
+ $('.wpcsf-tab-wrap .updated.settings-error').hide();
41
+
42
+ return false;
43
+ });
44
+ }
45
+ });
46
+ }(jQuery));
includes/vendors/wpc-settings-framework/views/group.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="wpcsf-<?php echo $args['id']; ?>-group" class="wpcsf-group">
2
+
3
+ <?php foreach ( $args['group'] as $g ) : ?>
4
+ <?php $this->display_setting( $g ); ?>
5
+ <?php endforeach; ?>
6
+
7
+ <?php if ( isset( $args['description'] ) ) : ?>
8
+ <p class="description"><?php echo $args['description']; ?></p>
9
+ <?php endif; ?>
10
+
11
+ </div>
includes/vendors/wpc-settings-framework/views/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
includes/vendors/wpc-settings-framework/views/page.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap wpcsf-wrap">
2
+ <?php screen_icon(); ?>
3
+ <h2 id="theme-options-heading"><?php echo esc_html( $o['page_title'] ); ?></h2>
4
+
5
+ <?php if ( isset( $_GET['settings-updated'] ) ) : ?>
6
+ <div id="message" class="updated"><p><strong><?php _e( 'Settings saved.', 'wpc-settings-framework' ) ?></strong></p></div>
7
+ <?php endif; ?>
8
+
9
+ <form id="wpcsf-options" method="post" action="options.php">
10
+ <?php
11
+ // settings_fields( $option_group )
12
+ // @option_group A settings group name. This should match the group name used in register_setting()
13
+ settings_fields( $o['option_group'] );
14
+
15
+ // do_settings_fields( $page, $section )
16
+ // @page Slug title of the admin page whose settings fields you want to show, should match the group name used in add_settings_section()
17
+ // @section Slug title of the settings section whose fields you want to show. This should match the section ID used in add_settings_section()
18
+ //do_settings_fields( 'webpm-select-template', 'webpm-template-section' );
19
+
20
+ // do_settings_sections( $page )
21
+ // The slug name of the page whose settings sections you want to output. This should match the page name used in add_settings_section()
22
+ do_settings_sections( $menu_slug );
23
+ ?>
24
+
25
+ <p class="submit">
26
+ <?php submit_button( null, 'primary', 'submit', false ); ?>
27
+ <?php //submit_button( 'Restore Default Settings', 'delete', 'submit', false ); ?>
28
+ </p>
29
+ </form>
30
+ </div>
includes/vendors/wpc-settings-framework/views/settings-error.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ wp_reset_vars( array( 'action' ) );
3
+
4
+ if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {
5
+ // For backwards compat with plugins that don't use the Settings API and just set updated=1 in the redirect
6
+ add_settings_error( $menu_slug, 'settings_updated', __('Settings saved.'), 'updated' );
7
+ }
8
+
9
+ settings_errors();
10
+ ?>
includes/vendors/wpc-settings-framework/views/settings/background-options.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // preview image default style
3
+ $style = '';
4
+ if ( empty( $val['image'] ) )
5
+ $style = ' style="display:none"';
6
+ ?>
7
+
8
+ <div class="wpcsf-background-options">
9
+ <?php // Background Image ?>
10
+ <input name="<?php echo $option_name; ?>[image]" id="<?php echo $option_name; ?>" class="regular-text ltr upload-input" type="text" value="<?php echo esc_attr( $val['image'] ); ?>" />
11
+ <br />
12
+ <a class="button wpcsf-image-upload" data-target="#<?php echo $option_name; ?>" data-preview=".wpcsf-preview-image" data-frame="select" data-state="wpc_settings_framework_insert_single" data-fetch="url" data-title="Insert Image" data-button="Insert" data-class="media-frame wpcsf-custom-uploader" title="Add Media"><span class="wp-media-buttons-icon"></span> Add Media</a>
13
+ <a class="button wpcsf-restore-image" data-restore="<?php echo esc_attr( $default['image'] ); ?>" data-target="#<?php echo $option_name; ?>" data-preview=".wpcsf-preview-image">Default</a>
14
+ <a class="button wpcsf-delete-image" data-target="#<?php echo $option_name; ?>" data-preview=".wpcsf-preview-image">Delete</a>
15
+ <br />
16
+ <p class="wpcsf-preview-image"<?php echo $style; ?>><img src="<?php echo esc_attr( $val['image'] ); ?>" /></p>
17
+
18
+ <?php // Background Repeat ?>
19
+ <select name="<?php echo $option_name; ?>[repeat]" >
20
+ <option value="repeat" <?php selected( $val['repeat'], 'repeat'); ?>>Repeat</option>
21
+ <option value="repeat-x" <?php echo selected( $val['repeat'], 'repeat-x', false ); ?>>Repeat Horizontal</option>
22
+ <option value="repeat-y" <?php echo selected( $val['repeat'], 'repeat-y', false ); ?>>Repeat Vertical</option>
23
+ <option value="no-repeat" <?php echo selected( $val['repeat'], 'no-repeat', false ); ?>>No Repeat</option>
24
+ <option value="" <?php selected( $val['repeat'], ''); ?>>Inherit</option>
25
+ </select>
26
+
27
+ <?php // Background position ?>
28
+ <select name="<?php echo $option_name; ?>[position]" >
29
+ <option value="left top" <?php selected( $val['position'], 'left top'); ?>>Left Top</option>
30
+ <option value="left center" <?php selected( $val['position'], 'left center'); ?>>Left Center</option>
31
+ <option value="left bottom" <?php selected( $val['position'], 'left bottom'); ?>>Left Bottom</option>
32
+ <option value="right top" <?php selected( $val['position'], 'right top'); ?>>Right Top</option>
33
+ <option value="right center" <?php selected( $val['position'], 'right center'); ?>>Right Center</option>
34
+ <option value="right bottom" <?php selected( $val['position'], 'right bottom'); ?>>Right Bottom</option>
35
+ <option value="center top" <?php selected( $val['position'], 'center top'); ?>>Center Top</option>
36
+ <option value="center center" <?php selected( $val['position'], 'center center'); ?>>Center Center</option>
37
+ <option value="center bottom" <?php selected( $val['position'], 'center bottom'); ?>>Center Bottom</option>
38
+ <option value="" <?php selected( $val['position'], ''); ?>>Inherit</option>
39
+ </select>
40
+
41
+ <?php // Background Attachment ?>
42
+ <select name="<?php echo $option_name; ?>[attachment]" >
43
+ <option value="scroll" <?php selected( $val['attachment'], 'scroll'); ?>>Scroll</option>
44
+ <option value="fixed" <?php selected( $val['attachment'], 'fixed'); ?>>Fixed</option>
45
+ <option value="" <?php selected( $val['attachment'], ''); ?>>Inherit</option>
46
+ </select>
47
+ <br />
48
+
49
+ <?php // Background Color ?>
50
+ <input name="<?php echo $option_name; ?>[color]" type="text" value="<?php echo $val['color']; ?>" class="wpcsf-color-field" data-default-color="<?php echo $default['color']; ?>" />
51
+
52
+ <?php // Description ?>
53
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
54
+ <p class="description"><?php echo $description; ?></p>
55
+ <?php endif; ?>
56
+ </div>
includes/vendors/wpc-settings-framework/views/settings/border-fields.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $val = wp_parse_args( $val, $default );
3
+ $val['width'] = preg_replace("/[^0-9]/", "",$val['width']);
4
+ ?>
5
+
6
+ <div class="wpcsf-border-fields">
7
+ <?php // Border Width ?>
8
+ <label for="<?php echo $option_name; ?>_width">Width</label>&nbsp;
9
+ <input type="number" min="0" class="wpcsf-border-width small-text" name="<?php echo $option_name; ?>[width]" id="<?php echo $option_name; ?>_width" value="<?php echo esc_attr($val['width']); ?>" />&nbsp;
10
+
11
+ <?php // Border Style ?>
12
+ <label for="<?php echo $option_name; ?>_style">Style</label>&nbsp;
13
+ <select name="<?php echo $option_name; ?>[style]" class="wpcsf-border-style" id="<?php echo $option_name; ?>_style" >
14
+ <option value="none" <?php selected( $val['style'], 'none'); ?>>None</option>
15
+ <option value="dotted" <?php selected( $val['style'], 'dotted'); ?>>Dotted</option>
16
+ <option value="dashed" <?php selected( $val['style'], 'dashed'); ?>>Dashed</option>
17
+ <option value="solid" <?php selected( $val['style'], 'solid'); ?>>Solid</option>
18
+ <option value="double" <?php selected( $val['style'], 'double'); ?>>Double</option>
19
+ </select>&nbsp;
20
+ <br />
21
+
22
+ <input name="<?php echo $option_name; ?>[color]" type="text" value="<?php echo esc_attr( $val['color'] ); ?>" class="wpcsf-color-field" data-default-color="<?php echo $default['color']; ?>" />
23
+
24
+ <?php // Description ?>
25
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
26
+ <p class="description"><?php echo $description; ?></p>
27
+ <?php endif; ?>
28
+ </div>
includes/vendors/wpc-settings-framework/views/settings/checkbox-field.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( isset( $label ) ) : ?>
2
+ <label for="<?php echo esc_attr($option_name); ?>">
3
+ <?php endif; ?>
4
+
5
+ <input name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>" type="checkbox" value="1" <?php checked( true, $val ); ?> />
6
+
7
+ <?php if ( isset( $label ) ) : ?>
8
+ &nbsp;<?php echo $label; ?></label>&nbsp;
9
+ <?php endif; ?>
10
+
11
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
12
+ <p class="description"><?php echo $description; ?></p>
13
+ <?php endif; ?>
includes/vendors/wpc-settings-framework/views/settings/color-field.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( isset( $label ) ) : ?>
2
+ <label for="<?php echo $option_name; ?>"><?php echo $label; ?></label>&nbsp;
3
+ <?php endif; ?>
4
+
5
+ <input name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>" type="text" value="<?php echo esc_attr( $val ); ?>" class="wpcsf-color-field" data-default-color="<?php echo $default; ?>" /><br />
6
+
7
+ <?php // Description ?>
8
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
9
+ <p class="description"><?php echo $description; ?></p>
10
+ <?php endif; ?>
includes/vendors/wpc-settings-framework/views/settings/custom-checkboxes.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $val = is_array( $val ) ? $val : array();
3
+
4
+ if ( isset( $options_callback ) && ! empty( $options_callback ) )
5
+ $options = call_user_func( $options_callback );
6
+ ?>
7
+
8
+ <?php foreach ( $options as $key => $name ) : ?>
9
+ <label>
10
+ <?php $checked = in_array( $key, $val ) ? ' checked="checked"' : ''; ?>
11
+ <input name="<?php echo $option_name; ?>[]" type="checkbox" value="<?php echo $key; ?>" <?php echo $checked; ?> />
12
+ <?php echo $name; ?></label><br />
13
+ <?php endforeach; ?>
14
+
15
+ <?php // Description ?>
16
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
17
+ <p class="description"><?php echo $description; ?></p>
18
+ <?php endif; ?>
includes/vendors/wpc-settings-framework/views/settings/custom-dropdown.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( isset( $options_callback ) && ! empty( $options_callback ) )
3
+ $options = call_user_func( $options_callback );
4
+ ?>
5
+
6
+ <?php if ( isset( $label ) ) : ?>
7
+ <label for="<?php echo $option_name; ?>"><?php echo $label; ?></label>&nbsp;
8
+ <?php endif; ?>
9
+
10
+ <select name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>">
11
+ <?php foreach ( $options as $key => $name ) : ?>
12
+ <option value="<?php echo $key; ?>" <?php selected( $val, $key); ?>><?php echo $name; ?></option>
13
+ <?php endforeach; ?>
14
+ </select>&nbsp;
15
+
16
+ <?php // Description ?>
17
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
18
+ <p class="description"><?php echo $description; ?></p>
19
+ <?php endif; ?>
includes/vendors/wpc-settings-framework/views/settings/custom-radio.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( isset( $options_callback ) && ! empty( $options_callback ) )
3
+ $options = call_user_func( $options_callback );
4
+ ?>
5
+
6
+ <?php foreach ( $options as $key => $name ) : ?>
7
+ <label>
8
+ <input name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>" type="radio" value="<?php echo $key; ?>" <?php checked( $val, $key ); ?> />
9
+ <?php echo $name; ?></label><br />
10
+ <?php endforeach; ?>
11
+
12
+ <?php // Description ?>
13
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
14
+ <p class="description"><?php echo $description; ?></p>
15
+ <?php endif; ?>
includes/vendors/wpc-settings-framework/views/settings/decimal-input-field.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $val = preg_replace("/[^0-9\.\-]/", "",$val);
3
+ ?>
4
+
5
+ <?php if ( isset( $label ) ) : ?>
6
+ <label for="<?php echo $option_name; ?>"><?php echo $label; ?></label>&nbsp;
7
+ <?php endif; ?>
8
+
9
+ <input type="number" class="small-text" step="any" name="<?php echo esc_attr($option_name); ?>" id="<?php echo $option_name; ?>" value="<?php echo esc_attr($val); ?>" />&nbsp;
10
+
11
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
12
+ <p class="description"><?php echo $description; ?></p>
13
+ <?php endif; ?>
includes/vendors/wpc-settings-framework/views/settings/gallery-fields.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // preview image default style
3
+ $style = '';
4
+ if ( empty( $val['image'] ) )
5
+ $style = ' style="display:none"';
6
+ ?>
7
+
8
+ <div class="wpcsf-image-field">
9
+ <input name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>" class="regular-text ltr upload-input" type="hidden" value="<?php echo esc_attr($val); ?>" />
10
+ <a class="button wpcsf-image-upload" data-target="#<?php echo $option_name; ?>" data-preview=".wpcsf-preview-image" data-frame="post" data-state="gallery-library" data-fetch="id" data-imgsize="thumbnail" data-title="Insert Gallery" data-button="Insert" data-class="media-frame wpcsf-custom-uploader-gallery-library" title="Add Media"><span class="wp-media-buttons-icon"></span> Add Media</a>
11
+ <a class="button wpcsf-delete-image" data-target="#<?php echo $option_name; ?>" data-preview=".wpcsf-preview-image">Delete</a>
12
+ <p class="wpcsf-preview-image"<?php echo $style; ?>>
13
+ <?php $ids = explode( ',', $val ); ?>
14
+ <?php foreach ( $ids as $id ) : ?>
15
+ <?php $src = wp_get_attachment_image_src( $id, 'thumbnail', false ); ?>
16
+ <img src="<?php echo $src[0]; ?>" />
17
+ <?php endforeach; ?>
18
+ </p>
19
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
20
+ <p class="description"><?php echo $description; ?></p>
21
+ <?php endif; ?>
22
+ </div>
includes/vendors/wpc-settings-framework/views/settings/image-field.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // preview image default style
3
+ $style = '';
4
+ if ( empty( $val['image'] ) )
5
+ $style = ' style="display:none"';
6
+ ?>
7
+
8
+ <div class="wpcsf-image-field">
9
+ <?php if ( isset( $label ) ) : ?>
10
+ <label for="<?php echo esc_attr($option_name); ?>"><?php echo $label; ?></label>&nbsp;
11
+ <?php endif; ?>
12
+
13
+ <input name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>" class="regular-text ltr upload-input" type="text" value="<?php echo esc_attr($val); ?>" />
14
+ <br />
15
+ <a class="button wpcsf-image-upload" data-target="#<?php echo $option_name; ?>" data-preview=".wpcsf-preview-image" data-frame="select" data-state="wpc_settings_framework_insert_single" data-fetch="url" data-title="Insert Image" data-button="Insert" data-class="media-frame wpcsf-custom-uploader" title="Add Media"><span class="wp-media-buttons-icon"></span> Add Media</a>
16
+ <a class="button wpcsf-restore-image" data-restore="<?php echo $default; ?>" data-target="#<?php echo $option_name; ?>" data-preview=".wpcsf-preview-image">Default</a>
17
+ <a class="button wpcsf-delete-image" data-target="#<?php echo $option_name; ?>" data-preview=".wpcsf-preview-image">Delete</a>
18
+ <p class="wpcsf-preview-image"<?php echo $style; ?>><img src="<?php echo esc_attr($val); ?>" /></p>
19
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
20
+ <p class="description"><?php echo $description; ?></p>
21
+ <?php endif; ?>
22
+ </div>
23
+ <?php
includes/vendors/wpc-settings-framework/views/settings/input-field.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wpcsf-input-field">
2
+ <?php if ( isset( $label ) ) : ?>
3
+ <label for="<?php echo esc_attr($option_name); ?>"><?php echo $label; ?></label>&nbsp;
4
+ <?php endif; ?>
5
+
6
+ <input name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>" type="text" value="<?php echo esc_attr($val); ?>" class="regular-text" />
7
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
8
+ <p class="description"><?php echo $description; ?></p>
9
+ <?php endif; ?>
10
+ </div>
includes/vendors/wpc-settings-framework/views/settings/number-input-field.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $val = (int) preg_replace("/[^0-9\-]/", "",$val);
3
+ ?>
4
+
5
+ <?php if ( isset( $label ) ) : ?>
6
+ <label for="<?php echo $option_name; ?>"><?php echo $label; ?></label>&nbsp;
7
+ <?php endif; ?>
8
+
9
+ <input type="number" class="small-text" step="1" name="<?php echo esc_attr($option_name); ?>" id="<?php echo $option_name; ?>" value="<?php echo esc_attr($val); ?>" />&nbsp;
10
+
11
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
12
+ <p class="description"><?php echo $description; ?></p>
13
+ <?php endif; ?>
includes/vendors/wpc-settings-framework/views/settings/order-show-hide.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $not_selected = $default;
3
+ ?>
4
+
5
+ <?php if ( isset( $label ) ) : ?>
6
+ <label for="<?php echo esc_attr($option_name); ?>"><?php echo $label; ?></label>&nbsp;
7
+ <?php endif; ?>
8
+
9
+ <ul class="wpcsf-clearfix wpcsf-order-show-hide">
10
+ <?php if ( is_array( $val ) && ! empty( $val ) ) : ?>
11
+ <?php foreach ( $val as $key => $name ) : ?>
12
+ <li>
13
+ <p style="width:300px;background-color:#f7f7f7;border:1px solid #dfdfdf;padding:5px 5px;line-height:1;margin:0;text-align:left;cursor:move;">
14
+ <input type="checkbox" name="<?php echo $option_name; ?>[<?php echo $key; ?>]" value="<?php echo $name; ?>" <?php checked( true, true ); ?> />
15
+ <?php echo $name; ?>
16
+ </p>
17
+ </li>
18
+ <?php unset( $not_selected[ $key ] ); ?>
19
+ <?php endforeach; ?>
20
+ <?php endif; ?>
21
+
22
+ <?php foreach ( $not_selected as $key => $name ) : ?>
23
+ <li>
24
+ <p style="width:300px;background-color:#f7f7f7;border:1px solid #dfdfdf;padding:5px 5px;line-height:1;margin:0;text-align:left;cursor:move;">
25
+ <input type="checkbox" name="<?php echo $option_name; ?>[<?php echo $key; ?>]" value="<?php echo $name; ?>" <?php checked( true, false ); ?> />
26
+ <?php echo $name; ?>
27
+ </p>
28
+ </li>
29
+ <?php unset( $not_selected[ $key ] ); ?>
30
+ <?php endforeach; ?>
31
+ </ul>
32
+
33
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
34
+ <p class="description"><?php echo $description; ?></p>
35
+ <?php endif; ?>
includes/vendors/wpc-settings-framework/views/settings/pixel-input-field.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $val = preg_replace("/[^0-9\-]/", "",$val);
3
+ ?>
4
+
5
+ <?php if ( isset( $label ) ) : ?>
6
+ <label for="<?php echo $option_name; ?>"><?php echo $label; ?></label>&nbsp;
7
+ <?php endif; ?>
8
+
9
+ <input type="number" class="small-text" name="<?php echo esc_attr($option_name); ?>" id="<?php echo $option_name; ?>" value="<?php echo esc_attr($val); ?>" />&nbsp;
10
+
11
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
12
+ <p class="description"><?php echo $description; ?></p>
13
+ <?php endif; ?>
includes/vendors/wpc-settings-framework/views/settings/positive-pixel-input-field.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $val = preg_replace("/[^0-9]/", "",$val);
3
+ ?>
4
+
5
+ <?php if ( isset( $label ) ) : ?>
6
+ <label for="<?php echo $option_name; ?>"><?php echo $label; ?></label>&nbsp;
7
+ <?php endif; ?>
8
+
9
+ <input type="number" min="0" class="small-text" name="<?php echo esc_attr($option_name); ?>" id="<?php echo $option_name; ?>" value="<?php echo esc_attr($val); ?>" />&nbsp;
10
+
11
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
12
+ <p class="description"><?php echo $description; ?></p>
13
+ <?php endif; ?>
includes/vendors/wpc-settings-framework/views/settings/textarea-field.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php if ( isset( $label ) ) : ?>
2
+ <label for="<?php echo esc_attr($option_name); ?>"><?php echo $label; ?></label>&nbsp;
3
+ <?php endif; ?>
4
+
5
+ <textarea name="<?php echo $option_name; ?>" class="wpcsf-textarea" id="<?php echo $option_name; ?>"><?php echo esc_textarea($val); ?></textarea>
6
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
7
+ <p class="description"><?php echo $description; ?></p>
8
+ <?php endif; ?>
includes/vendors/wpc-settings-framework/views/settings/wp-editor.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( isset( $label ) ) : ?>
2
+ <label for="<?php echo esc_attr($option_name); ?>"><?php echo $label; ?></label>&nbsp;
3
+ <?php endif; ?>
4
+
5
+ <div class="wpcsf-wp-editor">
6
+ <?php wp_editor( $val, $option_name ); ?>
7
+ </div>
8
+
9
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
10
+ <p class="description"><?php echo $description; ?></p>
11
+ <?php endif; ?>
includes/vendors/wpc-settings-framework/views/tabs.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $active_tab = null;
3
+ $cookie_name = $this->plugin_prefix . 'wpcsf_active_tab';
4
+
5
+ // restore last tab visited
6
+ if ( empty( $active_tab ) && isset( $_COOKIE[ $cookie_name ] ) && ! empty( $_COOKIE[ $cookie_name ] ) ) {
7
+ $last_tab = $_COOKIE[ $cookie_name ];
8
+ if ( isset( $this->tabs[ $menu_slug ][ $last_tab ] ) ) {
9
+ $active_tab = $last_tab;
10
+ }
11
+ }
12
+ ?>
13
+ <div class="wrap wpcsf-wrap wpcsf-tab-wrap">
14
+ <?php screen_icon(); ?>
15
+ <?php
16
+ $links = array();
17
+ foreach( $this->wp_settings_tabs[ $menu_slug ] as $tab_id => $tab ) :
18
+ $tab_title = 'No Title';
19
+ if ( isset( $this->tabs[ $menu_slug ][ $tab_id ]['title'] ) ) {
20
+ $tab_title = $this->tabs[ $menu_slug ][ $tab_id ]['title'];
21
+ }
22
+ if ( empty( $active_tab ) || $tab_id == $active_tab ) {
23
+ $active_tab = $tab_id;
24
+
25
+ $links[] = "<a id='nav-{$tab_id}' class='nav-tab nav-tab-active' data-target='{$tab_id}' href='#'>{$tab_title}</a>";
26
+ }
27
+ else {
28
+ $links[] = "<a id='nav-{$tab_id}' class='nav-tab' data-target='{$tab_id}' href='#'>{$tab_title}</a>";
29
+ }
30
+ endforeach;
31
+ ?>
32
+ <h2 class="wpcsf-navigation nav-tab-wrapper" data-cookie-name="<?php echo $cookie_name; ?>">
33
+ <?php echo implode( '', $links ); ?>
34
+ </h2>
35
+
36
+ <?php require( 'settings-error.php' ); ?>
37
+
38
+ <form id="wpcsf-options" method="post" action="options.php">
39
+ <?php
40
+ // settings_fields( $option_group )
41
+ // @option_group A settings group name. This should match the group name used in register_setting()
42
+ settings_fields( $o['option_group'] );
43
+
44
+ // do_settings_fields( $page, $section )
45
+ // @page Slug title of the admin page whose settings fields you want to show, should match the group name used in add_settings_section()
46
+ // @section Slug title of the settings section whose fields you want to show. This should match the section ID used in add_settings_section()
47
+ //do_settings_fields( 'webpm-select-template', 'webpm-template-section' );
48
+
49
+ // do_settings_sections( $page )
50
+ // The slug name of the page whose settings sections you want to output. This should match the page name used in add_settings_section()
51
+ global $wp_settings_sections, $wp_settings_fields;
52
+
53
+ if ( ! isset( $wp_settings_sections[$menu_slug] ) )
54
+ return;
55
+
56
+ foreach ( (array) $this->wp_settings_tabs[$menu_slug] as $tab_id => $tab ) {
57
+ $class = array();
58
+ $class[] = 'wpcsf-tab';
59
+ if ( $active_tab == $tab_id ) {
60
+ $class[] = 'wpcsf-active-tab';
61
+ }
62
+ echo "<div class='".implode( $class, ' ' )."' id='{$tab_id}'>\n";
63
+
64
+ foreach( $tab as $section ) {
65
+ if ( $section['title'] )
66
+ echo "<h3>{$section['title']}</h3>\n";
67
+
68
+ if ( ! isset( $wp_settings_fields ) || !isset( $wp_settings_fields[$menu_slug] ) || !isset( $wp_settings_fields[$menu_slug][$section['id']] ) )
69
+ continue;
70
+
71
+ echo '<table class="form-table">';
72
+ do_settings_fields( $menu_slug, $section['id'] );
73
+ echo '</table>';
74
+ }
75
+
76
+ echo '</div>';
77
+ }
78
+ ?>
79
+
80
+ <p class="submit">
81
+ <?php submit_button( null, 'primary', 'submit', false ); ?>
82
+ <?php //submit_button( 'Restore Default Settings', 'delete', 'submit', false ); ?>
83
+ </p>
84
+ </form>
85
+ </div>
includes/widgets.php CHANGED
@@ -23,7 +23,7 @@ add_action('widgets_init', 'wc_shortcodes_register_widgets');
23
  class WC_Shortcodes_Social_Icons_Widget extends WP_Widget {
24
  function __construct() {
25
  $widget_ops = array( 'description' => __('Add your social icons to your sidebar.') );
26
- parent::__construct( 'wc_shortcodes_social_icons', __('WP Canvas - Social Media Image Icons'), $widget_ops );
27
  }
28
 
29
  function widget($args, $instance) {
@@ -93,7 +93,7 @@ class WC_Shortcodes_Social_Icons_Widget extends WP_Widget {
93
 
94
  $html .= '<li class="wc-shortcodes-social-icon wc-shortcode-social-icon-' . $key . $first_class . '">';
95
  $html .='<a target="_blank" href="'.$social_link.'">';
96
- $html .= '<img src="'.$icon_url.'">';
97
  $html .= '</a>';
98
  $html .= '</li>';
99
  }
23
  class WC_Shortcodes_Social_Icons_Widget extends WP_Widget {
24
  function __construct() {
25
  $widget_ops = array( 'description' => __('Add your social icons to your sidebar.') );
26
+ parent::__construct( 'wc_shortcodes_social_icons', __('WP Canvas - Social Media Icons'), $widget_ops );
27
  }
28
 
29
  function widget($args, $instance) {
93
 
94
  $html .= '<li class="wc-shortcodes-social-icon wc-shortcode-social-icon-' . $key . $first_class . '">';
95
  $html .='<a target="_blank" href="'.$social_link.'">';
96
+ $html .= '<img src="'.$icon_url.'" alt="'.$name.'">';
97
  $html .= '</a>';
98
  $html .= '</li>';
99
  }
readme.txt CHANGED
@@ -56,7 +56,7 @@ Thank you so much for even considering supporting my work. If you have benefited
56
  1. Uzip the `wc-shortcodes.zip` folder.
57
  2. Upload the `wc-shortcodes` folder to your `/wp-content/plugins` directory.
58
  3. In your WordPress dashboard, head over to the *Plugins* section.
59
- 4. Activate *WordPress Canvas Shortcodes*.
60
 
61
  == Frequently Asked Questions ==
62
 
@@ -88,6 +88,16 @@ Use the shortcode manager in the TinyMCE text editor
88
 
89
  == Changelog ==
90
 
 
 
 
 
 
 
 
 
 
 
91
  = Version 1.57 =
92
 
93
  * Fixed overflow style bug with wc_posts
56
  1. Uzip the `wc-shortcodes.zip` folder.
57
  2. Upload the `wc-shortcodes` folder to your `/wp-content/plugins` directory.
58
  3. In your WordPress dashboard, head over to the *Plugins* section.
59
+ 4. Activate *WP Canvas - Shortcodes*.
60
 
61
  == Frequently Asked Questions ==
62
 
88
 
89
  == Changelog ==
90
 
91
+ = Version 1.58 =
92
+
93
+ * Added date_format attribute to posts shortcode
94
+ * Added alt text to social icon images thus fixing validation errors
95
+ * adding settings link in plugin list page
96
+ * Added Print Share Button Option
97
+ * New options framework library
98
+ * Changed name of social media image icon widget
99
+ * Code cleanup
100
+
101
  = Version 1.57 =
102
 
103
  * Fixed overflow style bug with wc_posts
wc-shortcodes.php CHANGED
@@ -5,16 +5,17 @@ Plugin URI: http://webplantmedia.com/starter-themes/wordpresscanvas/features/sho
5
  Description: A family of shortcodes to enhance site functionality.
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
- Version: 1.57
9
  License: GPLv2 or later
10
  */
11
 
12
- define( 'WC_SHORTCODES_VERSION', '1.57' );
13
  define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
14
  define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
15
  define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
16
  define( 'WC_SHORTCODES_CURRENT_VERSION', get_option( WC_SHORTCODES_PREFIX . 'current_version' ) );
17
  define( 'WC_SHORTCODES_FONT_AWESOME_ENABLED', get_option( WC_SHORTCODES_PREFIX . 'enable_font_awesome', true ) );
 
18
 
19
  global $wc_shortcodes_options;
20
  global $wc_shortcodes_social_icons;
@@ -45,6 +46,7 @@ $wc_shortcodes_share_buttons = array(
45
  'twitter' => 'Twitter',
46
  'google' => 'Google',
47
  'email' => 'Email',
 
48
  );
49
  $wc_shortcodes_theme_support = array(
50
  'fullwidth_container' => '#main',
@@ -93,11 +95,14 @@ $wc_shortcodes_theme_support = array(
93
  'email_share_text' => 'Email',
94
  'email_share_font_icon' => 'fa-envelope',
95
  'email_share_button' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/email.png',
 
 
 
96
  );
97
 
 
98
  require_once( dirname(__FILE__) . '/includes/options.php' ); // define options array
99
  require_once( dirname(__FILE__) . '/includes/functions.php' ); // Adds basic filters and actions
100
- require_once( dirname(__FILE__) . '/includes/settings.php' ); // Adds settings
101
  require_once( dirname(__FILE__) . '/includes/scripts.php' ); // Adds plugin JS and CSS
102
  require_once( dirname(__FILE__) . '/includes/shortcode-functions.php'); // Main shortcode functions
103
  require_once( dirname(__FILE__) . '/includes/mce/shortcodes_tinymce.php'); // Add mce buttons to post editor
5
  Description: A family of shortcodes to enhance site functionality.
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
+ Version: 1.58
9
  License: GPLv2 or later
10
  */
11
 
12
+ define( 'WC_SHORTCODES_VERSION', '1.58' );
13
  define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
14
  define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
15
  define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
16
  define( 'WC_SHORTCODES_CURRENT_VERSION', get_option( WC_SHORTCODES_PREFIX . 'current_version' ) );
17
  define( 'WC_SHORTCODES_FONT_AWESOME_ENABLED', get_option( WC_SHORTCODES_PREFIX . 'enable_font_awesome', true ) );
18
+ define( 'WC_SHORTCODES_PLUGIN_BASENAME', plugin_basename( plugin_dir_path( realpath( __FILE__ ) ) . 'wc-shortcodes.php' ) );
19
 
20
  global $wc_shortcodes_options;
21
  global $wc_shortcodes_social_icons;
46
  'twitter' => 'Twitter',
47
  'google' => 'Google',
48
  'email' => 'Email',
49
+ 'print' => 'Print',
50
  );
51
  $wc_shortcodes_theme_support = array(
52
  'fullwidth_container' => '#main',
95
  'email_share_text' => 'Email',
96
  'email_share_font_icon' => 'fa-envelope',
97
  'email_share_button' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/email.png',
98
+ 'print_share_text' => 'Print',
99
+ 'print_share_font_icon' => 'fa-print',
100
+ 'print_share_button' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/print.png',
101
  );
102
 
103
+ require_once( plugin_dir_path( __FILE__ ) . 'includes/vendors/wpc-settings-framework/init.php' );
104
  require_once( dirname(__FILE__) . '/includes/options.php' ); // define options array
105
  require_once( dirname(__FILE__) . '/includes/functions.php' ); // Adds basic filters and actions
 
106
  require_once( dirname(__FILE__) . '/includes/scripts.php' ); // Adds plugin JS and CSS
107
  require_once( dirname(__FILE__) . '/includes/shortcode-functions.php'); // Main shortcode functions
108
  require_once( dirname(__FILE__) . '/includes/mce/shortcodes_tinymce.php'); // Add mce buttons to post editor