Version Description
Download this release
Release Info
Developer | cbaldelomar |
Plugin | Shortcodes by Angie Makes |
Version | 3.9 |
Comparing to | |
See all releases |
Code changes from version 3.8 to 3.9
- README.md +65 -28
- admin/assets/css/wc-shortcodes.css +0 -33
- admin/assets/css/wcpostswidget.css +0 -50
- admin/assets/css/wcvisualmanager.css +103 -0
- admin/assets/js/font-awesome-tinymce-4.js +0 -43
- admin/assets/js/shortcodes-tinymce-4.js +120 -172
- admin/assets/js/wc-shortcodes.js +55 -17
- admin/assets/js/wccolorpickerwidget.js +49 -0
- admin/assets/js/wcfontawesomewidget.js +61 -0
- admin/assets/js/wcpostswidget.js +9 -6
- admin/class-admin.php +9 -3
- admin/class-ajax.php +166 -3
- admin/class-tinymce-buttons.php +0 -10
- includes/vendors/wpc-settings-framework/class-wpc-settings-framework.php +1 -1
- includes/vendors/wpc-settings-framework/views/tabs.php +7 -0
- public/assets/css/style.css +22 -12
- public/class-public.php +2 -3
- public/class-register.php +256 -454
- public/class-sanitize.php +880 -22
- public/class-vars.php +194 -3
- public/class-widget-base.php +45 -0
- public/class-widget-options.php +307 -0
- public/class-widgets.php +2 -3
- public/widgets/widget-accordion-main.php +42 -0
- public/widgets/widget-accordion-section.php +31 -0
- public/widgets/widget-box.php +52 -0
- public/widgets/widget-button.php +84 -0
- public/widgets/widget-center.php +39 -0
- public/widgets/widget-column.php +51 -0
- public/widgets/widget-countdown.php +46 -0
- public/widgets/widget-divider.php +52 -0
- public/widgets/widget-fa.php +49 -0
- public/widgets/widget-fullwidth.php +26 -0
- public/widgets/widget-googlemap.php +56 -0
- public/widgets/widget-heading.php +90 -0
- public/widgets/widget-highlight.php +34 -0
- public/widgets/widget-html.php +26 -0
- public/widgets/widget-image.php +124 -0
- public/widgets/widget-post-slider.php +11 -73
- public/widgets/widget-posts.php +10 -112
- public/widgets/widget-pre.php +42 -0
- public/widgets/widget-pricing.php +70 -0
- public/widgets/widget-rsvp.php +46 -0
- public/widgets/widget-share-buttons.php +27 -0
- public/widgets/widget-skillbar.php +49 -0
- public/widgets/widget-social-icons.php +59 -146
- public/widgets/widget-spacing.php +31 -0
- public/widgets/widget-tab.php +26 -0
- public/widgets/widget-tabgroup.php +34 -0
- public/widgets/widget-testimonial.php +42 -0
- public/widgets/widget-toggle.php +46 -0
- readme.txt +66 -30
- wc-shortcodes.php +9 -5
README.md
CHANGED
@@ -2,54 +2,89 @@
|
|
2 |
|
3 |
**Contributors:** cbaldelomar
|
4 |
**Donate link:** http://webplantmedia.com/donate/
|
5 |
-
**Tags:** shortcode, shortcodes, accordion, accordions, tab, tabs, toggle, columns, column, section, sections, testimonials, border, borders, button, buttons, fullwidth, full width, notification, notifications, google maps, maps, googlemaps, social icons, progress bar, pricing, pricing box, highlights, image, flags, banners, countdown, rsvp, custom html, code, code snippets, snippets, isotope, masonry, posts, post_type, font awesome, icons, fontawesome, fa icons
|
6 |
**Requires at least:** 3.7
|
7 |
-
**Tested up to:** 4.7
|
8 |
**Stable tag:** trunk
|
9 |
**License:** GPLv2 or later
|
10 |
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
12 |
-
A family of shortcodes to
|
13 |
|
14 |
## Description ##
|
15 |
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
* Accordion
|
|
|
19 |
* Tabs
|
|
|
20 |
* Toggle
|
21 |
-
*
|
22 |
-
* Testimonials
|
23 |
-
* Borders
|
24 |
-
* Buttons
|
25 |
-
* Full Width
|
26 |
-
* Notifications
|
27 |
-
* Google Maps
|
28 |
-
* Social Icons
|
29 |
-
* Progress Bars
|
30 |
-
* Pricing
|
31 |
-
* Images with Flags
|
32 |
-
* Highlights
|
33 |
-
* Countdown
|
34 |
* RSVP
|
35 |
-
* Custom HTML
|
36 |
-
* Code Snippets
|
37 |
-
* Isotope / Masonry Posts
|
38 |
-
* Font Awesome Icons
|
39 |
|
40 |
-
|
41 |
|
42 |
-
|
|
|
43 |
|
44 |
-
|
45 |
|
46 |
-
|
47 |
|
48 |
-
|
49 |
|
50 |
-
|
51 |
|
52 |
-
|
53 |
|
54 |
## Installation ##
|
55 |
|
@@ -58,6 +93,8 @@ Thank you so much for even considering supporting my work. If you have benefited
|
|
58 |
3. In your WordPress dashboard, head over to the *Plugins* section.
|
59 |
4. Activate *WP Canvas - Shortcodes*.
|
60 |
|
|
|
|
|
61 |
## Frequently Asked Questions ##
|
62 |
|
63 |
### How do I use the shortcodes?
|
2 |
|
3 |
**Contributors:** cbaldelomar
|
4 |
**Donate link:** http://webplantmedia.com/donate/
|
5 |
+
**Tags:** shortcode, shortcodes, accordion, accordions, tab, tabs, toggle, columns, column, section, sections, testimonials, border, borders, button, buttons, fullwidth, full width, notification, notifications, google maps, maps, googlemaps, social icons, progress bar, pricing, pricing box, highlights, image, flags, banners, countdown, rsvp, custom html, code, code snippets, snippets, isotope, masonry, posts, post_type, post slider, slider, font awesome, icons, fontawesome, fa, box, heading, inline code, divider, spacing, grid, center content, center, icons, image flag, image flags
|
6 |
**Requires at least:** 3.7
|
7 |
+
**Tested up to:** 4.7.3
|
8 |
**Stable tag:** trunk
|
9 |
**License:** GPLv2 or later
|
10 |
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
12 |
+
A plugin that adds a useful family of shortcodes to your WordPress theme.
|
13 |
|
14 |
## Description ##
|
15 |
|
16 |
+
The Shortcodes by Angie Makes plugin adds a family of easy to use shortcodes to your WordPress theme. These shortcodes work flawlessly with [Angie Makes WordPress themes](http://angiemakes.com/feminine-wordpress-blog-themes-women/). Here are the handy shortcodes included with this plugin:
|
17 |
+
|
18 |
+
Columns
|
19 |
+
|
20 |
+
* 1/2 + 1/2
|
21 |
+
* 1/3 + 1/3 + 1/3
|
22 |
+
* 1/3 + 2/3
|
23 |
+
* 2/3 + 1/3
|
24 |
+
* 1/4 + 1/4 + 1/4 + 1/4
|
25 |
+
* 1/4 + 1/2 + 1/4
|
26 |
+
* 1/2 + 1/4 + 1/4
|
27 |
+
* 1/4 + 1/4 + 1/2
|
28 |
+
* 1/4 + 3/4
|
29 |
+
* 3/4 + 1/4
|
30 |
+
|
31 |
+
Elements
|
32 |
+
|
33 |
+
* Button
|
34 |
+
* Font Awesome Icon
|
35 |
+
* Heading
|
36 |
+
* Highlight
|
37 |
+
* Spacing
|
38 |
+
* Clear Floats
|
39 |
+
* Inline Code
|
40 |
+
* Divider
|
41 |
+
|
42 |
+
Content
|
43 |
+
|
44 |
+
* Pricing Table
|
45 |
+
* Social Icon
|
46 |
+
* Share Buttons
|
47 |
+
* Testimonial
|
48 |
+
* Countdown
|
49 |
+
* Skillbar
|
50 |
+
* Image
|
51 |
+
* Box
|
52 |
+
* HTML
|
53 |
+
* Preformatted Text
|
54 |
+
|
55 |
+
Posts
|
56 |
+
|
57 |
+
* Masonry - Box
|
58 |
+
* Masonry - Borderless
|
59 |
+
* Grid - Box
|
60 |
+
* Grid - Borderless
|
61 |
+
* Post Slider 1
|
62 |
+
* Post Slider 2
|
63 |
+
|
64 |
+
Actions
|
65 |
|
66 |
* Accordion
|
67 |
+
* Accordion Section
|
68 |
* Tabs
|
69 |
+
* Tab Section
|
70 |
* Toggle
|
71 |
+
* Google Map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
* RSVP
|
|
|
|
|
|
|
|
|
73 |
|
74 |
+
Wrappers
|
75 |
|
76 |
+
* Center Content
|
77 |
+
* Full Width
|
78 |
|
79 |
+
= Demo =
|
80 |
|
81 |
+
See A DEMO of These Shortcodes Here:
|
82 |
|
83 |
+
[http://gentry.angiemakes.com/shortcodes/](http://gentry.angiemakes.com/shortcodes/)
|
84 |
|
85 |
+
= Professional Support =
|
86 |
|
87 |
+
We have tested this plugin to work with the latest version of WordPress, but do not offer individual troubleshooting support as this is a free plugin. If you need individual support, we're happy to assist you if you purchase our premium support by purchasing a premium, Angie Makes WordPress theme from [angiemakes.com](http://angiemakes.com).
|
88 |
|
89 |
## Installation ##
|
90 |
|
93 |
3. In your WordPress dashboard, head over to the *Plugins* section.
|
94 |
4. Activate *WP Canvas - Shortcodes*.
|
95 |
|
96 |
+
See our help article on [how to manually upload a plugin](http://knowledgebase.angiemakes.com/how-to-upload-and-install-a-custom-third-party-plugin/?cat=18).
|
97 |
+
|
98 |
## Frequently Asked Questions ##
|
99 |
|
100 |
### How do I use the shortcodes?
|
admin/assets/css/wc-shortcodes.css
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
#wc-shortcode-modal {
|
2 |
-
display: none;
|
3 |
-
}
|
4 |
-
#wc-shortcode-modal .media-modal {
|
5 |
-
max-width: 500px;
|
6 |
-
margin: auto;
|
7 |
-
}
|
8 |
-
#wc-shortcode-modal .media-frame-title,
|
9 |
-
#wc-shortcode-modal .media-frame-toolbar,
|
10 |
-
#wc-shortcode-modal .media-frame-content {
|
11 |
-
left: 0;
|
12 |
-
}
|
13 |
-
#wc-shortcode-modal .media-frame-content {
|
14 |
-
padding: 20px;
|
15 |
-
}
|
16 |
-
#wc-shortcode-modal code {
|
17 |
-
white-space: pre-wrap;
|
18 |
-
}
|
19 |
-
#wc-shortcode-modal .wc-shortcodes-error-yellow {
|
20 |
-
background-color: yellow;
|
21 |
-
}
|
22 |
-
#wc-shortcode-modal .wc-shortcodes-error-red {
|
23 |
-
background-color: red;
|
24 |
-
color: white;
|
25 |
-
}
|
26 |
-
#wc-shortcode-modal.hide-insert-button .media-button-insert {
|
27 |
-
display: none;
|
28 |
-
}
|
29 |
-
.wc-shortcodes-visual-manager .wcs-description {
|
30 |
-
font-style: italic;
|
31 |
-
margin: 2px 0 5px;
|
32 |
-
color: #aaa;
|
33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/assets/css/wcpostswidget.css
DELETED
@@ -1,50 +0,0 @@
|
|
1 |
-
html .wc-shortcodes-visual-manager.ui-accordion {
|
2 |
-
margin-bottom: 1.5em;
|
3 |
-
}
|
4 |
-
html .wc-shortcodes-visual-manager.ui-accordion .ui-autocomplete {
|
5 |
-
z-index: 999999;
|
6 |
-
max-height: 300px;
|
7 |
-
overflow: auto;
|
8 |
-
}
|
9 |
-
html .wc-shortcodes-visual-manager.ui-accordion .ui-autocomplete li {
|
10 |
-
white-space: normal;
|
11 |
-
}
|
12 |
-
html .wc-shortcodes-visual-manager.ui-accordion .ui-accordion-header {
|
13 |
-
border: 1px solid #ddd;
|
14 |
-
position: relative;
|
15 |
-
padding: 10px 15px;
|
16 |
-
height: auto;
|
17 |
-
line-height: 30px;
|
18 |
-
overflow: hidden;
|
19 |
-
word-wrap: break-word;
|
20 |
-
background: #fafafa;
|
21 |
-
color: #23282d;
|
22 |
-
margin-bottom: 0;
|
23 |
-
cursor: pointer;
|
24 |
-
font-size: 1em;
|
25 |
-
font-weight: 600;
|
26 |
-
margin-top: 1em;
|
27 |
-
}
|
28 |
-
html .wc-shortcodes-visual-manager.ui-accordion .ui-accordion-header:before {
|
29 |
-
content: "\f345";
|
30 |
-
border: none;
|
31 |
-
background: 0 0;
|
32 |
-
font-size: 1.0em;
|
33 |
-
font-family: dashicons;
|
34 |
-
speak: none;
|
35 |
-
display: inline-block;
|
36 |
-
padding: 0;
|
37 |
-
text-indent: 0;
|
38 |
-
text-align: center;
|
39 |
-
-webkit-font-smoothing: antialiased;
|
40 |
-
-moz-osx-font-smoothing: grayscale;
|
41 |
-
text-decoration: none !important;
|
42 |
-
-webkit-border-radius: 50%;
|
43 |
-
border-radius: 50%;
|
44 |
-
text-indent: -1px;
|
45 |
-
vertical-align: bottom;
|
46 |
-
margin-right: 5px;
|
47 |
-
}
|
48 |
-
html .wc-shortcodes-visual-manager.ui-accordion .ui-accordion-header.ui-accordion-header-active:before {
|
49 |
-
content: "\f347";
|
50 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/assets/css/wcvisualmanager.css
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#wc-shortcode-modal {
|
2 |
+
display: none;
|
3 |
+
}
|
4 |
+
#wc-shortcode-modal .media-modal {
|
5 |
+
max-width: 500px;
|
6 |
+
margin: auto;
|
7 |
+
}
|
8 |
+
#wc-shortcode-modal .media-frame-title,
|
9 |
+
#wc-shortcode-modal .media-frame-toolbar,
|
10 |
+
#wc-shortcode-modal .media-frame-content {
|
11 |
+
left: 0;
|
12 |
+
}
|
13 |
+
#wc-shortcode-modal .media-frame-content {
|
14 |
+
padding: 20px;
|
15 |
+
}
|
16 |
+
#wc-shortcode-modal code {
|
17 |
+
white-space: pre-wrap;
|
18 |
+
}
|
19 |
+
#wc-shortcode-modal .wc-shortcodes-error-yellow {
|
20 |
+
background-color: yellow;
|
21 |
+
}
|
22 |
+
#wc-shortcode-modal .wc-shortcodes-error-red {
|
23 |
+
background-color: red;
|
24 |
+
color: white;
|
25 |
+
}
|
26 |
+
#wc-shortcode-modal.hide-insert-button .media-button-insert {
|
27 |
+
display: none;
|
28 |
+
}
|
29 |
+
.wc-shortcodes-visual-manager .wcs-description {
|
30 |
+
font-style: italic;
|
31 |
+
margin: 2px 0 5px;
|
32 |
+
color: #aaa;
|
33 |
+
display: block;
|
34 |
+
}
|
35 |
+
.wc-shortcodes-visual-manager .wcs-instruction {
|
36 |
+
padding: 10px;
|
37 |
+
border: 2px solid #46b450;
|
38 |
+
background-color: white;
|
39 |
+
}
|
40 |
+
/**/
|
41 |
+
html .wc-shortcodes-visual-manager,
|
42 |
+
html .wc-shortcodes-visual-manager.ui-accordion {
|
43 |
+
margin-bottom: 1.5em;
|
44 |
+
}
|
45 |
+
html .wc-shortcodes-visual-manager .ui-autocomplete,
|
46 |
+
html .wc-shortcodes-visual-manager.ui-accordion .ui-autocomplete {
|
47 |
+
z-index: 999999;
|
48 |
+
max-height: 300px;
|
49 |
+
overflow: auto;
|
50 |
+
}
|
51 |
+
html .wc-shortcodes-visual-manager .ui-autocomplete li,
|
52 |
+
html .wc-shortcodes-visual-manager.ui-accordion .ui-autocomplete li {
|
53 |
+
white-space: normal;
|
54 |
+
}
|
55 |
+
html .wc-shortcodes-visual-manager .wc-shortcodes-widget-fa .ui-autocomplete li i {
|
56 |
+
margin-right: 0.5em;
|
57 |
+
min-width: 1.5em;
|
58 |
+
text-align: center;
|
59 |
+
font-size: 200%;
|
60 |
+
vertical-align: middle;
|
61 |
+
}
|
62 |
+
html .wc-shortcodes-visual-manager .wc-shortcodes-widget-fa .ui-autocomplete li span {
|
63 |
+
line-height: 2;
|
64 |
+
}
|
65 |
+
html .wc-shortcodes-visual-manager.ui-accordion .ui-accordion-header {
|
66 |
+
border: 1px solid #ddd;
|
67 |
+
position: relative;
|
68 |
+
padding: 10px 15px;
|
69 |
+
height: auto;
|
70 |
+
line-height: 30px;
|
71 |
+
overflow: hidden;
|
72 |
+
word-wrap: break-word;
|
73 |
+
background: #fafafa;
|
74 |
+
color: #23282d;
|
75 |
+
margin-bottom: 0;
|
76 |
+
cursor: pointer;
|
77 |
+
font-size: 1em;
|
78 |
+
font-weight: 600;
|
79 |
+
margin-top: 1em;
|
80 |
+
}
|
81 |
+
html .wc-shortcodes-visual-manager.ui-accordion .ui-accordion-header:before {
|
82 |
+
content: "\f345";
|
83 |
+
border: none;
|
84 |
+
background: 0 0;
|
85 |
+
font-size: 1.0em;
|
86 |
+
font-family: dashicons;
|
87 |
+
speak: none;
|
88 |
+
display: inline-block;
|
89 |
+
padding: 0;
|
90 |
+
text-indent: 0;
|
91 |
+
text-align: center;
|
92 |
+
-webkit-font-smoothing: antialiased;
|
93 |
+
-moz-osx-font-smoothing: grayscale;
|
94 |
+
text-decoration: none !important;
|
95 |
+
-webkit-border-radius: 50%;
|
96 |
+
border-radius: 50%;
|
97 |
+
text-indent: -1px;
|
98 |
+
vertical-align: bottom;
|
99 |
+
margin-right: 5px;
|
100 |
+
}
|
101 |
+
html .wc-shortcodes-visual-manager.ui-accordion .ui-accordion-header.ui-accordion-header-active:before {
|
102 |
+
content: "\f347";
|
103 |
+
}
|
admin/assets/js/font-awesome-tinymce-4.js
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
( function() {
|
2 |
-
"use strict";
|
3 |
-
|
4 |
-
var ICONS;
|
5 |
-
|
6 |
-
var setIconShortcode = function(id) {
|
7 |
-
return '[wc_fa icon="' + id + '" margin_left="" margin_right=""][/wc_fa]';
|
8 |
-
}
|
9 |
-
|
10 |
-
var icon = function(id) {
|
11 |
-
return '<i class="fa fa-' + id + '"></i>';
|
12 |
-
}
|
13 |
-
|
14 |
-
var wcShortcodeFA = function( editor, url ) {
|
15 |
-
editor.addButton('wpcfontAwesomeGlyphSelect', function() {
|
16 |
-
var values = [];
|
17 |
-
|
18 |
-
for (var i = 0; i < ICONS.length; i++) {
|
19 |
-
var _id = ICONS[i];
|
20 |
-
values.push({text: _id, value: _id});
|
21 |
-
}
|
22 |
-
|
23 |
-
return {
|
24 |
-
type: 'listbox',
|
25 |
-
//name: 'align',
|
26 |
-
text: 'Font Icons',
|
27 |
-
label: 'Select :',
|
28 |
-
fixedWidth: true,
|
29 |
-
onselect: function(e) {
|
30 |
-
if (e) {
|
31 |
-
editor.insertContent(setIconShortcode(e.control.settings.value));
|
32 |
-
}
|
33 |
-
return false;
|
34 |
-
},
|
35 |
-
values: values,
|
36 |
-
};
|
37 |
-
});
|
38 |
-
};
|
39 |
-
tinymce.PluginManager.add( 'wpc_font_awesome', wcShortcodeFA );
|
40 |
-
|
41 |
-
ICONS = ["500px", "adjust", "adn", "align-center", "align-justify", "align-left", "align-right", "amazon", "ambulance", "american-sign-language-interpreting", "anchor", "android", "angellist", "angle-double-down", "angle-double-left", "angle-double-right", "angle-double-up", "angle-down", "angle-left", "angle-right", "angle-up", "apple", "archive", "area-chart", "arrow-circle-down", "arrow-circle-left", "arrow-circle-o-down", "arrow-circle-o-left", "arrow-circle-o-right", "arrow-circle-o-up", "arrow-circle-right", "arrow-circle-up", "arrow-down", "arrow-left", "arrow-right", "arrow-up", "arrows", "arrows-alt", "arrows-h", "arrows-v", "asl-interpreting", "assistive-listening-systems", "asterisk", "at", "audio-description", "automobile", "backward", "balance-scale", "ban", "bank", "bar-chart", "bar-chart-o", "barcode", "bars", "battery-0", "battery-1", "battery-2", "battery-3", "battery-4", "battery-empty", "battery-full", "battery-half", "battery-quarter", "battery-three-quarters", "bed", "beer", "behance", "behance-square", "bell", "bell-o", "bell-slash", "bell-slash-o", "bicycle", "binoculars", "birthday-cake", "bitbucket", "bitbucket-square", "bitcoin", "black-tie", "blind", "bluetooth", "bluetooth-b", "bold", "bolt", "bomb", "book", "bookmark", "bookmark-o", "braille", "briefcase", "btc", "bug", "building", "building-o", "bullhorn", "bullseye", "bus", "buysellads", "cab", "calculator", "calendar", "calendar-check-o", "calendar-minus-o", "calendar-o", "calendar-plus-o", "calendar-times-o", "camera", "camera-retro", "car", "caret-down", "caret-left", "caret-right", "caret-square-o-down", "caret-square-o-left", "caret-square-o-right", "caret-square-o-up", "caret-up", "cart-arrow-down", "cart-plus", "cc", "cc-amex", "cc-diners-club", "cc-discover", "cc-jcb", "cc-mastercard", "cc-paypal", "cc-stripe", "cc-visa", "certificate", "chain", "chain-broken", "check", "check-circle", "check-circle-o", "check-square", "check-square-o", "chevron-circle-down", "chevron-circle-left", "chevron-circle-right", "chevron-circle-up", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "child", "chrome", "circle", "circle-o", "circle-o-notch", "circle-thin", "clipboard", "clock-o", "clone", "close", "cloud", "cloud-download", "cloud-upload", "cny", "code", "code-fork", "codepen", "codiepie", "coffee", "cog", "cogs", "columns", "comment", "comment-o", "commenting", "commenting-o", "comments", "comments-o", "compass", "compress", "connectdevelop", "contao", "copy", "copyright", "creative-commons", "credit-card", "credit-card-alt", "crop", "crosshairs", "css3", "cube", "cubes", "cut", "cutlery", "dashboard", "dashcube", "database", "deaf", "deafness", "dedent", "delicious", "desktop", "deviantart", "diamond", "digg", "dollar", "dot-circle-o", "download", "dribbble", "dropbox", "drupal", "edge", "edit", "eject", "ellipsis-h", "ellipsis-v", "empire", "envelope", "envelope-o", "envelope-square", "envira", "eraser", "eur", "euro", "exchange", "exclamation", "exclamation-circle", "exclamation-triangle", "expand", "expeditedssl", "external-link", "external-link-square", "eye", "eye-slash", "eyedropper", "fa", "facebook", "facebook-f", "facebook-official", "facebook-square", "fast-backward", "fast-forward", "fax", "feed", "female", "fighter-jet", "file", "file-archive-o", "file-audio-o", "file-code-o", "file-excel-o", "file-image-o", "file-movie-o", "file-o", "file-pdf-o", "file-photo-o", "file-picture-o", "file-powerpoint-o", "file-sound-o", "file-text", "file-text-o", "file-video-o", "file-word-o", "file-zip-o", "files-o", "film", "filter", "fire", "fire-extinguisher", "firefox", "first-order", "flag", "flag-checkered", "flag-o", "flash", "flask", "flickr", "floppy-o", "folder", "folder-o", "folder-open", "folder-open-o", "font", "font-awesome", "fonticons", "fort-awesome", "forumbee", "forward", "foursquare", "frown-o", "futbol-o", "gamepad", "gavel", "gbp", "ge", "gear", "gears", "genderless", "get-pocket", "gg", "gg-circle", "gift", "git", "git-square", "github", "github-alt", "github-square", "gitlab", "gittip", "glass", "glide", "glide-g", "globe", "google", "google-plus", "google-plus-circle", "google-plus-official", "google-plus-square", "google-wallet", "graduation-cap", "gratipay", "group", "h-square", "hacker-news", "hand-grab-o", "hand-lizard-o", "hand-o-down", "hand-o-left", "hand-o-right", "hand-o-up", "hand-paper-o", "hand-peace-o", "hand-pointer-o", "hand-rock-o", "hand-scissors-o", "hand-spock-o", "hand-stop-o", "hard-of-hearing", "hashtag", "hdd-o", "header", "headphones", "heart", "heart-o", "heartbeat", "history", "home", "hospital-o", "hotel", "hourglass", "hourglass-1", "hourglass-2", "hourglass-3", "hourglass-end", "hourglass-half", "hourglass-o", "hourglass-start", "houzz", "html5", "i-cursor", "ils", "image", "inbox", "indent", "industry", "info", "info-circle", "inr", "instagram", "institution", "internet-explorer", "intersex", "ioxhost", "italic", "joomla", "jpy", "jsfiddle", "key", "keyboard-o", "krw", "language", "laptop", "lastfm", "lastfm-square", "leaf", "leanpub", "legal", "lemon-o", "level-down", "level-up", "life-bouy", "life-buoy", "life-ring", "life-saver", "lightbulb-o", "line-chart", "link", "linkedin", "linkedin-square", "linux", "list", "list-alt", "list-ol", "list-ul", "location-arrow", "lock", "long-arrow-down", "long-arrow-left", "long-arrow-right", "long-arrow-up", "low-vision", "magic", "magnet", "mail-forward", "mail-reply", "mail-reply-all", "male", "map", "map-marker", "map-o", "map-pin", "map-signs", "mars", "mars-double", "mars-stroke", "mars-stroke-h", "mars-stroke-v", "maxcdn", "meanpath", "medium", "medkit", "meh-o", "mercury", "microphone", "microphone-slash", "minus", "minus-circle", "minus-square", "minus-square-o", "mixcloud", "mobile", "mobile-phone", "modx", "money", "moon-o", "mortar-board", "motorcycle", "mouse-pointer", "music", "navicon", "neuter", "newspaper-o", "object-group", "object-ungroup", "odnoklassniki", "odnoklassniki-square", "opencart", "openid", "opera", "optin-monster", "outdent", "pagelines", "paint-brush", "paper-plane", "paper-plane-o", "paperclip", "paragraph", "paste", "pause", "pause-circle", "pause-circle-o", "paw", "paypal", "pencil", "pencil-square", "pencil-square-o", "percent", "phone", "phone-square", "photo", "picture-o", "pie-chart", "pied-piper", "pied-piper-alt", "pied-piper-pp", "pinterest", "pinterest-p", "pinterest-square", "plane", "play", "play-circle", "play-circle-o", "plug", "plus", "plus-circle", "plus-square", "plus-square-o", "power-off", "print", "product-hunt", "puzzle-piece", "qq", "qrcode", "question", "question-circle", "question-circle-o", "quote-left", "quote-right", "ra", "random", "rebel", "recycle", "reddit", "reddit-alien", "reddit-square", "refresh", "registered", "remove", "renren", "reorder", "repeat", "reply", "reply-all", "resistance", "retweet", "rmb", "road", "rocket", "rotate-left", "rotate-right", "rouble", "rss", "rss-square", "rub", "ruble", "rupee", "safari", "save", "scissors", "scribd", "search", "search-minus", "search-plus", "sellsy", "send", "send-o", "server", "share", "share-alt", "share-alt-square", "share-square", "share-square-o", "shekel", "sheqel", "shield", "ship", "shirtsinbulk", "shopping-bag", "shopping-basket", "shopping-cart", "sign-in", "sign-language", "sign-out", "signal", "signing", "simplybuilt", "sitemap", "skyatlas", "skype", "slack", "sliders", "slideshare", "smile-o", "snapchat", "snapchat-ghost", "snapchat-square", "soccer-ball-o", "sort", "sort-alpha-asc", "sort-alpha-desc", "sort-amount-asc", "sort-amount-desc", "sort-asc", "sort-desc", "sort-down", "sort-numeric-asc", "sort-numeric-desc", "sort-up", "soundcloud", "space-shuttle", "spinner", "spoon", "spotify", "square", "square-o", "stack-exchange", "stack-overflow", "star", "star-half", "star-half-empty", "star-half-full", "star-half-o", "star-o", "steam", "steam-square", "step-backward", "step-forward", "stethoscope", "sticky-note", "sticky-note-o", "stop", "stop-circle", "stop-circle-o", "street-view", "strikethrough", "stumbleupon", "stumbleupon-circle", "subscript", "subway", "suitcase", "sun-o", "superscript", "support", "table", "tablet", "tachometer", "tag", "tags", "tasks", "taxi", "television", "tencent-weibo", "terminal", "text-height", "text-width", "th", "th-large", "th-list", "themeisle", "thumb-tack", "thumbs-down", "thumbs-o-down", "thumbs-o-up", "thumbs-up", "ticket", "times", "times-circle", "times-circle-o", "tint", "toggle-down", "toggle-left", "toggle-off", "toggle-on", "toggle-right", "toggle-up", "trademark", "train", "transgender", "transgender-alt", "trash", "trash-o", "tree", "trello", "tripadvisor", "trophy", "truck", "try", "tty", "tumblr", "tumblr-square", "turkish-lira", "tv", "twitch", "twitter", "twitter-square", "umbrella", "underline", "undo", "universal-access", "university", "unlink", "unlock", "unlock-alt", "unsorted", "upload", "usb", "usd", "user", "user-md", "user-plus", "user-secret", "user-times", "users", "venus", "venus-double", "venus-mars", "viacoin", "viadeo", "viadeo-square", "video-camera", "vimeo", "vimeo-square", "vine", "vk", "volume-control-phone", "volume-down", "volume-off", "volume-up", "warning", "wechat", "weibo", "weixin", "whatsapp", "wheelchair", "wheelchair-alt", "wifi", "wikipedia-w", "windows", "won", "wordpress", "wpbeginner", "wpforms", "wrench", "xing", "xing-square", "y-combinator", "y-combinator-square", "yahoo", "yc", "yc-square", "yelp", "yen", "yoast", "youtube", "youtube-play", "youtube-square"];
|
42 |
-
|
43 |
-
} )();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/assets/js/shortcodes-tinymce-4.js
CHANGED
@@ -6,6 +6,7 @@
|
|
6 |
var wcParagraphContent = '<p>Sample Content</p>';
|
7 |
var wcDummyParagraphContent = '<p>Sample Content</p>';
|
8 |
var mceSelected = '';
|
|
|
9 |
|
10 |
editor.addButton('wpc_shortcodes_button', function() {
|
11 |
|
@@ -17,9 +18,10 @@
|
|
17 |
icon: false,
|
18 |
onclick: function() {
|
19 |
mceSelected = editor.selection.getContent({format: 'text'});
|
|
|
20 |
if ( mceSelected ) {
|
21 |
wcDummyContent = mceSelected;
|
22 |
-
wcParagraphContent = '<p>' +
|
23 |
}
|
24 |
else {
|
25 |
wcDummyContent = 'Sample Content';
|
@@ -33,61 +35,70 @@
|
|
33 |
{
|
34 |
text: "1/2 + 1/2",
|
35 |
onclick: function(){
|
36 |
-
|
|
|
37 |
}
|
38 |
},
|
39 |
{
|
40 |
text: "1/3 + 1/3 + 1/3",
|
41 |
onclick: function(){
|
42 |
-
|
|
|
43 |
}
|
44 |
},
|
45 |
{
|
46 |
text: "1/3 + 2/3",
|
47 |
onclick: function(){
|
48 |
-
|
|
|
49 |
}
|
50 |
},
|
51 |
{
|
52 |
text: "2/3 + 1/3",
|
53 |
onclick: function(){
|
54 |
-
|
|
|
55 |
}
|
56 |
},
|
57 |
{
|
58 |
text: "1/4 + 1/4 + 1/4 + 1/4",
|
59 |
onclick: function(){
|
60 |
-
editor.insertContent('[wc_row][wc_column size="one-fourth" position="first"]' + wcParagraphContent + '<p>[/wc_column][wc_column size="one-fourth"]</p>' + wcDummyParagraphContent + '<p>[/wc_column][wc_column size="one-fourth"]</p>' + wcDummyParagraphContent + '<p>[/wc_column][wc_column size="one-fourth" position="last"]</p>' + wcDummyParagraphContent + '[/wc_column][/wc_row]');
|
61 |
}
|
62 |
},
|
63 |
{
|
64 |
text: "1/4 + 1/2 + 1/4",
|
65 |
onclick: function(){
|
66 |
-
|
|
|
67 |
}
|
68 |
},
|
69 |
{
|
70 |
text: "1/2 + 1/4 + 1/4",
|
71 |
onclick: function(){
|
72 |
-
|
|
|
73 |
}
|
74 |
},
|
75 |
{
|
76 |
text: "1/4 + 1/4 + 1/2",
|
77 |
onclick: function(){
|
78 |
-
|
|
|
79 |
}
|
80 |
},
|
81 |
{
|
82 |
text: "1/4 + 3/4",
|
83 |
onclick: function(){
|
84 |
-
|
|
|
85 |
}
|
86 |
},
|
87 |
{
|
88 |
text: "3/4 + 1/4",
|
89 |
onclick: function(){
|
90 |
-
|
|
|
91 |
}
|
92 |
}
|
93 |
]
|
@@ -98,317 +109,254 @@
|
|
98 |
{
|
99 |
text: "Button",
|
100 |
onclick: function(){
|
101 |
-
|
|
|
102 |
}
|
103 |
},
|
104 |
{
|
105 |
-
text: "
|
106 |
onclick: function(){
|
107 |
-
|
|
|
108 |
}
|
109 |
},
|
110 |
{
|
111 |
text: "Heading",
|
112 |
onclick: function(){
|
113 |
-
|
114 |
-
|
115 |
-
},
|
116 |
-
{
|
117 |
-
text: "Pricing Table",
|
118 |
-
onclick: function(){
|
119 |
-
editor.insertContent('[wc_pricing type="primary" featured="yes" plan="Basic" cost="$19.99" per="per month" button_url="#" button_text="Sign Up" button_target="self" button_rel="nofollow"]<ul><li>30GB Storage</li><li>512MB Ram</li><li>10 databases</li><li>1,000 Emails</li><li>25GB Bandwidth</li></ul>[/wc_pricing]');
|
120 |
-
}
|
121 |
-
},
|
122 |
-
{
|
123 |
-
text: "Skillbar",
|
124 |
-
onclick: function(){
|
125 |
-
editor.insertContent('[wc_skillbar title="' + wcDummyContent + '" percentage="100" color="#6adcfa"]');
|
126 |
-
}
|
127 |
-
},
|
128 |
-
{
|
129 |
-
text: "Social Icon",
|
130 |
-
onclick: function(){
|
131 |
-
editor.insertContent('[wc_social_icons align="left" size="large" display="facebook,google,twitter,pinterest,instagram,bloglovin,flickr,rss,email,custom1,custom2,custom3,custom4,custom5"]');
|
132 |
-
}
|
133 |
-
},
|
134 |
-
{
|
135 |
-
text: "Share Buttons",
|
136 |
-
onclick: function(){
|
137 |
-
editor.insertContent('[wc_share_buttons]');
|
138 |
}
|
139 |
},
|
140 |
{
|
141 |
-
text: "
|
142 |
onclick: function(){
|
143 |
-
|
|
|
144 |
}
|
145 |
},
|
146 |
{
|
147 |
-
text: "
|
148 |
onclick: function(){
|
149 |
-
|
|
|
150 |
}
|
151 |
},
|
152 |
{
|
153 |
-
text: "
|
154 |
onclick: function(){
|
155 |
-
|
156 |
-
var year = d.getFullYear() + 1;
|
157 |
-
editor.insertContent('[wc_countdown date="July 23, '+year+', 6:00:00 PM" format="wdHMs" message="Your Message Here!" labels="Years,Months,Weeks,Days,Hours,Minutes,Seconds" labels1="Year,Month,Week,Day,Hour,Minute,Second"]');
|
158 |
}
|
159 |
},
|
160 |
{
|
161 |
-
text: "
|
162 |
onclick: function(){
|
163 |
-
editor.insertContent('[
|
164 |
}
|
165 |
},
|
166 |
{
|
167 |
-
text: "
|
168 |
onclick: function(){
|
169 |
-
|
|
|
170 |
}
|
171 |
}
|
172 |
]
|
173 |
},
|
174 |
{
|
175 |
-
text: '
|
176 |
menu: [
|
177 |
{
|
178 |
-
text: "
|
179 |
onclick: function(){
|
180 |
-
var shortcode = '[
|
181 |
wcShortcodes( shortcode, editor );
|
182 |
}
|
183 |
},
|
184 |
{
|
185 |
-
text: "
|
186 |
onclick: function(){
|
187 |
-
var shortcode = '[
|
188 |
wcShortcodes( shortcode, editor );
|
189 |
}
|
190 |
},
|
191 |
{
|
192 |
-
text: "
|
193 |
onclick: function(){
|
194 |
-
var shortcode = '[
|
195 |
wcShortcodes( shortcode, editor );
|
196 |
}
|
197 |
},
|
198 |
{
|
199 |
-
text: "
|
200 |
onclick: function(){
|
201 |
-
var shortcode = '[
|
202 |
wcShortcodes( shortcode, editor );
|
203 |
}
|
204 |
},
|
205 |
{
|
206 |
-
text: "
|
207 |
onclick: function(){
|
208 |
-
var
|
|
|
|
|
209 |
wcShortcodes( shortcode, editor );
|
210 |
}
|
211 |
},
|
212 |
{
|
213 |
-
text: "
|
214 |
onclick: function(){
|
215 |
-
var shortcode = '[
|
216 |
wcShortcodes( shortcode, editor );
|
217 |
}
|
218 |
-
}
|
219 |
-
]
|
220 |
-
},
|
221 |
-
{
|
222 |
-
text: 'Boxes',
|
223 |
-
menu: [
|
224 |
-
{
|
225 |
-
text: "Primary",
|
226 |
-
onclick: function(){
|
227 |
-
editor.insertContent('[wc_box color="primary" text_align="left"]' + wcParagraphContent + '[/wc_box]');
|
228 |
-
}
|
229 |
-
},
|
230 |
-
{
|
231 |
-
text: "Secondary",
|
232 |
-
onclick: function(){
|
233 |
-
editor.insertContent('[wc_box color="secondary" text_align="left"]' + wcParagraphContent + '[/wc_box]');
|
234 |
-
}
|
235 |
},
|
236 |
{
|
237 |
-
text: "
|
238 |
-
onclick: function(){
|
239 |
-
editor.insertContent('[wc_box color="inverse" text_align="left"]' + wcParagraphContent + '[/wc_box]');
|
240 |
-
}
|
241 |
-
},
|
242 |
-
{
|
243 |
-
text: "Success",
|
244 |
onclick: function(){
|
245 |
-
|
|
|
246 |
}
|
247 |
},
|
248 |
{
|
249 |
-
text: "
|
250 |
onclick: function(){
|
251 |
-
|
|
|
252 |
}
|
253 |
},
|
254 |
{
|
255 |
-
text: "
|
256 |
onclick: function(){
|
257 |
-
|
|
|
258 |
}
|
259 |
},
|
260 |
{
|
261 |
-
text: "
|
262 |
onclick: function(){
|
263 |
-
|
|
|
264 |
}
|
265 |
}
|
266 |
]
|
267 |
},
|
268 |
{
|
269 |
-
text: '
|
270 |
menu: [
|
271 |
{
|
272 |
-
text: "
|
273 |
onclick: function(){
|
274 |
-
|
|
|
275 |
}
|
276 |
},
|
277 |
{
|
278 |
-
text: "
|
279 |
onclick: function(){
|
280 |
-
|
|
|
281 |
}
|
282 |
},
|
283 |
{
|
284 |
-
text: "
|
285 |
onclick: function(){
|
286 |
-
|
|
|
287 |
}
|
288 |
},
|
289 |
{
|
290 |
-
text: "
|
291 |
onclick: function(){
|
292 |
-
|
|
|
293 |
}
|
294 |
},
|
295 |
{
|
296 |
-
text: "
|
297 |
onclick: function(){
|
298 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
}
|
300 |
}
|
301 |
]
|
302 |
},
|
303 |
{
|
304 |
-
text: '
|
305 |
menu: [
|
306 |
{
|
307 |
-
text: "
|
308 |
-
onclick: function(){
|
309 |
-
editor.insertContent('[wc_divider style="solid" line="single" margin_top="" margin_bottom=""]');
|
310 |
-
}
|
311 |
-
},
|
312 |
-
{
|
313 |
-
text: "Dashed",
|
314 |
-
onclick: function(){
|
315 |
-
editor.insertContent('[wc_divider style="dashed" line="single" margin_top="" margin_bottom=""]');
|
316 |
-
}
|
317 |
-
},
|
318 |
-
{
|
319 |
-
text: "Dotted",
|
320 |
onclick: function(){
|
321 |
-
|
|
|
322 |
}
|
323 |
},
|
324 |
{
|
325 |
-
text: "
|
326 |
onclick: function(){
|
327 |
-
|
|
|
328 |
}
|
329 |
},
|
330 |
{
|
331 |
-
text: "
|
332 |
onclick: function(){
|
333 |
-
|
|
|
334 |
}
|
335 |
},
|
336 |
{
|
337 |
-
text: "
|
338 |
onclick: function(){
|
339 |
-
|
|
|
340 |
}
|
341 |
},
|
342 |
{
|
343 |
-
text: "
|
344 |
-
onclick: function(){
|
345 |
-
editor.insertContent('[wc_divider style="image3" margin_top="" margin_bottom=""]');
|
346 |
-
}
|
347 |
-
}
|
348 |
-
]
|
349 |
-
},
|
350 |
-
{
|
351 |
-
text: 'jQuery',
|
352 |
-
menu: [
|
353 |
-
{
|
354 |
-
text: "Accordion",
|
355 |
onclick: function(){
|
356 |
-
|
|
|
357 |
}
|
358 |
},
|
359 |
{
|
360 |
-
text: "
|
361 |
onclick: function(){
|
362 |
-
|
|
|
363 |
}
|
364 |
},
|
365 |
{
|
366 |
-
text: "
|
367 |
onclick: function(){
|
368 |
-
|
|
|
369 |
}
|
370 |
}
|
371 |
]
|
372 |
},
|
373 |
{
|
374 |
-
text: '
|
375 |
menu: [
|
376 |
-
{
|
377 |
-
text: "Spacing",
|
378 |
-
onclick: function(){
|
379 |
-
editor.insertContent('[wc_spacing size="40px"]');
|
380 |
-
}
|
381 |
-
},
|
382 |
-
{
|
383 |
-
text: "Clear Floats",
|
384 |
-
onclick: function(){
|
385 |
-
editor.insertContent('[wc_clear_floats]');
|
386 |
-
}
|
387 |
-
},
|
388 |
{
|
389 |
text: "Center Content",
|
390 |
onclick: function(){
|
391 |
-
|
|
|
392 |
}
|
393 |
},
|
394 |
{
|
395 |
text: "Full Width",
|
396 |
onclick: function(){
|
397 |
-
|
398 |
-
|
399 |
-
},
|
400 |
-
{
|
401 |
-
text: "Code",
|
402 |
-
onclick: function(){
|
403 |
-
editor.insertContent('[wc_code]' + wcDummyContent + '[/wc_code]');
|
404 |
}
|
405 |
},
|
406 |
-
{
|
407 |
-
text: "Pre",
|
408 |
-
onclick: function(){
|
409 |
-
editor.insertContent('[wc_pre color="1" wrap="0" scrollable="1" linenums="0" name="Custom Field Name"]');
|
410 |
-
}
|
411 |
-
}
|
412 |
]
|
413 |
},
|
414 |
{
|
@@ -416,7 +364,7 @@
|
|
416 |
onclick: function(){
|
417 |
wcShortcodes( mceSelected, editor );
|
418 |
}
|
419 |
-
}
|
420 |
]
|
421 |
}
|
422 |
});
|
6 |
var wcParagraphContent = '<p>Sample Content</p>';
|
7 |
var wcDummyParagraphContent = '<p>Sample Content</p>';
|
8 |
var mceSelected = '';
|
9 |
+
var mceSelectedHTML = '';
|
10 |
|
11 |
editor.addButton('wpc_shortcodes_button', function() {
|
12 |
|
18 |
icon: false,
|
19 |
onclick: function() {
|
20 |
mceSelected = editor.selection.getContent({format: 'text'});
|
21 |
+
mceSelectedHTML = editor.selection.getContent({format: 'html'});
|
22 |
if ( mceSelected ) {
|
23 |
wcDummyContent = mceSelected;
|
24 |
+
wcParagraphContent = '<p>' + mceSelectedHTML + '</p>';
|
25 |
}
|
26 |
else {
|
27 |
wcDummyContent = 'Sample Content';
|
35 |
{
|
36 |
text: "1/2 + 1/2",
|
37 |
onclick: function(){
|
38 |
+
var shortcode = '[wc_row]<p>[wc_column size="one-half" position="first"]</p>' + wcParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="one-half" position="last"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p>[/wc_row]';
|
39 |
+
editor.insertContent( shortcode );
|
40 |
}
|
41 |
},
|
42 |
{
|
43 |
text: "1/3 + 1/3 + 1/3",
|
44 |
onclick: function(){
|
45 |
+
var shortcode = '[wc_row]<p>[wc_column size="one-third" position="first"]</p>' + wcParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="one-third"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="one-third" position="last"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p>[/wc_row]';
|
46 |
+
editor.insertContent( shortcode );
|
47 |
}
|
48 |
},
|
49 |
{
|
50 |
text: "1/3 + 2/3",
|
51 |
onclick: function(){
|
52 |
+
var shortcode = '[wc_row]<p>[wc_column size="one-third" position="first"]</p>' + wcParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="two-third" position="last"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p>[/wc_row]';
|
53 |
+
editor.insertContent( shortcode );
|
54 |
}
|
55 |
},
|
56 |
{
|
57 |
text: "2/3 + 1/3",
|
58 |
onclick: function(){
|
59 |
+
var shortcode = '[wc_row]<p>[wc_column size="two-third" position="first"]</p>' + wcParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="one-third" position="last"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p>[/wc_row]';
|
60 |
+
editor.insertContent( shortcode );
|
61 |
}
|
62 |
},
|
63 |
{
|
64 |
text: "1/4 + 1/4 + 1/4 + 1/4",
|
65 |
onclick: function(){
|
66 |
+
editor.insertContent('[wc_row]<p>[wc_column size="one-fourth" position="first"]</p>' + wcParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="one-fourth"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="one-fourth"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="one-fourth" position="last"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p>[/wc_row]');
|
67 |
}
|
68 |
},
|
69 |
{
|
70 |
text: "1/4 + 1/2 + 1/4",
|
71 |
onclick: function(){
|
72 |
+
var shortcode = '[wc_row]<p>[wc_column size="one-fourth" position="first"]</p>' + wcParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="one-half"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="one-fourth" position="last"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p>[/wc_row]';
|
73 |
+
editor.insertContent( shortcode );
|
74 |
}
|
75 |
},
|
76 |
{
|
77 |
text: "1/2 + 1/4 + 1/4",
|
78 |
onclick: function(){
|
79 |
+
var shortcode = '[wc_row]<p>[wc_column size="one-half" position="first"]</p>' + wcParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="one-fourth"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="one-fourth" position="last"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p>[/wc_row]';
|
80 |
+
editor.insertContent( shortcode );
|
81 |
}
|
82 |
},
|
83 |
{
|
84 |
text: "1/4 + 1/4 + 1/2",
|
85 |
onclick: function(){
|
86 |
+
var shortcode = '[wc_row]<p>[wc_column size="one-fourth" position="first"]</p>' + wcParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="one-fourth"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="one-half" position="last"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p>[/wc_row]';
|
87 |
+
editor.insertContent( shortcode );
|
88 |
}
|
89 |
},
|
90 |
{
|
91 |
text: "1/4 + 3/4",
|
92 |
onclick: function(){
|
93 |
+
var shortcode = '[wc_row]<p>[wc_column size="one-fourth" position="first"]</p>' + wcParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="three-fourth" position="last"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p>[/wc_row]';
|
94 |
+
editor.insertContent( shortcode );
|
95 |
}
|
96 |
},
|
97 |
{
|
98 |
text: "3/4 + 1/4",
|
99 |
onclick: function(){
|
100 |
+
var shortcode = '[wc_row]<p>[wc_column size="three-fourth" position="first"]</p>' + wcParagraphContent + '<p>[/wc_column]</p><p>[wc_column size="one-fourth" position="last"]</p>' + wcDummyParagraphContent + '<p>[/wc_column]</p>[/wc_row]';
|
101 |
+
editor.insertContent( shortcode );
|
102 |
}
|
103 |
}
|
104 |
]
|
109 |
{
|
110 |
text: "Button",
|
111 |
onclick: function(){
|
112 |
+
var shortcode = '[wc_button type="primary" url="http://angiemakes.com" title="Visit Site" target="self" position="float"]' + wcDummyContent + '[/wc_button]';
|
113 |
+
wcShortcodes( shortcode, editor );
|
114 |
}
|
115 |
},
|
116 |
{
|
117 |
+
text: "Font Awesome Icon",
|
118 |
onclick: function(){
|
119 |
+
var shortcode = '[wc_fa icon="" margin_left="" margin_right=""][/wc_fa]';
|
120 |
+
wcShortcodes( shortcode, editor );
|
121 |
}
|
122 |
},
|
123 |
{
|
124 |
text: "Heading",
|
125 |
onclick: function(){
|
126 |
+
var shortcode = '[wc_heading type="h1" title="' + wcDummyContent + '" margin_top="" margin_bottom="" text_align="left" font_size="" color="" class="" icon_left="" icon_right="" icon_spacing=""]';
|
127 |
+
wcShortcodes( shortcode, editor );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
}
|
129 |
},
|
130 |
{
|
131 |
+
text: "Highlight",
|
132 |
onclick: function(){
|
133 |
+
var shortcode = '[wc_highlight color="yellow"]' + wcDummyContent + '[/wc_highlight]';
|
134 |
+
wcShortcodes( shortcode, editor );
|
135 |
}
|
136 |
},
|
137 |
{
|
138 |
+
text: "Spacing",
|
139 |
onclick: function(){
|
140 |
+
var shortcode = '[wc_spacing size="40px" class=""][/wc_spacing]';
|
141 |
+
wcShortcodes( shortcode, editor );
|
142 |
}
|
143 |
},
|
144 |
{
|
145 |
+
text: "Clear Floats",
|
146 |
onclick: function(){
|
147 |
+
editor.insertContent('[wc_clear_floats][/wc_clear_floats]');
|
|
|
|
|
148 |
}
|
149 |
},
|
150 |
{
|
151 |
+
text: "Inline Code",
|
152 |
onclick: function(){
|
153 |
+
editor.insertContent('[wc_code]' + wcDummyContent + '[/wc_code]');
|
154 |
}
|
155 |
},
|
156 |
{
|
157 |
+
text: "Divider",
|
158 |
onclick: function(){
|
159 |
+
var shortcode = '[wc_divider style="solid" line="single" margin_top="" margin_bottom=""][/wc_divider]';
|
160 |
+
wcShortcodes( shortcode, editor );
|
161 |
}
|
162 |
}
|
163 |
]
|
164 |
},
|
165 |
{
|
166 |
+
text: 'Content',
|
167 |
menu: [
|
168 |
{
|
169 |
+
text: "Pricing Table",
|
170 |
onclick: function(){
|
171 |
+
var shortcode = '[wc_pricing type="primary" plan="Basic" cost="$19.99" per="per month" button_url="http://angiemakes.com" button_text="Sign Up" button_target="self" button_rel="nofollow"]<ul><li>30GB Storage</li><li>512MB Ram</li><li>10 databases</li><li>1,000 Emails</li><li>25GB Bandwidth</li></ul>[/wc_pricing]';
|
172 |
wcShortcodes( shortcode, editor );
|
173 |
}
|
174 |
},
|
175 |
{
|
176 |
+
text: "Social Icon",
|
177 |
onclick: function(){
|
178 |
+
var shortcode = '[wc_social_icons format="default" columns="float-center" maxheight="48"][/wc_social_icons]';
|
179 |
wcShortcodes( shortcode, editor );
|
180 |
}
|
181 |
},
|
182 |
{
|
183 |
+
text: "Share Buttons",
|
184 |
onclick: function(){
|
185 |
+
var shortcode = '[wc_share_buttons][/wc_share_buttons]';
|
186 |
wcShortcodes( shortcode, editor );
|
187 |
}
|
188 |
},
|
189 |
{
|
190 |
+
text: "Testimonial",
|
191 |
onclick: function(){
|
192 |
+
var shortcode = '[wc_testimonial by="Author" url="" position="left"]' + wcParagraphContent + '[/wc_testimonial]';
|
193 |
wcShortcodes( shortcode, editor );
|
194 |
}
|
195 |
},
|
196 |
{
|
197 |
+
text: "Countdown",
|
198 |
onclick: function(){
|
199 |
+
var d = new Date();
|
200 |
+
var year = d.getFullYear() + 1;
|
201 |
+
var shortcode = '[wc_countdown date="July 23, '+year+', 6:00:00 PM" format="wdHMs" message="Your Message Here!" labels="Years,Months,Weeks,Days,Hours,Minutes,Seconds" labels1="Year,Month,Week,Day,Hour,Minute,Second"]';
|
202 |
wcShortcodes( shortcode, editor );
|
203 |
}
|
204 |
},
|
205 |
{
|
206 |
+
text: "Skillbar",
|
207 |
onclick: function(){
|
208 |
+
var shortcode = '[wc_skillbar title="' + wcDummyContent + '" percentage="100" color="#6adcfa"]';
|
209 |
wcShortcodes( shortcode, editor );
|
210 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
},
|
212 |
{
|
213 |
+
text: "Image",
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
onclick: function(){
|
215 |
+
var shortcode = '[wc_image attachment_id="" size="medium" title="" alt="" caption="" link_to="post" url="" align="none" flag="For Sale" left="" top="" right="0" bottom="20px" text_color="" background_color="" font_size="" text_align="center" flag_width=""][/wc_image]';
|
216 |
+
wcShortcodes( shortcode, editor );
|
217 |
}
|
218 |
},
|
219 |
{
|
220 |
+
text: "Box",
|
221 |
onclick: function(){
|
222 |
+
var shortcode = '[wc_box color="primary" text_align="left"]' + wcParagraphContent + '[/wc_box]';
|
223 |
+
wcShortcodes( shortcode, editor );
|
224 |
}
|
225 |
},
|
226 |
{
|
227 |
+
text: "HTML",
|
228 |
onclick: function(){
|
229 |
+
var shortcode = '[wc_html name="Custom Field Name"][/wc_html]';
|
230 |
+
wcShortcodes( shortcode, editor );
|
231 |
}
|
232 |
},
|
233 |
{
|
234 |
+
text: "Preformatted Text",
|
235 |
onclick: function(){
|
236 |
+
var shortcode = '[wc_pre color="1" wrap="0" scrollable="1" linenums="0" name="Custom Field Name"][/wc_pre]';
|
237 |
+
wcShortcodes( shortcode, editor );
|
238 |
}
|
239 |
}
|
240 |
]
|
241 |
},
|
242 |
{
|
243 |
+
text: 'Posts',
|
244 |
menu: [
|
245 |
{
|
246 |
+
text: "Masonry - Box",
|
247 |
onclick: function(){
|
248 |
+
var shortcode = '[wc_posts pids="" order="DESC" orderby="date" post_type="post" taxonomy="" terms="" posts_per_page="10" ignore_sticky_posts="0" show_title="1" show_meta_all="1" show_meta_author="1" show_meta_date="1" show_meta_comments="1" show_thumbnail="1" show_content="1" show_paging="1" size="large" filtering="1" columns="3" gutter_space="20" heading_type="h2" layout="masonry" template="box" excerpt_length="30" date_format="M j, Y"][/wc_posts]';
|
249 |
+
wcShortcodes( shortcode, editor );
|
250 |
}
|
251 |
},
|
252 |
{
|
253 |
+
text: "Masonry - Borderless",
|
254 |
onclick: function(){
|
255 |
+
var shortcode = '[wc_posts pids="" order="DESC" orderby="date" post_type="post" taxonomy="" terms="" posts_per_page="10" ignore_sticky_posts="0" show_title="1" show_meta_all="1" show_meta_author="1" show_meta_date="1" show_meta_comments="1" show_thumbnail="1" show_content="1" show_paging="1" size="large" filtering="1" columns="3" gutter_space="40" heading_type="h2" layout="masonry" template="borderless" excerpt_length="30" date_format="M j, Y"][/wc_posts]';
|
256 |
+
wcShortcodes( shortcode, editor );
|
257 |
}
|
258 |
},
|
259 |
{
|
260 |
+
text: "Grid - Box",
|
261 |
onclick: function(){
|
262 |
+
var shortcode = '[wc_posts pids="" order="DESC" orderby="date" post_type="post" taxonomy="" terms="" posts_per_page="10" ignore_sticky_posts="0" show_title="1" show_meta_all="1" show_meta_author="1" show_meta_date="1" show_meta_comments="1" show_thumbnail="1" show_content="1" show_paging="1" size="wccarousel" filtering="1" columns="3" gutter_space="20" heading_type="h2" layout="grid" template="box" excerpt_length="15" date_format="M j, Y"][/wc_posts]';
|
263 |
+
wcShortcodes( shortcode, editor );
|
264 |
}
|
265 |
},
|
266 |
{
|
267 |
+
text: "Grid - Borderless",
|
268 |
onclick: function(){
|
269 |
+
var shortcode = '[wc_posts pids="" order="DESC" orderby="date" post_type="post" taxonomy="" terms="" posts_per_page="10" ignore_sticky_posts="0" show_title="1" show_meta_all="1" show_meta_author="1" show_meta_date="1" show_meta_comments="1" show_thumbnail="1" show_content="1" show_paging="1" size="wccarousel" filtering="1" columns="3" gutter_space="40" heading_type="h2" layout="grid" template="borderless" excerpt_length="15" date_format="M j, Y"][/wc_posts]';
|
270 |
+
wcShortcodes( shortcode, editor );
|
271 |
}
|
272 |
},
|
273 |
{
|
274 |
+
text: "Post Slider 1",
|
275 |
onclick: function(){
|
276 |
+
var shortcode = '[wc_post_slider pids="" order="DESC" orderby="name" post_type="post" taxonomy="" terms="" posts_per_page="10" ignore_sticky_posts="0" show_meta_category="1" show_title="1" show_content="1" readmore="Continue Reading" button_class="" size="full" heading_type="h2" template="slider1" heading_size="24" mobile_heading_size="24" excerpt_length="30" desktop_height="600" laptop_height="500" mobile_height="350" slider_mode="fade" slider_pause="4000" slider_auto="0"][/wc_post_slider]';
|
277 |
+
wcShortcodes( shortcode, editor );
|
278 |
+
}
|
279 |
+
},
|
280 |
+
{
|
281 |
+
text: "Post Slider 2",
|
282 |
+
onclick: function(){
|
283 |
+
var shortcode = '[wc_post_slider pids="" order="DESC" orderby="name" post_type="post" taxonomy="" terms="" posts_per_page="10" ignore_sticky_posts="0" show_meta_category="0" show_title="1" show_content="1" readmore="Continue Reading" button_class="button secondary-button" size="full" heading_type="h2" template="slider2" heading_size="24" mobile_heading_size="24" excerpt_length="30" desktop_height="600" laptop_height="500" mobile_height="350" slider_mode="fade" slider_pause="4000" slider_auto="0"][/wc_post_slider]';
|
284 |
+
wcShortcodes( shortcode, editor );
|
285 |
}
|
286 |
}
|
287 |
]
|
288 |
},
|
289 |
{
|
290 |
+
text: 'Actions',
|
291 |
menu: [
|
292 |
{
|
293 |
+
text: "Accordion",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
onclick: function(){
|
295 |
+
var shortcode = '[wc_accordion collapse="0" leaveopen="0" layout="box"]<p>[wc_accordion_section title="Section 1"]</p>' + wcParagraphContent + '<p>[/wc_accordion_section]</p><p>[wc_accordion_section title="Section 2"]</p>' + wcDummyParagraphContent + '<p>[/wc_accordion_section]</p>[/wc_accordion]';
|
296 |
+
wcShortcodes( shortcode, editor );
|
297 |
}
|
298 |
},
|
299 |
{
|
300 |
+
text: "Accordion Section",
|
301 |
onclick: function(){
|
302 |
+
var shortcode = '[wc_accordion_section title="New Accordion Section"]<p>' + wcParagraphContent + '</p>[/wc_accordion_section]';
|
303 |
+
wcShortcodes( shortcode, editor );
|
304 |
}
|
305 |
},
|
306 |
{
|
307 |
+
text: "Tabs",
|
308 |
onclick: function(){
|
309 |
+
var shortcode = '[wc_tabgroup layout="box" class=""]<p>[wc_tab title="First Tab"]</p>'+wcParagraphContent+'<p>[/wc_tab]</p><p>[wc_tab title="Second Tab"]</p>'+wcDummyParagraphContent+'<p>[/wc_tab]</p>[/wc_tabgroup]';
|
310 |
+
wcShortcodes( shortcode, editor );
|
311 |
}
|
312 |
},
|
313 |
{
|
314 |
+
text: "Tab Section",
|
315 |
onclick: function(){
|
316 |
+
var shortcode = '[wc_tab title="New Tab Section"]<p>'+wcParagraphContent+'</p>[/wc_tab]';
|
317 |
+
wcShortcodes( shortcode, editor );
|
318 |
}
|
319 |
},
|
320 |
{
|
321 |
+
text: "Toggle",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
322 |
onclick: function(){
|
323 |
+
var shortcode = '[wc_toggle title="This Is Your Toggle Title" layout="box"]' + wcParagraphContent + '[/wc_toggle]';
|
324 |
+
wcShortcodes( shortcode, editor );
|
325 |
}
|
326 |
},
|
327 |
{
|
328 |
+
text: "Google Map",
|
329 |
onclick: function(){
|
330 |
+
var shortcode = '[wc_googlemap title="St. Paul\'s Chapel" location="209 Broadway, New York, NY 10007" zoom="10" height="250" title_on_load="0" class=""]';
|
331 |
+
wcShortcodes( shortcode, editor );
|
332 |
}
|
333 |
},
|
334 |
{
|
335 |
+
text: "RSVP",
|
336 |
onclick: function(){
|
337 |
+
var shortcode = '[wc_rsvp columns="3" align="left" button_align="center"]';
|
338 |
+
wcShortcodes( shortcode, editor );
|
339 |
}
|
340 |
}
|
341 |
]
|
342 |
},
|
343 |
{
|
344 |
+
text: 'Wrappers',
|
345 |
menu: [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
{
|
347 |
text: "Center Content",
|
348 |
onclick: function(){
|
349 |
+
var shortcode = '[wc_center max_width="500px" text_align="left"]' + wcParagraphContent + '[/wc_center]';
|
350 |
+
wcShortcodes( shortcode, editor );
|
351 |
}
|
352 |
},
|
353 |
{
|
354 |
text: "Full Width",
|
355 |
onclick: function(){
|
356 |
+
var shortcode = '[wc_fullwidth selector=""]' + wcParagraphContent + '[/wc_fullwidth]';
|
357 |
+
wcShortcodes( shortcode, editor );
|
|
|
|
|
|
|
|
|
|
|
358 |
}
|
359 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
]
|
361 |
},
|
362 |
{
|
364 |
onclick: function(){
|
365 |
wcShortcodes( mceSelected, editor );
|
366 |
}
|
367 |
+
},
|
368 |
]
|
369 |
}
|
370 |
});
|
admin/assets/js/wc-shortcodes.js
CHANGED
@@ -17,6 +17,7 @@
|
|
17 |
$body.append('<div id="wc-shortcode-modal"><div class="media-modal wp-core-ui">'+button+content+'</div>'+backdrop+'</div>');
|
18 |
|
19 |
var $modal = $body.find('#wc-shortcode-modal');
|
|
|
20 |
var $title = $modal.find('.media-frame-title h1');
|
21 |
var $innerContent = $modal.find('.media-frame-content');
|
22 |
var $close = $modal.find('.media-modal-close');
|
@@ -25,14 +26,15 @@
|
|
25 |
var $backdrop = $modal.find('.media-modal-backdrop');
|
26 |
|
27 |
var close = function() {
|
|
|
28 |
$modal.hide();
|
29 |
-
$innerContent.
|
30 |
-
|
31 |
-
var getNameValue = function() {
|
32 |
}
|
33 |
var insertShortcode = function() {
|
34 |
var data = $innerContent.serialize();
|
35 |
var $fields = $innerContent.find(".wc-shortcodes-widget-option");
|
|
|
36 |
|
37 |
var values = new Array();
|
38 |
$.each( $fields, function( i, el ) {
|
@@ -51,7 +53,11 @@
|
|
51 |
}
|
52 |
var key = $el.attr('name').split('][').pop();
|
53 |
key = key.substring( 0, key.length - 1 );
|
54 |
-
|
|
|
|
|
|
|
|
|
55 |
});
|
56 |
// console.log(values);
|
57 |
values = values.join(" ");
|
@@ -60,31 +66,56 @@
|
|
60 |
// console.log(rgxp);
|
61 |
|
62 |
// var shortcode = "["+mceTag+" "+values+"][/"+mceTag+"]";
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
mceEditor.insertContent(shortcode);
|
66 |
close();
|
67 |
}
|
68 |
|
69 |
var getTag = function( shortcode ) {
|
70 |
-
var tag = '', last = '';
|
|
|
|
|
71 |
|
72 |
-
var a = shortcode.split('][');
|
73 |
if ( a.length > 1 ) {
|
74 |
-
|
|
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
-
|
81 |
-
|
82 |
|
83 |
-
|
84 |
-
|
|
|
|
|
|
|
85 |
}
|
86 |
}
|
87 |
|
|
|
|
|
|
|
88 |
return '';
|
89 |
}
|
90 |
|
@@ -105,8 +136,15 @@
|
|
105 |
$modal.show();
|
106 |
$.post(ajaxurl, {action: 'wc_mce_popup', tag: mceTag, shortcode: shortcode}, function(result){
|
107 |
if ( result.length ) {
|
108 |
-
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
}
|
111 |
else {
|
112 |
msg = "<h3>Not Yet Supported</h3>";
|
17 |
$body.append('<div id="wc-shortcode-modal"><div class="media-modal wp-core-ui">'+button+content+'</div>'+backdrop+'</div>');
|
18 |
|
19 |
var $modal = $body.find('#wc-shortcode-modal');
|
20 |
+
var $modalFrame = $modal.find('.media-frame');
|
21 |
var $title = $modal.find('.media-frame-title h1');
|
22 |
var $innerContent = $modal.find('.media-frame-content');
|
23 |
var $close = $modal.find('.media-modal-close');
|
26 |
var $backdrop = $modal.find('.media-modal-backdrop');
|
27 |
|
28 |
var close = function() {
|
29 |
+
$modal.trigger('wcShortcodesBeforeModalHide');
|
30 |
$modal.hide();
|
31 |
+
$innerContent.empty();
|
32 |
+
$modal.off('wcShortcodesBeforeModalHide')
|
|
|
33 |
}
|
34 |
var insertShortcode = function() {
|
35 |
var data = $innerContent.serialize();
|
36 |
var $fields = $innerContent.find(".wc-shortcodes-widget-option");
|
37 |
+
var shortcode;
|
38 |
|
39 |
var values = new Array();
|
40 |
$.each( $fields, function( i, el ) {
|
53 |
}
|
54 |
var key = $el.attr('name').split('][').pop();
|
55 |
key = key.substring( 0, key.length - 1 );
|
56 |
+
// Used it for removing clutter in shortcode insert. But, also caused probelms with editing.
|
57 |
+
// if ( val || 0 === val ) {
|
58 |
+
// console.log( "NOT EMPTY == KEY: " + key + " VAL: " + val )
|
59 |
+
values.push( key + '="' + val + '"' );
|
60 |
+
// }
|
61 |
});
|
62 |
// console.log(values);
|
63 |
values = values.join(" ");
|
66 |
// console.log(rgxp);
|
67 |
|
68 |
// var shortcode = "["+mceTag+" "+values+"][/"+mceTag+"]";
|
69 |
+
if ( values.length ) {
|
70 |
+
shortcode = mceShortcode.replace(rgxp,"["+mceTag+" "+values+"]");
|
71 |
+
}
|
72 |
+
else {
|
73 |
+
shortcode = mceShortcode.replace(rgxp,"["+mceTag+"]");
|
74 |
+
}
|
75 |
|
76 |
mceEditor.insertContent(shortcode);
|
77 |
close();
|
78 |
}
|
79 |
|
80 |
var getTag = function( shortcode ) {
|
81 |
+
var tag = '', last = '', a = ''; aa = '';
|
82 |
+
|
83 |
+
a = shortcode.split(/\n/);
|
84 |
|
|
|
85 |
if ( a.length > 1 ) {
|
86 |
+
return '';
|
87 |
+
}
|
88 |
|
89 |
+
var regexp = /^\[([A-Za-z0-9\_]+)/g;
|
90 |
+
var match = regexp.exec(shortcode);
|
91 |
+
if ( match !== null ) {
|
92 |
+
if ( match.length > 1 ) {
|
93 |
+
tag = match[1];
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
regexp = /\[\/([A-Za-z0-9\_]+)\]$/g;
|
98 |
+
match = regexp.exec(shortcode);
|
99 |
+
if ( match !== null ) {
|
100 |
+
if ( match.length > 1 ) {
|
101 |
+
last = match[1];
|
102 |
+
}
|
103 |
+
}
|
104 |
|
105 |
+
if ( tag == last )
|
106 |
+
return tag;
|
107 |
|
108 |
+
regexp = /(\]$)/g;
|
109 |
+
match = regexp.exec(shortcode);
|
110 |
+
if ( match !== null ) {
|
111 |
+
if ( match.length > 1 ) {
|
112 |
+
last = match[1];
|
113 |
}
|
114 |
}
|
115 |
|
116 |
+
if ( tag.length && ']' == last )
|
117 |
+
return tag;
|
118 |
+
|
119 |
return '';
|
120 |
}
|
121 |
|
136 |
$modal.show();
|
137 |
$.post(ajaxurl, {action: 'wc_mce_popup', tag: mceTag, shortcode: shortcode}, function(result){
|
138 |
if ( result.length ) {
|
139 |
+
if ( 0 == result ) {
|
140 |
+
msg = "<h3>No Attributes</h3>";
|
141 |
+
msg += "<p><code>["+mceTag+"]</code> has no attributes to configure.</p>";
|
142 |
+
$innerContent.html(msg);
|
143 |
+
}
|
144 |
+
else {
|
145 |
+
$modal.removeClass('hide-insert-button');
|
146 |
+
$innerContent.html(result);
|
147 |
+
}
|
148 |
}
|
149 |
else {
|
150 |
msg = "<h3>Not Yet Supported</h3>";
|
admin/assets/js/wccolorpickerwidget.js
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
( function( $ ) {
|
2 |
+
"use strict";
|
3 |
+
|
4 |
+
$.fn.extend({
|
5 |
+
// change 'pluginname' to your plugin name (duh)
|
6 |
+
wcColorPickerWidget: function(options) {
|
7 |
+
var method = '';
|
8 |
+
|
9 |
+
if ( 'string' == typeof options ) {
|
10 |
+
method = options;
|
11 |
+
}
|
12 |
+
|
13 |
+
// options for the plugin
|
14 |
+
var defaults = {
|
15 |
+
colorPickerSelector: '.wc-shortcodes-widget-color-picker',
|
16 |
+
modalSelector: '#wc-shortcode-modal'
|
17 |
+
}
|
18 |
+
options = $.extend(defaults, options);
|
19 |
+
|
20 |
+
|
21 |
+
var $modal = $( options.modalSelector );
|
22 |
+
|
23 |
+
if ( $modal.length ) {
|
24 |
+
$modal.on('wcShortcodesBeforeModalHide', function() {
|
25 |
+
var $this = $(this);
|
26 |
+
var $colorPicker = $this.find( options.colorPickerSelector );
|
27 |
+
|
28 |
+
$colorPicker.each( function( index, el ) {
|
29 |
+
var $el = $(el);
|
30 |
+
$el.wpColorPicker('close');
|
31 |
+
});
|
32 |
+
});
|
33 |
+
}
|
34 |
+
|
35 |
+
return this.each(function() {
|
36 |
+
var $this = $(this);
|
37 |
+
var $colorPicker = $this.find( options.colorPickerSelector );
|
38 |
+
|
39 |
+
if ( $colorPicker.length ) {
|
40 |
+
$colorPicker.each( function( index, el ) {
|
41 |
+
var $el = $(el);
|
42 |
+
$el.wpColorPicker();
|
43 |
+
});
|
44 |
+
}
|
45 |
+
});
|
46 |
+
}
|
47 |
+
});
|
48 |
+
|
49 |
+
} )( jQuery );
|
admin/assets/js/wcfontawesomewidget.js
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
( function( $ ) {
|
2 |
+
"use strict";
|
3 |
+
|
4 |
+
var ICONS = ["500px", "adjust", "adn", "align-center", "align-justify", "align-left", "align-right", "amazon", "ambulance", "american-sign-language-interpreting", "anchor", "android", "angellist", "angle-double-down", "angle-double-left", "angle-double-right", "angle-double-up", "angle-down", "angle-left", "angle-right", "angle-up", "apple", "archive", "area-chart", "arrow-circle-down", "arrow-circle-left", "arrow-circle-o-down", "arrow-circle-o-left", "arrow-circle-o-right", "arrow-circle-o-up", "arrow-circle-right", "arrow-circle-up", "arrow-down", "arrow-left", "arrow-right", "arrow-up", "arrows", "arrows-alt", "arrows-h", "arrows-v", "asl-interpreting", "assistive-listening-systems", "asterisk", "at", "audio-description", "automobile", "backward", "balance-scale", "ban", "bank", "bar-chart", "bar-chart-o", "barcode", "bars", "battery-0", "battery-1", "battery-2", "battery-3", "battery-4", "battery-empty", "battery-full", "battery-half", "battery-quarter", "battery-three-quarters", "bed", "beer", "behance", "behance-square", "bell", "bell-o", "bell-slash", "bell-slash-o", "bicycle", "binoculars", "birthday-cake", "bitbucket", "bitbucket-square", "bitcoin", "black-tie", "blind", "bluetooth", "bluetooth-b", "bold", "bolt", "bomb", "book", "bookmark", "bookmark-o", "braille", "briefcase", "btc", "bug", "building", "building-o", "bullhorn", "bullseye", "bus", "buysellads", "cab", "calculator", "calendar", "calendar-check-o", "calendar-minus-o", "calendar-o", "calendar-plus-o", "calendar-times-o", "camera", "camera-retro", "car", "caret-down", "caret-left", "caret-right", "caret-square-o-down", "caret-square-o-left", "caret-square-o-right", "caret-square-o-up", "caret-up", "cart-arrow-down", "cart-plus", "cc", "cc-amex", "cc-diners-club", "cc-discover", "cc-jcb", "cc-mastercard", "cc-paypal", "cc-stripe", "cc-visa", "certificate", "chain", "chain-broken", "check", "check-circle", "check-circle-o", "check-square", "check-square-o", "chevron-circle-down", "chevron-circle-left", "chevron-circle-right", "chevron-circle-up", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "child", "chrome", "circle", "circle-o", "circle-o-notch", "circle-thin", "clipboard", "clock-o", "clone", "close", "cloud", "cloud-download", "cloud-upload", "cny", "code", "code-fork", "codepen", "codiepie", "coffee", "cog", "cogs", "columns", "comment", "comment-o", "commenting", "commenting-o", "comments", "comments-o", "compass", "compress", "connectdevelop", "contao", "copy", "copyright", "creative-commons", "credit-card", "credit-card-alt", "crop", "crosshairs", "css3", "cube", "cubes", "cut", "cutlery", "dashboard", "dashcube", "database", "deaf", "deafness", "dedent", "delicious", "desktop", "deviantart", "diamond", "digg", "dollar", "dot-circle-o", "download", "dribbble", "dropbox", "drupal", "edge", "edit", "eject", "ellipsis-h", "ellipsis-v", "empire", "envelope", "envelope-o", "envelope-square", "envira", "eraser", "eur", "euro", "exchange", "exclamation", "exclamation-circle", "exclamation-triangle", "expand", "expeditedssl", "external-link", "external-link-square", "eye", "eye-slash", "eyedropper", "fa", "facebook", "facebook-f", "facebook-official", "facebook-square", "fast-backward", "fast-forward", "fax", "feed", "female", "fighter-jet", "file", "file-archive-o", "file-audio-o", "file-code-o", "file-excel-o", "file-image-o", "file-movie-o", "file-o", "file-pdf-o", "file-photo-o", "file-picture-o", "file-powerpoint-o", "file-sound-o", "file-text", "file-text-o", "file-video-o", "file-word-o", "file-zip-o", "files-o", "film", "filter", "fire", "fire-extinguisher", "firefox", "first-order", "flag", "flag-checkered", "flag-o", "flash", "flask", "flickr", "floppy-o", "folder", "folder-o", "folder-open", "folder-open-o", "font", "font-awesome", "fonticons", "fort-awesome", "forumbee", "forward", "foursquare", "frown-o", "futbol-o", "gamepad", "gavel", "gbp", "ge", "gear", "gears", "genderless", "get-pocket", "gg", "gg-circle", "gift", "git", "git-square", "github", "github-alt", "github-square", "gitlab", "gittip", "glass", "glide", "glide-g", "globe", "google", "google-plus", "google-plus-circle", "google-plus-official", "google-plus-square", "google-wallet", "graduation-cap", "gratipay", "group", "h-square", "hacker-news", "hand-grab-o", "hand-lizard-o", "hand-o-down", "hand-o-left", "hand-o-right", "hand-o-up", "hand-paper-o", "hand-peace-o", "hand-pointer-o", "hand-rock-o", "hand-scissors-o", "hand-spock-o", "hand-stop-o", "hard-of-hearing", "hashtag", "hdd-o", "header", "headphones", "heart", "heart-o", "heartbeat", "history", "home", "hospital-o", "hotel", "hourglass", "hourglass-1", "hourglass-2", "hourglass-3", "hourglass-end", "hourglass-half", "hourglass-o", "hourglass-start", "houzz", "html5", "i-cursor", "ils", "image", "inbox", "indent", "industry", "info", "info-circle", "inr", "instagram", "institution", "internet-explorer", "intersex", "ioxhost", "italic", "joomla", "jpy", "jsfiddle", "key", "keyboard-o", "krw", "language", "laptop", "lastfm", "lastfm-square", "leaf", "leanpub", "legal", "lemon-o", "level-down", "level-up", "life-bouy", "life-buoy", "life-ring", "life-saver", "lightbulb-o", "line-chart", "link", "linkedin", "linkedin-square", "linux", "list", "list-alt", "list-ol", "list-ul", "location-arrow", "lock", "long-arrow-down", "long-arrow-left", "long-arrow-right", "long-arrow-up", "low-vision", "magic", "magnet", "mail-forward", "mail-reply", "mail-reply-all", "male", "map", "map-marker", "map-o", "map-pin", "map-signs", "mars", "mars-double", "mars-stroke", "mars-stroke-h", "mars-stroke-v", "maxcdn", "meanpath", "medium", "medkit", "meh-o", "mercury", "microphone", "microphone-slash", "minus", "minus-circle", "minus-square", "minus-square-o", "mixcloud", "mobile", "mobile-phone", "modx", "money", "moon-o", "mortar-board", "motorcycle", "mouse-pointer", "music", "navicon", "neuter", "newspaper-o", "object-group", "object-ungroup", "odnoklassniki", "odnoklassniki-square", "opencart", "openid", "opera", "optin-monster", "outdent", "pagelines", "paint-brush", "paper-plane", "paper-plane-o", "paperclip", "paragraph", "paste", "pause", "pause-circle", "pause-circle-o", "paw", "paypal", "pencil", "pencil-square", "pencil-square-o", "percent", "phone", "phone-square", "photo", "picture-o", "pie-chart", "pied-piper", "pied-piper-alt", "pied-piper-pp", "pinterest", "pinterest-p", "pinterest-square", "plane", "play", "play-circle", "play-circle-o", "plug", "plus", "plus-circle", "plus-square", "plus-square-o", "power-off", "print", "product-hunt", "puzzle-piece", "qq", "qrcode", "question", "question-circle", "question-circle-o", "quote-left", "quote-right", "ra", "random", "rebel", "recycle", "reddit", "reddit-alien", "reddit-square", "refresh", "registered", "remove", "renren", "reorder", "repeat", "reply", "reply-all", "resistance", "retweet", "rmb", "road", "rocket", "rotate-left", "rotate-right", "rouble", "rss", "rss-square", "rub", "ruble", "rupee", "safari", "save", "scissors", "scribd", "search", "search-minus", "search-plus", "sellsy", "send", "send-o", "server", "share", "share-alt", "share-alt-square", "share-square", "share-square-o", "shekel", "sheqel", "shield", "ship", "shirtsinbulk", "shopping-bag", "shopping-basket", "shopping-cart", "sign-in", "sign-language", "sign-out", "signal", "signing", "simplybuilt", "sitemap", "skyatlas", "skype", "slack", "sliders", "slideshare", "smile-o", "snapchat", "snapchat-ghost", "snapchat-square", "soccer-ball-o", "sort", "sort-alpha-asc", "sort-alpha-desc", "sort-amount-asc", "sort-amount-desc", "sort-asc", "sort-desc", "sort-down", "sort-numeric-asc", "sort-numeric-desc", "sort-up", "soundcloud", "space-shuttle", "spinner", "spoon", "spotify", "square", "square-o", "stack-exchange", "stack-overflow", "star", "star-half", "star-half-empty", "star-half-full", "star-half-o", "star-o", "steam", "steam-square", "step-backward", "step-forward", "stethoscope", "sticky-note", "sticky-note-o", "stop", "stop-circle", "stop-circle-o", "street-view", "strikethrough", "stumbleupon", "stumbleupon-circle", "subscript", "subway", "suitcase", "sun-o", "superscript", "support", "table", "tablet", "tachometer", "tag", "tags", "tasks", "taxi", "television", "tencent-weibo", "terminal", "text-height", "text-width", "th", "th-large", "th-list", "themeisle", "thumb-tack", "thumbs-down", "thumbs-o-down", "thumbs-o-up", "thumbs-up", "ticket", "times", "times-circle", "times-circle-o", "tint", "toggle-down", "toggle-left", "toggle-off", "toggle-on", "toggle-right", "toggle-up", "trademark", "train", "transgender", "transgender-alt", "trash", "trash-o", "tree", "trello", "tripadvisor", "trophy", "truck", "try", "tty", "tumblr", "tumblr-square", "turkish-lira", "tv", "twitch", "twitter", "twitter-square", "umbrella", "underline", "undo", "universal-access", "university", "unlink", "unlock", "unlock-alt", "unsorted", "upload", "usb", "usd", "user", "user-md", "user-plus", "user-secret", "user-times", "users", "venus", "venus-double", "venus-mars", "viacoin", "viadeo", "viadeo-square", "video-camera", "vimeo", "vimeo-square", "vine", "vk", "volume-control-phone", "volume-down", "volume-off", "volume-up", "warning", "wechat", "weibo", "weixin", "whatsapp", "wheelchair", "wheelchair-alt", "wifi", "wikipedia-w", "windows", "won", "wordpress", "wpbeginner", "wpforms", "wrench", "xing", "xing-square", "y-combinator", "y-combinator-square", "yahoo", "yc", "yc-square", "yelp", "yen", "yoast", "youtube", "youtube-play", "youtube-square"];
|
5 |
+
|
6 |
+
var values = [];
|
7 |
+
|
8 |
+
for (var i = 0; i < ICONS.length; i++) {
|
9 |
+
var _id = ICONS[i];
|
10 |
+
values.push({label: _id, value: _id});
|
11 |
+
}
|
12 |
+
|
13 |
+
$.fn.extend({
|
14 |
+
// change 'pluginname' to your plugin name (duh)
|
15 |
+
wcFontAwesomeWidget: function(options) {
|
16 |
+
// options for the plugin
|
17 |
+
var defaults = {
|
18 |
+
autoCompleteSelector: '.wc-shortcodes-widget-autocomplete-select'
|
19 |
+
}
|
20 |
+
|
21 |
+
var options = $.extend(defaults, options);
|
22 |
+
|
23 |
+
return this.each(function() {
|
24 |
+
var $this = $(this);
|
25 |
+
var $autoComplete = $this.find( options.autoCompleteSelector );
|
26 |
+
|
27 |
+
if ( $autoComplete.length ) {
|
28 |
+
$autoComplete.each( function( index, el ) {
|
29 |
+
var $el = $(el);
|
30 |
+
var $parent = $el.parent();
|
31 |
+
$parent.css({'position':'relative'});
|
32 |
+
$parent.addClass('wc-shortcodes-widget-fa');
|
33 |
+
var options = '';
|
34 |
+
|
35 |
+
options = {
|
36 |
+
minLength: 0,
|
37 |
+
appendTo: $parent,
|
38 |
+
source: values,
|
39 |
+
close: function ( event, ui ) {
|
40 |
+
var $t = $(this);
|
41 |
+
$t.trigger('change');
|
42 |
+
// setTimeout(function(){
|
43 |
+
// $t.blur();
|
44 |
+
// }, 0);
|
45 |
+
}
|
46 |
+
};
|
47 |
+
|
48 |
+
$el.autocomplete( options )
|
49 |
+
.bind('focus', function(){ $(this).autocomplete("search"); } )
|
50 |
+
.autocomplete("instance")._renderItem = function(ul, item) {
|
51 |
+
return $("<li>")
|
52 |
+
.append("<i class='fa fa-" + item.value + "'></i><span>" + item.label + "</span>")
|
53 |
+
.appendTo(ul);
|
54 |
+
};
|
55 |
+
});
|
56 |
+
}
|
57 |
+
});
|
58 |
+
}
|
59 |
+
});
|
60 |
+
|
61 |
+
} )( jQuery );
|
admin/assets/js/wcpostswidget.js
CHANGED
@@ -72,12 +72,15 @@
|
|
72 |
|
73 |
return false;
|
74 |
},
|
|
|
|
|
|
|
75 |
close: function( event, ui ) {
|
76 |
var $t = $(this);
|
77 |
$t.trigger('change');
|
78 |
-
setTimeout(function(){
|
79 |
-
$t.blur();
|
80 |
-
}, 0);
|
81 |
}
|
82 |
}
|
83 |
}
|
@@ -106,9 +109,9 @@
|
|
106 |
close: function ( event, ui ) {
|
107 |
var $t = $(this);
|
108 |
$t.trigger('change');
|
109 |
-
setTimeout(function(){
|
110 |
-
$t.blur();
|
111 |
-
}, 0);
|
112 |
}
|
113 |
};
|
114 |
}
|
72 |
|
73 |
return false;
|
74 |
},
|
75 |
+
focus: function( event, ui ) {
|
76 |
+
return false; // Prevent comma delim value from being replace by single value.
|
77 |
+
},
|
78 |
close: function( event, ui ) {
|
79 |
var $t = $(this);
|
80 |
$t.trigger('change');
|
81 |
+
// setTimeout(function(){
|
82 |
+
// $t.blur();
|
83 |
+
// }, 0);
|
84 |
}
|
85 |
}
|
86 |
}
|
109 |
close: function ( event, ui ) {
|
110 |
var $t = $(this);
|
111 |
$t.trigger('change');
|
112 |
+
// setTimeout(function(){
|
113 |
+
// $t.blur();
|
114 |
+
// }, 0);
|
115 |
}
|
116 |
};
|
117 |
}
|
admin/class-admin.php
CHANGED
@@ -70,12 +70,18 @@ class WPC_Shortcodes_Admin extends WPC_Shortcodes_Vars {
|
|
70 |
$ver = WC_SHORTCODES_VERSION;
|
71 |
|
72 |
if ( $hook == 'post-new.php' || $hook == 'post.php' || $hook == 'widgets.php' ) {
|
73 |
-
wp_enqueue_style( 'wc-shortcodes-
|
74 |
wp_enqueue_style( 'wc-shortcodes-ui-theme-override-style', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/css/ui-theme-override.css', array( ), $ver );
|
75 |
-
wp_enqueue_style( 'wc-shortcodes-posts-widget-style', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/css/wcpostswidget.css', array( ), $ver );
|
76 |
wp_enqueue_script( 'wc-shortcodes-posts-widget', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/js/wcpostswidget.js', array ( 'jquery', 'jquery-ui-autocomplete', 'jquery-ui-accordion' ), $ver, true );
|
|
|
|
|
|
|
77 |
wp_enqueue_script( 'wc-shortcodes', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/js/wc-shortcodes.js', array ( 'jquery' ), $ver, true );
|
78 |
}
|
|
|
|
|
|
|
|
|
79 |
}
|
80 |
|
81 |
/**
|
@@ -87,7 +93,7 @@ class WPC_Shortcodes_Admin extends WPC_Shortcodes_Vars {
|
|
87 |
|
88 |
return array_merge(
|
89 |
array(
|
90 |
-
'settings' => '<a href="' .
|
91 |
),
|
92 |
$links
|
93 |
);
|
70 |
$ver = WC_SHORTCODES_VERSION;
|
71 |
|
72 |
if ( $hook == 'post-new.php' || $hook == 'post.php' || $hook == 'widgets.php' ) {
|
73 |
+
wp_enqueue_style( 'wc-shortcodes-visual-manager-style', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/css/wcvisualmanager.css', array( ), $ver );
|
74 |
wp_enqueue_style( 'wc-shortcodes-ui-theme-override-style', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/css/ui-theme-override.css', array( ), $ver );
|
|
|
75 |
wp_enqueue_script( 'wc-shortcodes-posts-widget', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/js/wcpostswidget.js', array ( 'jquery', 'jquery-ui-autocomplete', 'jquery-ui-accordion' ), $ver, true );
|
76 |
+
wp_enqueue_script( 'wc-shortcodes-font-awesome-widget', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/js/wcfontawesomewidget.js', array ( 'jquery', 'jquery-ui-autocomplete' ), $ver, true );
|
77 |
+
wp_enqueue_style( 'wp-color-picker' );
|
78 |
+
wp_enqueue_script( 'wc-shortcodes-color-picker-widget', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/js/wccolorpickerwidget.js', array ( 'wp-color-picker' ), $ver, true );
|
79 |
wp_enqueue_script( 'wc-shortcodes', WC_SHORTCODES_PLUGIN_URL . 'admin/assets/js/wc-shortcodes.js', array ( 'jquery' ), $ver, true );
|
80 |
}
|
81 |
+
|
82 |
+
if ( $hook == 'post-new.php' || $hook == 'post.php' ) {
|
83 |
+
wp_enqueue_style('wc-font-awesome-styles', WC_SHORTCODES_PLUGIN_URL . 'public/assets/css/font-awesome.css', array(), WC_SHORTCODES_VERSION, 'all');
|
84 |
+
}
|
85 |
}
|
86 |
|
87 |
/**
|
93 |
|
94 |
return array_merge(
|
95 |
array(
|
96 |
+
'settings' => '<a href="' . parent::$plugin_settings_url . '">' . __( 'Settings', 'wc-shortcodes' ) . '</a>'
|
97 |
),
|
98 |
$links
|
99 |
);
|
admin/class-ajax.php
CHANGED
@@ -14,6 +14,7 @@ class WPC_Shortcodes_Ajax {
|
|
14 |
|
15 |
private function __construct() {
|
16 |
add_action( 'wp_ajax_wc_post_lookup', array( &$this, 'post_lookup_callback' ) );
|
|
|
17 |
add_action( 'wp_ajax_wc_terms_lookup', array( &$this, 'terms_lookup_callback' ) );
|
18 |
add_action( 'wp_ajax_wc_mce_popup', array( &$this, 'mce_popup' ) );
|
19 |
}
|
@@ -64,6 +65,53 @@ class WPC_Shortcodes_Ajax {
|
|
64 |
die(); //stop "0" from being output
|
65 |
}
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
public function terms_lookup_callback() {
|
68 |
global $wpdb; //get access to the WordPress database object variable
|
69 |
|
@@ -129,14 +177,124 @@ class WPC_Shortcodes_Ajax {
|
|
129 |
$shortcode = stripslashes( $_POST['shortcode'] );
|
130 |
|
131 |
$attr = $this->parse_shortcode( $tag, $shortcode );
|
|
|
132 |
|
133 |
switch ( $tag ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
case 'wc_post_slider' :
|
135 |
-
$widget = new
|
136 |
$widget->form( $attr );
|
137 |
break;
|
138 |
case 'wc_posts' :
|
139 |
-
$widget = new
|
140 |
$widget->form( $attr );
|
141 |
break;
|
142 |
}
|
@@ -145,18 +303,23 @@ class WPC_Shortcodes_Ajax {
|
|
145 |
}
|
146 |
|
147 |
private function parse_shortcode( $check_tag, $content ) {
|
148 |
-
|
|
|
149 |
|
150 |
if ( false === strpos( $content, '[' ) ) {
|
151 |
return false;
|
152 |
}
|
153 |
|
|
|
154 |
if (empty($shortcode_tags) || !is_array($shortcode_tags))
|
155 |
return false;
|
156 |
|
157 |
// Find all registered tag names in $content.
|
158 |
preg_match_all( '@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches );
|
159 |
$tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
|
|
|
|
|
|
|
160 |
|
161 |
if ( empty( $tagnames ) ) {
|
162 |
return false;
|
14 |
|
15 |
private function __construct() {
|
16 |
add_action( 'wp_ajax_wc_post_lookup', array( &$this, 'post_lookup_callback' ) );
|
17 |
+
add_action( 'wp_ajax_wc_attachment_lookup', array( &$this, 'attachment_lookup_callback' ) );
|
18 |
add_action( 'wp_ajax_wc_terms_lookup', array( &$this, 'terms_lookup_callback' ) );
|
19 |
add_action( 'wp_ajax_wc_mce_popup', array( &$this, 'mce_popup' ) );
|
20 |
}
|
65 |
die(); //stop "0" from being output
|
66 |
}
|
67 |
|
68 |
+
public function attachment_lookup_callback() {
|
69 |
+
global $wpdb; //get access to the WordPress database object variable
|
70 |
+
|
71 |
+
//get names of all businesses
|
72 |
+
$request = '%' . $wpdb->esc_like( stripslashes( sanitize_text_field( $_POST['request'] ) ) ) . '%'; //escape for use in LIKE statement
|
73 |
+
$post_type = 'attachment';
|
74 |
+
$post_status = 'inherit';
|
75 |
+
|
76 |
+
$sql = "
|
77 |
+
select
|
78 |
+
ID,
|
79 |
+
post_title
|
80 |
+
from
|
81 |
+
$wpdb->posts
|
82 |
+
where
|
83 |
+
post_title like %s
|
84 |
+
and post_type='%s'
|
85 |
+
and post_status='%s'
|
86 |
+
order by
|
87 |
+
post_title ASC
|
88 |
+
limit
|
89 |
+
0,30
|
90 |
+
";
|
91 |
+
|
92 |
+
$sql = $wpdb->prepare( $sql, $request, $post_type, $post_status );
|
93 |
+
|
94 |
+
$results = $wpdb->get_results($sql);
|
95 |
+
|
96 |
+
//copy the business titles to a simple array
|
97 |
+
$titles = array();
|
98 |
+
$i = 0;
|
99 |
+
foreach( $results as $r ) {
|
100 |
+
$titles[ $i ][ 'label' ] = $r->post_title . " (" . $r->ID . ")";
|
101 |
+
$titles[ $i ][ 'value' ] = $r->ID;
|
102 |
+
$i++;
|
103 |
+
}
|
104 |
+
|
105 |
+
if ( empty( $titles ) ) {
|
106 |
+
$titles[0]['label'] = "No results found in post type \"$post_type\".";
|
107 |
+
$titles[0]['value'] = "0";
|
108 |
+
}
|
109 |
+
|
110 |
+
echo json_encode($titles); //encode into JSON format and output
|
111 |
+
|
112 |
+
die(); //stop "0" from being output
|
113 |
+
}
|
114 |
+
|
115 |
public function terms_lookup_callback() {
|
116 |
global $wpdb; //get access to the WordPress database object variable
|
117 |
|
177 |
$shortcode = stripslashes( $_POST['shortcode'] );
|
178 |
|
179 |
$attr = $this->parse_shortcode( $tag, $shortcode );
|
180 |
+
$attr['wc_shortcodes_using_visual_manager'] = 1;
|
181 |
|
182 |
switch ( $tag ) {
|
183 |
+
case 'wc_accordion' :
|
184 |
+
$widget = new WPC_Shortcodes_Widget_Accordion_Main();
|
185 |
+
$widget->form( $attr );
|
186 |
+
break;
|
187 |
+
case 'wc_accordion_section' :
|
188 |
+
$widget = new WPC_Shortcodes_Widget_Accordion_Section();
|
189 |
+
$widget->form( $attr );
|
190 |
+
break;
|
191 |
+
case 'wc_tabgroup' :
|
192 |
+
$widget = new WPC_Shortcodes_Widget_Tabgroup();
|
193 |
+
$widget->form( $attr );
|
194 |
+
break;
|
195 |
+
case 'wc_tab' :
|
196 |
+
$widget = new WPC_Shortcodes_Widget_Tab();
|
197 |
+
$widget->form( $attr );
|
198 |
+
break;
|
199 |
+
case 'wc_toggle' :
|
200 |
+
$widget = new WPC_Shortcodes_Widget_Toggle();
|
201 |
+
$widget->form( $attr );
|
202 |
+
break;
|
203 |
+
case 'wc_clear_floats' :
|
204 |
+
case 'wc_row' :
|
205 |
+
echo 0;
|
206 |
+
die();
|
207 |
+
break;
|
208 |
+
case 'wc_column' :
|
209 |
+
$widget = new WPC_Shortcodes_Widget_Column();
|
210 |
+
$widget->form( $attr );
|
211 |
+
break;
|
212 |
+
case 'wc_spacing' :
|
213 |
+
$widget = new WPC_Shortcodes_Widget_Spacing();
|
214 |
+
$widget->form( $attr );
|
215 |
+
break;
|
216 |
+
case 'wc_button' :
|
217 |
+
$widget = new WPC_Shortcodes_Widget_Button();
|
218 |
+
$widget->form( $attr );
|
219 |
+
break;
|
220 |
+
case 'wc_pricing' :
|
221 |
+
$widget = new WPC_Shortcodes_Widget_Pricing();
|
222 |
+
$widget->form( $attr );
|
223 |
+
break;
|
224 |
+
case 'wc_skillbar' :
|
225 |
+
$widget = new WPC_Shortcodes_Widget_Skillbar();
|
226 |
+
$widget->form( $attr );
|
227 |
+
break;
|
228 |
+
case 'wc_social_icons' :
|
229 |
+
$widget = new WPC_Shortcodes_Widget_Social_Icons();
|
230 |
+
$widget->form( $attr );
|
231 |
+
break;
|
232 |
+
case 'wc_share_buttons' :
|
233 |
+
$widget = new WPC_Shortcodes_Widget_Share_Buttons();
|
234 |
+
$widget->form( $attr );
|
235 |
+
break;
|
236 |
+
case 'wc_testimonial' :
|
237 |
+
$widget = new WPC_Shortcodes_Widget_Testimonial();
|
238 |
+
$widget->form( $attr );
|
239 |
+
break;
|
240 |
+
case 'wc_image' :
|
241 |
+
$widget = new WPC_Shortcodes_Widget_Image();
|
242 |
+
$widget->form( $attr );
|
243 |
+
break;
|
244 |
+
case 'wc_fa' :
|
245 |
+
$widget = new WPC_Shortcodes_Widget_FA();
|
246 |
+
$widget->form( $attr );
|
247 |
+
break;
|
248 |
+
case 'wc_googlemap' :
|
249 |
+
$widget = new WPC_Shortcodes_Widget_GoogleMap();
|
250 |
+
$widget->form( $attr );
|
251 |
+
break;
|
252 |
+
case 'wc_countdown' :
|
253 |
+
$widget = new WPC_Shortcodes_Widget_Countdown();
|
254 |
+
$widget->form( $attr );
|
255 |
+
break;
|
256 |
+
case 'wc_rsvp' :
|
257 |
+
$widget = new WPC_Shortcodes_Widget_RSVP();
|
258 |
+
$widget->form( $attr );
|
259 |
+
break;
|
260 |
+
case 'wc_html' :
|
261 |
+
$widget = new WPC_Shortcodes_Widget_HTML();
|
262 |
+
$widget->form( $attr );
|
263 |
+
break;
|
264 |
+
case 'wc_box' :
|
265 |
+
$widget = new WPC_Shortcodes_Widget_Box();
|
266 |
+
$widget->form( $attr );
|
267 |
+
break;
|
268 |
+
case 'wc_highlight' :
|
269 |
+
$widget = new WPC_Shortcodes_Widget_Highlight();
|
270 |
+
$widget->form( $attr );
|
271 |
+
break;
|
272 |
+
case 'wc_divider' :
|
273 |
+
$widget = new WPC_Shortcodes_Widget_Divider();
|
274 |
+
$widget->form( $attr );
|
275 |
+
break;
|
276 |
+
case 'wc_pre' :
|
277 |
+
$widget = new WPC_Shortcodes_Widget_Pre();
|
278 |
+
$widget->form( $attr );
|
279 |
+
break;
|
280 |
+
case 'wc_center' :
|
281 |
+
$widget = new WPC_Shortcodes_Widget_Center();
|
282 |
+
$widget->form( $attr );
|
283 |
+
break;
|
284 |
+
case 'wc_fullwidth' :
|
285 |
+
$widget = new WPC_Shortcodes_Widget_FullWidth();
|
286 |
+
$widget->form( $attr );
|
287 |
+
break;
|
288 |
+
case 'wc_heading' :
|
289 |
+
$widget = new WPC_Shortcodes_Widget_Heading();
|
290 |
+
$widget->form( $attr );
|
291 |
+
break;
|
292 |
case 'wc_post_slider' :
|
293 |
+
$widget = new WPC_Shortcodes_Widget_Post_Slider();
|
294 |
$widget->form( $attr );
|
295 |
break;
|
296 |
case 'wc_posts' :
|
297 |
+
$widget = new WPC_Shortcodes_Widget_Posts();
|
298 |
$widget->form( $attr );
|
299 |
break;
|
300 |
}
|
303 |
}
|
304 |
|
305 |
private function parse_shortcode( $check_tag, $content ) {
|
306 |
+
// Some shortcodes are not commonly registered. Need to be able to parse them.
|
307 |
+
// global $shortcode_tags;
|
308 |
|
309 |
if ( false === strpos( $content, '[' ) ) {
|
310 |
return false;
|
311 |
}
|
312 |
|
313 |
+
/*
|
314 |
if (empty($shortcode_tags) || !is_array($shortcode_tags))
|
315 |
return false;
|
316 |
|
317 |
// Find all registered tag names in $content.
|
318 |
preg_match_all( '@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches );
|
319 |
$tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
|
320 |
+
*/
|
321 |
+
|
322 |
+
$tagnames = array( $check_tag );
|
323 |
|
324 |
if ( empty( $tagnames ) ) {
|
325 |
return false;
|
admin/class-tinymce-buttons.php
CHANGED
@@ -22,8 +22,6 @@ class WPC_Shortcodes_TinyMCE_Buttons {
|
|
22 |
return;
|
23 |
|
24 |
if ( get_user_option('rich_editing') == 'true' ) {
|
25 |
-
// add_action('admin_enqueue_scripts', array( &$this, 'register_plugin_styles' ));
|
26 |
-
|
27 |
add_filter( 'mce_external_plugins', array( &$this, 'add_plugin' ) );
|
28 |
add_filter( 'mce_buttons', array( &$this,'register_button' ) );
|
29 |
}
|
@@ -46,7 +44,6 @@ class WPC_Shortcodes_TinyMCE_Buttons {
|
|
46 |
// version 3.9 updated to tinymce 4.0
|
47 |
if ( version_compare( $wp_version, '3.9', '>=' ) ) {
|
48 |
$plugin_array['wpc_shortcodes'] = WC_SHORTCODES_PLUGIN_URL .'admin/assets/js/shortcodes-tinymce-4.js?ver=' . $ver;
|
49 |
-
$plugin_array['wpc_font_awesome'] = WC_SHORTCODES_PLUGIN_URL .'admin/assets/js/font-awesome-tinymce-4.js?ver=' . $ver;
|
50 |
}
|
51 |
else {
|
52 |
$plugin_array['wpc_shortcodes'] = WC_SHORTCODES_PLUGIN_URL .'admin/assets/js/shortcodes_tinymce.js?ver=' . $ver;
|
@@ -57,14 +54,7 @@ class WPC_Shortcodes_TinyMCE_Buttons {
|
|
57 |
|
58 |
public function register_button($buttons) {
|
59 |
array_push($buttons, "wpc_shortcodes_button");
|
60 |
-
array_push($buttons, 'wpcfontAwesomeGlyphSelect');
|
61 |
|
62 |
return $buttons;
|
63 |
}
|
64 |
-
|
65 |
-
public function register_plugin_styles() {
|
66 |
-
global $wp_styles;
|
67 |
-
|
68 |
-
wp_enqueue_style('wc-font-awesome-styles', WC_SHORTCODES_PLUGIN_URL . 'public/assets/css/font-awesome.css', array(), WC_SHORTCODES_VERSION, 'all');
|
69 |
-
}
|
70 |
}
|
22 |
return;
|
23 |
|
24 |
if ( get_user_option('rich_editing') == 'true' ) {
|
|
|
|
|
25 |
add_filter( 'mce_external_plugins', array( &$this, 'add_plugin' ) );
|
26 |
add_filter( 'mce_buttons', array( &$this,'register_button' ) );
|
27 |
}
|
44 |
// version 3.9 updated to tinymce 4.0
|
45 |
if ( version_compare( $wp_version, '3.9', '>=' ) ) {
|
46 |
$plugin_array['wpc_shortcodes'] = WC_SHORTCODES_PLUGIN_URL .'admin/assets/js/shortcodes-tinymce-4.js?ver=' . $ver;
|
|
|
47 |
}
|
48 |
else {
|
49 |
$plugin_array['wpc_shortcodes'] = WC_SHORTCODES_PLUGIN_URL .'admin/assets/js/shortcodes_tinymce.js?ver=' . $ver;
|
54 |
|
55 |
public function register_button($buttons) {
|
56 |
array_push($buttons, "wpc_shortcodes_button");
|
|
|
57 |
|
58 |
return $buttons;
|
59 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
}
|
includes/vendors/wpc-settings-framework/class-wpc-settings-framework.php
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
*/
|
18 |
class WC_Shortcodes_Settings_Framework {
|
19 |
|
20 |
-
protected $version = '1.0.
|
21 |
|
22 |
/**
|
23 |
* Instance of this class.
|
17 |
*/
|
18 |
class WC_Shortcodes_Settings_Framework {
|
19 |
|
20 |
+
protected $version = '1.0.5';
|
21 |
|
22 |
/**
|
23 |
* Instance of this class.
|
includes/vendors/wpc-settings-framework/views/tabs.php
CHANGED
@@ -3,6 +3,13 @@ $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 ] ) ) {
|
3 |
$cookie_name = $this->plugin_prefix . 'wpcsf_active_tab';
|
4 |
|
5 |
// restore last tab visited
|
6 |
+
if ( isset( $_GET['wpcsf_active_tab'] ) && ! empty( $_GET['wpcsf_active_tab'] ) ) {
|
7 |
+
$tab_check = $_GET['wpcsf_active_tab'];
|
8 |
+
if ( isset( $this->tabs[ $menu_slug ][ $tab_check ] ) ) {
|
9 |
+
$active_tab = $tab_check;
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
if ( empty( $active_tab ) && isset( $_COOKIE[ $cookie_name ] ) && ! empty( $_COOKIE[ $cookie_name ] ) ) {
|
14 |
$last_tab = $_COOKIE[ $cookie_name ];
|
15 |
if ( isset( $this->tabs[ $menu_slug ][ $last_tab ] ) ) {
|
public/assets/css/style.css
CHANGED
@@ -507,6 +507,13 @@
|
|
507 |
margin-left: 10px;
|
508 |
}
|
509 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
510 |
/* Secondary */
|
511 |
.wc-shortcodes-button.wc-shortcodes-button-secondary:visited,
|
512 |
.wc-shortcodes-button.wc-shortcodes-button-secondary {
|
@@ -1237,7 +1244,7 @@ pre.pre-wrap {
|
|
1237 |
* Social Media Widget
|
1238 |
* ----------------------------------------------------------------------------
|
1239 |
*/
|
1240 |
-
.
|
1241 |
text-align: center;
|
1242 |
}
|
1243 |
.wc-shortcodes-social-icons.wc-shortcodes-columns-float-left {
|
@@ -1246,7 +1253,7 @@ pre.pre-wrap {
|
|
1246 |
.wc-shortcodes-social-icons.wc-shortcodes-columns-float-right {
|
1247 |
text-align: right;
|
1248 |
}
|
1249 |
-
.
|
1250 |
display: inline-block;
|
1251 |
padding: 3px;
|
1252 |
margin: 0;
|
@@ -1254,36 +1261,36 @@ pre.pre-wrap {
|
|
1254 |
-moz-box-sizing: border-box;
|
1255 |
box-sizing: border-box;
|
1256 |
}
|
1257 |
-
.
|
1258 |
padding-right: 6px;
|
1259 |
padding-left: 0;
|
1260 |
}
|
1261 |
-
.
|
1262 |
padding-right: 0;
|
1263 |
padding-left: 6px;
|
1264 |
}
|
1265 |
-
.
|
1266 |
width: 12.5%;
|
1267 |
}
|
1268 |
-
.
|
1269 |
width: 14.28571428%;
|
1270 |
}
|
1271 |
-
.
|
1272 |
width: 16.66666666%;
|
1273 |
}
|
1274 |
-
.
|
1275 |
width: 20%;
|
1276 |
}
|
1277 |
-
.
|
1278 |
width: 25%;
|
1279 |
}
|
1280 |
-
.
|
1281 |
width: 33.33333333%;
|
1282 |
}
|
1283 |
-
.
|
1284 |
width: 50%;
|
1285 |
}
|
1286 |
-
.
|
1287 |
width: 100%;
|
1288 |
}
|
1289 |
|
@@ -1394,6 +1401,9 @@ pre.pre-wrap {
|
|
1394 |
padding-bottom: 5px;
|
1395 |
display: none;
|
1396 |
}
|
|
|
|
|
|
|
1397 |
|
1398 |
|
1399 |
/**
|
507 |
margin-left: 10px;
|
508 |
}
|
509 |
|
510 |
+
.wc-shortcodes-button-icon-left {
|
511 |
+
margin-right: 0.5em;
|
512 |
+
}
|
513 |
+
.wc-shortcodes-button-icon-right {
|
514 |
+
margin-left: 0.5em;
|
515 |
+
}
|
516 |
+
|
517 |
/* Secondary */
|
518 |
.wc-shortcodes-button.wc-shortcodes-button-secondary:visited,
|
519 |
.wc-shortcodes-button.wc-shortcodes-button-secondary {
|
1244 |
* Social Media Widget
|
1245 |
* ----------------------------------------------------------------------------
|
1246 |
*/
|
1247 |
+
.wc-shortcodes-social-icons-wrapper .wc-shortcodes-social-icons {
|
1248 |
text-align: center;
|
1249 |
}
|
1250 |
.wc-shortcodes-social-icons.wc-shortcodes-columns-float-left {
|
1253 |
.wc-shortcodes-social-icons.wc-shortcodes-columns-float-right {
|
1254 |
text-align: right;
|
1255 |
}
|
1256 |
+
.wc-shortcodes-social-icons-wrapper .wc-shortcodes-social-icons li {
|
1257 |
display: inline-block;
|
1258 |
padding: 3px;
|
1259 |
margin: 0;
|
1261 |
-moz-box-sizing: border-box;
|
1262 |
box-sizing: border-box;
|
1263 |
}
|
1264 |
+
.wc-shortcodes-social-icons-wrapper .wc-shortcodes-social-icons.wc-shortcodes-columns-float-left li {
|
1265 |
padding-right: 6px;
|
1266 |
padding-left: 0;
|
1267 |
}
|
1268 |
+
.wc-shortcodes-social-icons-wrapper .wc-shortcodes-social-icons.wc-shortcodes-columns-float-right li {
|
1269 |
padding-right: 0;
|
1270 |
padding-left: 6px;
|
1271 |
}
|
1272 |
+
.wc-shortcodes-social-icons-wrapper .wc-shortcodes-social-icons.wc-shortcodes-columns-8 li {
|
1273 |
width: 12.5%;
|
1274 |
}
|
1275 |
+
.wc-shortcodes-social-icons-wrapper .wc-shortcodes-social-icons.wc-shortcodes-columns-7 li {
|
1276 |
width: 14.28571428%;
|
1277 |
}
|
1278 |
+
.wc-shortcodes-social-icons-wrapper .wc-shortcodes-social-icons.wc-shortcodes-columns-6 li {
|
1279 |
width: 16.66666666%;
|
1280 |
}
|
1281 |
+
.wc-shortcodes-social-icons-wrapper .wc-shortcodes-social-icons.wc-shortcodes-columns-5 li {
|
1282 |
width: 20%;
|
1283 |
}
|
1284 |
+
.wc-shortcodes-social-icons-wrapper .wc-shortcodes-social-icons.wc-shortcodes-columns-4 li {
|
1285 |
width: 25%;
|
1286 |
}
|
1287 |
+
.wc-shortcodes-social-icons-wrapper .wc-shortcodes-social-icons.wc-shortcodes-columns-3 li {
|
1288 |
width: 33.33333333%;
|
1289 |
}
|
1290 |
+
.wc-shortcodes-social-icons-wrapper .wc-shortcodes-social-icons.wc-shortcodes-columns-2 li {
|
1291 |
width: 50%;
|
1292 |
}
|
1293 |
+
.wc-shortcodes-social-icons-wrapper .wc-shortcodes-social-icons.wc-shortcodes-columns-1 li {
|
1294 |
width: 100%;
|
1295 |
}
|
1296 |
|
1401 |
padding-bottom: 5px;
|
1402 |
display: none;
|
1403 |
}
|
1404 |
+
.wc-shortcodes-rsvp .rsvp-button {
|
1405 |
+
display: inline-block;
|
1406 |
+
}
|
1407 |
|
1408 |
|
1409 |
/**
|
public/class-public.php
CHANGED
@@ -99,9 +99,8 @@ class WPC_Shortcodes_Public extends WPC_Shortcodes_Vars {
|
|
99 |
wp_register_script( 'wc-shortcodes-prettify', WC_SHORTCODES_PLUGIN_URL . 'public/assets/js/prettify.js', array ( ), $ver, true );
|
100 |
wp_register_script( 'wc-shortcodes-pre', WC_SHORTCODES_PLUGIN_URL . 'public/assets/js/pre.js', array ( 'jquery' ), $ver, true );
|
101 |
|
102 |
-
if (
|
103 |
-
parent::$
|
104 |
-
wp_register_script( 'wc-shortcodes-googlemap-api', 'https://maps.googleapis.com/maps/api/js?key=' . urlencode( $api_key ), array('jquery'), $ver, true);
|
105 |
wp_register_script( 'wc-shortcodes-googlemap', WC_SHORTCODES_PLUGIN_URL . 'public/assets/js/googlemap.js', array('jquery', 'wc-shortcodes-googlemap-api'), $ver, true);
|
106 |
}
|
107 |
wp_register_script( 'wc-shortcodes-skillbar', WC_SHORTCODES_PLUGIN_URL . 'public/assets/js/skillbar.js', array ( 'jquery' ), $ver, true );
|
99 |
wp_register_script( 'wc-shortcodes-prettify', WC_SHORTCODES_PLUGIN_URL . 'public/assets/js/prettify.js', array ( ), $ver, true );
|
100 |
wp_register_script( 'wc-shortcodes-pre', WC_SHORTCODES_PLUGIN_URL . 'public/assets/js/pre.js', array ( 'jquery' ), $ver, true );
|
101 |
|
102 |
+
if ( parent::$google_maps_api_key ) {
|
103 |
+
wp_register_script( 'wc-shortcodes-googlemap-api', 'https://maps.googleapis.com/maps/api/js?key=' . urlencode( parent::$google_maps_api_key ), array('jquery'), $ver, true);
|
|
|
104 |
wp_register_script( 'wc-shortcodes-googlemap', WC_SHORTCODES_PLUGIN_URL . 'public/assets/js/googlemap.js', array('jquery', 'wc-shortcodes-googlemap-api'), $ver, true);
|
105 |
}
|
106 |
wp_register_script( 'wc-shortcodes-skillbar', WC_SHORTCODES_PLUGIN_URL . 'public/assets/js/skillbar.js', array ( 'jquery' ), $ver, true );
|
public/class-register.php
CHANGED
@@ -26,7 +26,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
26 |
add_shortcode( 'wc_highlight', array( &$this, 'highlight' ) );
|
27 |
add_shortcode( 'wc_button', array( &$this, 'button' ) );
|
28 |
add_shortcode( 'wc_heading', array( &$this, 'heading' ) );
|
29 |
-
add_shortcode( 'wc_googlemap', array( &$this, '
|
30 |
add_shortcode( 'wc_divider', array( &$this, 'divider' ) );
|
31 |
add_shortcode( 'wc_countdown', array( &$this, 'countdown' ) );
|
32 |
add_shortcode( 'wc_rsvp', array( &$this, 'rsvp' ) );
|
@@ -102,17 +102,16 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
102 |
*/
|
103 |
public function fullwidth( $atts, $content = null ) {
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
), $atts));
|
108 |
|
109 |
-
if ( empty( $selector ) ) {
|
110 |
-
$selector = parent::$theme_support[ 'fullwidth_container' ];
|
111 |
}
|
112 |
|
113 |
wp_enqueue_script('wc-shortcodes-fullwidth');
|
114 |
|
115 |
-
return '<div class="wc-shortcodes-full-width wc-shortcodes-content" data-selector="' . esc_attr( $selector ) . '">' . do_shortcode( $content ) . '</div>';
|
116 |
}
|
117 |
|
118 |
|
@@ -131,18 +130,13 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
131 |
if ( $content != null )
|
132 |
return $content;
|
133 |
|
134 |
-
|
135 |
-
|
136 |
-
), $atts));
|
137 |
|
138 |
-
|
139 |
-
$name = WPC_Shortcodes_Sanitize::text_field( $name );
|
140 |
-
$name = preg_replace( '/^_/', '', $name );
|
141 |
-
|
142 |
-
if ( empty( $name ) )
|
143 |
return null;
|
144 |
|
145 |
-
if ( $snippet = get_post_meta($post->ID, $name, true ) ) {
|
146 |
$html = '<div class="wc-shortcodes-html-wrapper wc-shortcodes-item wc-shortcodes-content">' . $snippet . '</div>';
|
147 |
}
|
148 |
|
@@ -175,43 +169,28 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
175 |
if ( $content != null )
|
176 |
return $content;
|
177 |
|
178 |
-
|
179 |
-
|
180 |
-
'scrollable' => 1,
|
181 |
-
'color' => 1,
|
182 |
-
'lang' => '',
|
183 |
-
'linenums' => 0,
|
184 |
-
'wrap' => 0,
|
185 |
-
), $atts));
|
186 |
-
|
187 |
-
// sanitize
|
188 |
-
$scrollable = WPC_Shortcodes_Sanitize::bool( $scrollable );
|
189 |
-
$color = WPC_Shortcodes_Sanitize::bool( $color );
|
190 |
-
$linenums = WPC_Shortcodes_Sanitize::bool( $linenums );
|
191 |
-
$wrap = WPC_Shortcodes_Sanitize::bool( $wrap );
|
192 |
-
$name = WPC_Shortcodes_Sanitize::text_field( $name );
|
193 |
|
194 |
$class = array();
|
195 |
-
if (
|
196 |
$class[] = 'prettyprint';
|
197 |
-
if (
|
198 |
$class[] = 'linenums';
|
199 |
-
if ( ! empty( $lang ) )
|
200 |
-
$class[] = 'lang-' . $lang;
|
201 |
}
|
202 |
-
if (
|
203 |
$class[] = 'pre-scrollable';
|
204 |
-
if (
|
205 |
$class[] = 'pre-wrap';
|
206 |
|
207 |
$class = implode( ' ', $class );
|
208 |
|
209 |
-
|
210 |
-
|
211 |
-
if ( empty( $name ) )
|
212 |
return null;
|
213 |
|
214 |
-
if ( $code = get_post_meta($post->ID, $name, true ) ) {
|
215 |
wp_enqueue_script('wc-shortcodes-prettify');
|
216 |
wp_enqueue_script('wc-shortcodes-pre');
|
217 |
//$code = preg_replace( '/[ ]{4,}|[\t]/', ' ', $code );
|
@@ -238,28 +217,18 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
238 |
* @since v1.3
|
239 |
*/
|
240 |
public function skillbar( $atts ) {
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
'color' => '#6adcfa',
|
245 |
-
'class' => '',
|
246 |
-
'show_percent' => 'true'
|
247 |
-
), $atts ) );
|
248 |
-
|
249 |
-
// sanitize
|
250 |
-
$percentage = WPC_Shortcodes_Sanitize::int_float( $percentage );
|
251 |
-
$color = WPC_Shortcodes_Sanitize::hex_color( $color );
|
252 |
-
$show_percent = WPC_Shortcodes_Sanitize::bool( $show_percent );
|
253 |
-
|
254 |
// Enque scripts
|
255 |
wp_enqueue_script('wc-shortcodes-skillbar');
|
256 |
|
257 |
// Display the accordion ';
|
258 |
-
$output = '<div class="wc-shortcodes-skillbar wc-shortcodes-item wc-shortcodes-clearfix '. esc_attr( $class ) .'" data-percent="'. esc_attr( $percentage ) .'%">';
|
259 |
-
if ( $title !== '' ) $output .= '<div class="wc-shortcodes-skillbar-title" style="background: '. esc_attr( $color ) .';"><span>'. esc_html( $title ) .'</span></div>';
|
260 |
-
$output .= '<div class="wc-shortcodes-skillbar-bar" style="background: '. esc_attr( $color ) .';"></div>';
|
261 |
-
if ( $show_percent ) {
|
262 |
-
$output .= '<div class="wc-shortcodes-skill-bar-percent">'.$percentage.'%</div>';
|
263 |
}
|
264 |
$output .= '</div>';
|
265 |
|
@@ -272,15 +241,10 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
272 |
* @since v1.0
|
273 |
*/
|
274 |
public function spacing( $atts ) {
|
275 |
-
|
276 |
-
|
277 |
-
'class' => '',
|
278 |
-
), $atts ) );
|
279 |
-
|
280 |
-
// sanitize
|
281 |
-
$size = WPC_Shortcodes_Sanitize::css_unit( $size );
|
282 |
|
283 |
-
return '<hr class="wc-shortcodes-spacing '. esc_attr( $class ) .'" style="height: '. esc_attr( $size ) .'" />';
|
284 |
}
|
285 |
|
286 |
|
@@ -289,53 +253,51 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
289 |
* @since 1.0
|
290 |
*/
|
291 |
public function social_icons( $atts ){
|
292 |
-
|
293 |
-
|
294 |
-
'size' => 'large', // deprecated. using maxheight now
|
295 |
-
'align' => 'left',
|
296 |
-
'maxheight' => '0',
|
297 |
-
), $atts));
|
298 |
-
|
299 |
-
// sanitize
|
300 |
-
$maxheight = (int) $maxheight;
|
301 |
-
|
302 |
-
if ( empty( $maxheight ) ) {
|
303 |
-
switch ( $size ) {
|
304 |
-
case 'small' :
|
305 |
-
$maxheight = 16;
|
306 |
-
break;
|
307 |
-
case 'medium' :
|
308 |
-
$maxheight = 24;
|
309 |
-
break;
|
310 |
-
default :
|
311 |
-
$maxheight = 48;
|
312 |
-
}
|
313 |
-
}
|
314 |
-
|
315 |
-
$class = trim( 'wc-shortcodes-social-icons-wrapper wc-shortcodes-item ' . $class );
|
316 |
|
317 |
$order = get_option( WC_SHORTCODES_PREFIX . 'social_icons_display' );
|
318 |
-
|
319 |
-
|
|
|
|
|
|
|
|
|
320 |
|
321 |
if ( ! is_array( $order ) || empty( $order ) ) {
|
322 |
return;
|
323 |
}
|
324 |
|
325 |
-
|
326 |
-
|
|
|
|
|
|
|
|
|
327 |
|
|
|
328 |
$classes[] = 'wc-shortcodes-social-icons';
|
329 |
$classes[] = 'wc-shortcodes-clearfix';
|
330 |
-
$classes[] = 'wc-shortcodes-
|
331 |
-
$classes[] = 'wc-shortcodes-maxheight-'.$maxheight;
|
332 |
-
$classes[] = 'wc-shortcodes-social-icons-format-'.$format;
|
333 |
|
334 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
|
336 |
-
$html = '<div class="' . esc_attr( $class ) . '">';
|
337 |
-
$html .= '<ul class="'.esc_attr( implode( ' ', $classes ) ).'">';
|
338 |
-
foreach ( $order as $key => $value ) {
|
339 |
$link_option_name = WC_SHORTCODES_PREFIX . $key . '_link';
|
340 |
$image_icon_option_name = WC_SHORTCODES_PREFIX . $key . '_icon';
|
341 |
$font_icon_option_name = WC_SHORTCODES_PREFIX . $key . '_font_icon';
|
@@ -351,7 +313,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
351 |
|
352 |
$html .= '<li class="wc-shortcodes-social-icon wc-shortcode-social-icon-' . esc_attr( $key . $first_class ) . '">';
|
353 |
$html .='<a target="_blank" href="'.esc_url( $social_link ).'">';
|
354 |
-
$html .= '<img src="'.esc_url( $icon_url ).'" alt="'.esc_attr( $
|
355 |
$html .= '</a>';
|
356 |
$html .= '</li>';
|
357 |
}
|
@@ -376,13 +338,10 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
376 |
* @since 1.0
|
377 |
*/
|
378 |
public function highlight( $atts, $content = null ) {
|
379 |
-
|
380 |
-
|
381 |
-
'class' => '',
|
382 |
-
), $atts ) );
|
383 |
|
384 |
-
return '<span class="wc-shortcodes-highlight wc-shortcodes-highlight-'. esc_attr( $color ) .' '. esc_attr( $class ) .'">' . do_shortcode( $content ) . '</span>';
|
385 |
-
|
386 |
}
|
387 |
|
388 |
|
@@ -391,51 +350,35 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
391 |
* @since v1.0
|
392 |
*/
|
393 |
public function button( $atts, $content = null ) {
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
'border_radius' => '',
|
401 |
-
'icon_left' => '',
|
402 |
-
'icon_right' => '',
|
403 |
-
'position' => 'float',
|
404 |
-
'class' => '',
|
405 |
-
), $atts ) );
|
406 |
-
|
407 |
-
// sanitize
|
408 |
-
$border_radius = WPC_Shortcodes_Sanitize::css_unit( $border_radius );
|
409 |
-
|
410 |
-
$custom_class = sanitize_title( $class );
|
411 |
-
|
412 |
-
// $border_radius_style = ( $border_radius ) ? 'style="border-radius:'. $border_radius .'"' : NULL;
|
413 |
-
$rel = ( $rel ) ? 'rel="'.$rel.'"' : NULL;
|
414 |
-
$type = 'wc-shortcodes-button-' . $type;
|
415 |
|
416 |
$class = array();
|
417 |
$class[] = 'wc-shortcodes-button';
|
418 |
-
$class[] = $type;
|
419 |
-
$class[] = 'wc-shortcodes-button-position-' . $position;
|
420 |
if ( ! empty( $custom_class ) )
|
421 |
$class[] = $custom_class;
|
422 |
|
423 |
$button = null;
|
424 |
-
$button .= '<a href="' . esc_url( $url ) . '" class="'.esc_attr( implode( ' ', $class ) ).'"
|
425 |
$button .= '<span class="wc-shortcodes-button-inner">';
|
426 |
-
if ( $icon_left ) {
|
427 |
-
$button .= '<span class="wc-shortcodes-button-icon-left
|
428 |
}
|
429 |
$button .= $content;
|
430 |
-
if ( $icon_right ) {
|
431 |
-
$button .= '<span class="wc-shortcodes-button-icon-right
|
432 |
}
|
433 |
$button .= '</span>';
|
434 |
$button .= '</a>';
|
435 |
|
436 |
-
|
437 |
-
|
438 |
-
$button = '<div class="wc-shortcodes-item wc-shortcodes-button-'.$position.'">'. $button .'</div>';
|
439 |
}
|
440 |
|
441 |
return $button;
|
@@ -449,28 +392,19 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
449 |
*
|
450 |
*/
|
451 |
public function box( $atts, $content = null ) {
|
452 |
-
|
453 |
-
|
454 |
-
'text_align' => 'left',
|
455 |
-
'margin_top' => '',
|
456 |
-
'margin_bottom' => '',
|
457 |
-
'class' => '',
|
458 |
-
), $atts ) );
|
459 |
-
|
460 |
-
$margin_top = WPC_Shortcodes_Sanitize::css_unit( $margin_top );
|
461 |
-
$margin_bottom = WPC_Shortcodes_Sanitize::css_unit( $margin_bottom );
|
462 |
|
463 |
$style_attr = '';
|
464 |
|
465 |
-
if( $margin_bottom ) {
|
466 |
-
$style_attr .= 'margin-bottom: '. $margin_bottom .';';
|
467 |
}
|
468 |
-
if ( $margin_top ) {
|
469 |
-
$style_attr .= 'margin-top: '. $margin_top .';';
|
470 |
}
|
471 |
|
472 |
-
$alert_content = '';
|
473 |
-
$alert_content .= '<div class="wc-shortcodes-box wc-shortcodes-item wc-shortcodes-content wc-shortcodes-clearfix wc-shortcodes-box-' . esc_attr( $color ) . ' '. esc_attr( $class ) .'" style="text-align:'. esc_attr( $text_align ) .';'. esc_attr( $style_attr ) .'">';
|
474 |
|
475 |
$alert_content .= ' '. do_shortcode($content) .'</div>';
|
476 |
|
@@ -485,22 +419,18 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
485 |
*
|
486 |
*/
|
487 |
public function testimonial( $atts, $content = null ) {
|
488 |
-
|
489 |
-
|
490 |
-
'url' => '',
|
491 |
-
'position' => 'left',
|
492 |
-
'class' => '',
|
493 |
-
), $atts ) );
|
494 |
|
495 |
-
if ( ! empty( $url ) ) {
|
496 |
-
$by = '<a href="' . esc_url( $url ) . '">' . $by . '</a>';
|
497 |
}
|
498 |
|
499 |
$testimonial_content = '';
|
500 |
-
$testimonial_content .= '<div class="wc-shortcodes-testimonial wc-shortcodes-item wc-shortcodes-clearfix wc-shortcodes-testimonial-'.esc_attr( $position ).' '. esc_attr( $class ) .'"><div class="wc-shortcodes-testimonial-content wc-shortcodes-content">';
|
501 |
$testimonial_content .= $content;
|
502 |
$testimonial_content .= '</div><div class="wc-shortcodes-testimonial-author">';
|
503 |
-
$testimonial_content .= $by .'</div></div>';
|
504 |
|
505 |
return $testimonial_content;
|
506 |
}
|
@@ -513,18 +443,13 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
513 |
*
|
514 |
*/
|
515 |
public function center( $atts, $content = null ){
|
516 |
-
|
517 |
-
|
518 |
-
'text_align' => 'center',
|
519 |
-
'class' => '',
|
520 |
-
), $atts ) );
|
521 |
-
|
522 |
-
$max_width = WPC_Shortcodes_Sanitize::css_unit( $max_width );
|
523 |
|
524 |
// $append_clearfix = '<div class="wc-shortcodes-clear-floats"></div>';
|
525 |
-
$style = empty( $max_width ) ? '' : ' style="max-width:'.esc_attr( $max_width ).';"';
|
526 |
|
527 |
-
return '<div class="wc-shortcodes-center wc-shortcodes-item wc-shortcodes-content wc-shortcodes-clearfix wc-shortcodes-center-inner-align-'. esc_attr( $text_align ) .' '. esc_attr( $class ) .'"' . $style . '>' . do_shortcode($content) . '</div>';
|
528 |
}
|
529 |
|
530 |
|
@@ -535,26 +460,22 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
535 |
*
|
536 |
*/
|
537 |
public function column( $atts, $content = null ){
|
538 |
-
|
539 |
-
|
540 |
-
'position' =>'',
|
541 |
-
'class' => '',
|
542 |
-
'text_align'=> '',
|
543 |
-
), $atts ) );
|
544 |
|
545 |
$style = '';
|
546 |
-
if ( $text_align ) {
|
547 |
-
if ( 'left' == $text_align )
|
548 |
-
$style = ' style="text-align: '.esc_attr( $text_align ).';"';
|
549 |
-
if ( 'center' == $text_align )
|
550 |
-
$style = ' style="text-align: '.esc_attr( $text_align ).';"';
|
551 |
-
if ( 'right' == $text_align )
|
552 |
-
$style = ' style="text-align: '.esc_attr( $text_align ).';"';
|
553 |
}
|
554 |
|
555 |
-
$append_clearfix = 'last' == $position ? '<div class="wc-shortcodes-clear-floats"></div>' : '';
|
556 |
|
557 |
-
return '<div'.$style.' class="wc-shortcodes-column wc-shortcodes-content wc-shortcodes-' . esc_attr( $size ) . ' wc-shortcodes-column-'.esc_attr( $position ).' '. esc_attr( $class ) .'">' . do_shortcode($content) . '</div>';
|
558 |
}
|
559 |
|
560 |
|
@@ -576,35 +497,28 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
576 |
* @since v1.0
|
577 |
*/
|
578 |
public function toggle( $atts, $content = null ) {
|
579 |
-
|
580 |
-
|
581 |
-
'class' => '',
|
582 |
-
'padding' => '',
|
583 |
-
'border_width' => '',
|
584 |
-
'layout' => 'box',
|
585 |
-
), $atts ) );
|
586 |
-
|
587 |
-
$padding = WPC_Shortcodes_Sanitize::css_unit( $padding );
|
588 |
|
589 |
$classes = array();
|
590 |
|
591 |
$classes[] = 'wc-shortcodes-toggle';
|
592 |
$classes[] = 'wc-shortcodes-item';
|
593 |
|
594 |
-
if ( ! empty( $class ) )
|
595 |
-
$classes[] = $class;
|
596 |
|
597 |
-
if ( ! empty( $layout ) )
|
598 |
-
$classes[] = 'wc-shortcodes-toggle-layout-' . $layout;
|
599 |
|
600 |
$class = implode( ' ', $classes );
|
601 |
|
602 |
$style = array();
|
603 |
|
604 |
-
if ( ! empty( $padding ) || '0' === $padding )
|
605 |
-
$style[] = 'padding:'.$padding;
|
606 |
-
if ( ! empty( $border_width ) || '0' === $border_width )
|
607 |
-
$style[] = 'border-width:'.$border_width;
|
608 |
|
609 |
$style = implode( ';', $style );
|
610 |
|
@@ -612,7 +526,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
612 |
wp_enqueue_script('wc-shortcodes-toggle');
|
613 |
|
614 |
// Display the Toggle
|
615 |
-
return '<div class="'. esc_attr( $class ) .'"><div class="wc-shortcodes-toggle-trigger"><a href="#">'. esc_html( $title ) .'</a></div><div style="'.esc_attr( $style ).'" class="wc-shortcodes-toggle-container wc-shortcodes-content">' . do_shortcode($content) . '</div></div>';
|
616 |
}
|
617 |
|
618 |
|
@@ -625,15 +539,8 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
625 |
// Main
|
626 |
public function accordion_main( $atts, $content = null ) {
|
627 |
|
628 |
-
|
629 |
-
|
630 |
-
'collapse' => 0,
|
631 |
-
'leaveopen' => 0,
|
632 |
-
'layout' => 'box',
|
633 |
-
), $atts ) );
|
634 |
-
|
635 |
-
$collapse = WPC_Shortcodes_Sanitize::bool( $collapse );
|
636 |
-
$leaveopen = WPC_Shortcodes_Sanitize::bool( $leaveopen );
|
637 |
|
638 |
$classes = array();
|
639 |
|
@@ -641,12 +548,12 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
641 |
$classes[] = 'wc-shortcodes-item';
|
642 |
|
643 |
$behavior = 'autoclose';
|
644 |
-
if ( $leaveopen ) {
|
645 |
$behavior = 'leaveopen';
|
646 |
}
|
647 |
|
648 |
$state = 'default';
|
649 |
-
if ( $collapse ) {
|
650 |
$classes[] = 'wc-shortcodes-accordion-collapse';
|
651 |
$state = 'collapse';
|
652 |
}
|
@@ -654,11 +561,11 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
654 |
$classes[] = 'wc-shortcodes-accordion-default';
|
655 |
}
|
656 |
|
657 |
-
if ( ! empty( $class ) )
|
658 |
$classes[] = $class;
|
659 |
|
660 |
-
if ( ! empty( $layout ) )
|
661 |
-
$classes[] = 'wc-shortcodes-accordion-layout-' . $layout;
|
662 |
|
663 |
$class = implode( ' ', $classes );
|
664 |
|
@@ -672,12 +579,10 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
672 |
|
673 |
// Section
|
674 |
public function accordion_section( $atts, $content = null ) {
|
675 |
-
|
676 |
-
|
677 |
-
'class' => '',
|
678 |
-
), $atts ) );
|
679 |
|
680 |
-
return '<div class="wc-shortcodes-accordion-trigger '. esc_attr( $class ) .'"><a href="#">'. esc_html( $title ) .'</a></div><div class="wc-shortcodes-accordion-content wc-shortcodes-content">' . do_shortcode($content) . '</div>';
|
681 |
}
|
682 |
|
683 |
|
@@ -695,22 +600,19 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
695 |
wp_enqueue_script('wc-shortcodes-tabs');
|
696 |
|
697 |
// Display Tabs
|
698 |
-
$
|
699 |
-
|
700 |
-
'layout' => 'box',
|
701 |
-
);
|
702 |
-
extract( shortcode_atts( $defaults, $atts ) );
|
703 |
|
704 |
$classes = array();
|
705 |
|
706 |
$classes[] = 'wc-shortcodes-tabs';
|
707 |
$classes[] = 'wc-shortcodes-item';
|
708 |
|
709 |
-
if ( ! empty( $class ) )
|
710 |
-
$classes[] = $class;
|
711 |
|
712 |
-
if ( ! empty( $layout ) )
|
713 |
-
$classes[] = 'wc-shortcodes-tabs-layout-' . $layout;
|
714 |
|
715 |
$class = implode( ' ', $classes );
|
716 |
|
@@ -735,10 +637,8 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
735 |
}
|
736 |
|
737 |
public function tab( $atts, $content = null ) {
|
738 |
-
$
|
739 |
-
|
740 |
-
);
|
741 |
-
extract( shortcode_atts( $defaults, $atts ) );
|
742 |
|
743 |
$classes = array();
|
744 |
|
@@ -747,7 +647,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
747 |
|
748 |
$class = implode( ' ', $classes );
|
749 |
|
750 |
-
return '<div id="wc-shortcodes-tab-'. sanitize_title( $title ) .'" class="'. esc_attr( $class ) .'">'. do_shortcode( $content ) .'</div>';
|
751 |
}
|
752 |
|
753 |
|
@@ -760,31 +660,21 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
760 |
*/
|
761 |
/*section*/
|
762 |
public function pricing( $atts, $content = null ) {
|
763 |
-
|
764 |
-
|
765 |
-
'type' => 'primary', // primary, secondary, inverse
|
766 |
-
'plan' => 'Basic', // string
|
767 |
-
'cost' => '$20', // string
|
768 |
-
'per' => 'month', // month, day, year, week, etc
|
769 |
-
'button_url' => '', // url to payment gateway
|
770 |
-
'button_text' => 'Purchase', // call to action button
|
771 |
-
'button_target' => 'self', // self, blank
|
772 |
-
'button_rel' => 'nofollow', // alternate, author, bookmark, help, license, next, nofollow, noreferrer, prefetch, prev, search, tag
|
773 |
-
'class' => '', // add your own css class for customization.
|
774 |
-
), $atts ) );
|
775 |
|
776 |
//start content
|
777 |
$pricing_content ='';
|
778 |
-
$pricing_content .= '<div class="wc-shortcodes-pricing wc-shortcodes-pricing-type-'. esc_attr( $type ) .' '. esc_attr( $class ) .'">';
|
779 |
$pricing_content .= '<div class="wc-shortcodes-pricing-header">';
|
780 |
-
$pricing_content .= '<h5>'. esc_html( $plan ). '</h5>';
|
781 |
-
$pricing_content .= '<div class="wc-shortcodes-pricing-cost">'. esc_html( $cost ) .'</div><div class="wc-shortcodes-pricing-per">'. esc_html( $per ) .'</div>';
|
782 |
$pricing_content .= '</div>';
|
783 |
$pricing_content .= '<div class="wc-shortcodes-pricing-content">';
|
784 |
$pricing_content .= ''. $content. '';
|
785 |
$pricing_content .= '</div>';
|
786 |
-
if( $button_url ) {
|
787 |
-
$pricing_content .= '<div class="wc-shortcodes-pricing-button"><a href="'. esc_url( $button_url ) .'" class="wc-shortcodes-button wc-shortcodes-button-'.esc_attr( $type ).'" target="_'. esc_attr( $button_target ) .'" rel="'. esc_attr( $button_rel ) .'"><span class="wc-shortcodes-button-inner">'. esc_html( $button_text ) .'</span></a></div>';
|
788 |
}
|
789 |
$pricing_content .= '</div>';
|
790 |
return $pricing_content;
|
@@ -797,59 +687,47 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
797 |
* @since v1.1
|
798 |
*/
|
799 |
public function heading( $atts ) {
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
'margin_top' => '',
|
804 |
-
'margin_bottom' => '',
|
805 |
-
'text_align' => '',
|
806 |
-
'font_size' => '',
|
807 |
-
'color' => '',
|
808 |
-
'class' => '',
|
809 |
-
'icon_left' => '',
|
810 |
-
'icon_right' => '',
|
811 |
-
'icon_spacing' => '',
|
812 |
-
), $atts ) );
|
813 |
-
|
814 |
-
$type = WPC_Shortcodes_Sanitize::heading_type( $type );
|
815 |
-
|
816 |
$style_attr = '';
|
817 |
|
818 |
-
if ( $font_size ) {
|
819 |
-
$style_attr .= 'font-size: '. $font_size .';';
|
820 |
}
|
821 |
-
if ( $color ) {
|
822 |
-
$style_attr .= 'color: '. $color .';';
|
823 |
}
|
824 |
-
if( $margin_bottom ) {
|
825 |
-
$style_attr .= 'margin-bottom: '. $margin_bottom .';';
|
826 |
}
|
827 |
-
if ( $margin_top ) {
|
828 |
-
$style_attr .= 'margin-top: '. $margin_top .';';
|
829 |
}
|
830 |
|
831 |
-
if ( $text_align ) {
|
832 |
-
$text_align = 'text-align-'. $text_align;
|
833 |
} else {
|
834 |
$text_align = 'text-align-left';
|
835 |
}
|
836 |
|
837 |
-
if ( 'h1' == $type )
|
838 |
-
$class = trim( 'entry-title ' . $class );
|
|
|
839 |
|
840 |
-
$output = '<'.$type.' class="wc-shortcodes-heading '. esc_attr( $text_align ) .' '. esc_attr( $class ) .'" style="'.esc_attr( $style_attr ).'"><span>';
|
841 |
|
842 |
-
if ( $icon_left )
|
843 |
-
$output .= '<i class="wc-shortcodes-button-icon-left fa fa-'. esc_attr( $icon_left ) .'" style="margin-right:'.esc_attr( $icon_spacing ).'"></i>';
|
844 |
|
845 |
-
$output .= esc_html( $title );
|
846 |
|
847 |
-
if ( $icon_right )
|
848 |
-
$output .= '<i class="wc-shortcodes-button-icon-right fa fa-'. esc_attr( $icon_right ) .'" style="margin-left:'.esc_attr( $icon_spacing ).'"></i>';
|
849 |
|
850 |
-
$output .= '</span></'.$type.'>';
|
851 |
|
852 |
-
if ( 'h1' == $type )
|
853 |
$output = '<header class="entry-header">'. $output . '</header>';
|
854 |
|
855 |
return $output;
|
@@ -860,27 +738,16 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
860 |
* Google Maps
|
861 |
* @since v1.1
|
862 |
*/
|
863 |
-
public function
|
864 |
static $instance = 0;
|
865 |
$instance++;
|
866 |
-
|
867 |
-
if ( empty( parent::$google_map_api_key ) ) {
|
868 |
-
return '<div class="wc-shortcodes-googlemap-api-key-needed"><p>Google requires an <a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank">API key</a> to embed Google Maps. Enter your key in your <a href="' . admin_url( 'themes.php?page=' . parent::$plugin_slug ) . '" target="_blank">Shortcodes option</a> page under the "Maps" tab.</p></div>';
|
869 |
-
}
|
870 |
-
|
871 |
-
extract(shortcode_atts(array(
|
872 |
-
'title' => '', // content inside the info window
|
873 |
-
'title_on_load' => 'no', // should the info window display on map load
|
874 |
-
'location' => '', // Enter a valid address that Google can geocode.
|
875 |
-
'height' => '300', // set the height of your google map in pixels
|
876 |
-
'zoom' => 8, // the lower the zoom, the farther away the map appears
|
877 |
-
'class' => '', // add a custom class to your google map
|
878 |
-
), $atts));
|
879 |
|
880 |
-
|
881 |
-
|
|
|
882 |
|
883 |
-
$
|
|
|
884 |
|
885 |
// load scripts
|
886 |
wp_enqueue_script('wc-shortcodes-googlemap');
|
@@ -889,11 +756,11 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
889 |
$class[] = 'googlemap';
|
890 |
$class[] = 'wc-shortcodes-item';
|
891 |
|
892 |
-
$output = '<div id="map_canvas_'.$instance.'" class="' . esc_attr( implode( ' ', $class ) ) . '" style="height:'.$height.';width:100%">';
|
893 |
-
$output .= (!empty($title)) ? '<input class="title" type="hidden" value="'.esc_html( $title ).'" />' : '';
|
894 |
-
$output .= '<input class="location" type="hidden" value="'.esc_attr( $location ).'" />';
|
895 |
-
$output .= '<input class="zoom" type="hidden" value="'.$zoom.'" />';
|
896 |
-
$output .= '<input class="title-on-load" type="hidden" value="'.$title_on_load.'" />';
|
897 |
$output .= '<div class="map_canvas"></div>';
|
898 |
$output .= '</div>';
|
899 |
|
@@ -906,25 +773,16 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
906 |
* @since v1.1
|
907 |
*/
|
908 |
public function divider( $atts ) {
|
909 |
-
|
910 |
-
|
911 |
-
'line' => 'single',
|
912 |
-
'margin_top' => '',
|
913 |
-
'margin_bottom' => '',
|
914 |
-
'class' => '',
|
915 |
-
), $atts ) );
|
916 |
-
|
917 |
-
$margin_top = WPC_Shortcodes_Sanitize::css_unit( $margin_top );
|
918 |
-
$margin_bottom = WPC_Shortcodes_Sanitize::css_unit( $margin_bottom );
|
919 |
|
920 |
$style_attr = array();
|
921 |
|
922 |
-
if
|
923 |
-
$style_attr[] = 'margin-
|
924 |
-
}
|
925 |
-
|
926 |
-
|
927 |
-
$style_attr[] = 'margin-top: '. $margin_top .';';
|
928 |
}
|
929 |
|
930 |
if ( ! empty ( $style_attr ) ) {
|
@@ -934,7 +792,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
934 |
$style_attr = '';
|
935 |
}
|
936 |
|
937 |
-
|
938 |
}
|
939 |
|
940 |
|
@@ -943,21 +801,16 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
943 |
* @since v1.10
|
944 |
*/
|
945 |
public function countdown( $atts ) {
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
'labels1' => 'Year,Month,Week,Day,Hour,Minute,Second',
|
951 |
-
'message' => 'Your Message Here!',
|
952 |
-
), $atts ) );
|
953 |
-
|
954 |
-
if ( empty( $date ) ) {
|
955 |
return '<p>*Please enter a date for your countdown*</p>';
|
956 |
}
|
957 |
|
958 |
wp_enqueue_script('wc-shortcodes-countdown');
|
959 |
|
960 |
-
$html = '<div class="wc-shortcodes-countdown" data-labels="'.esc_attr($labels).'" data-labels1="'.esc_attr($labels1).'" data-date="'.esc_attr( $date ).'" data-format="'.esc_attr( $format ).'" data-message="'.esc_attr( $message ).'"></div>';
|
961 |
$html = '<div class="wc-shortcodes-countdown-bg1">'.$html.'</div>';
|
962 |
$html = '<div class="wc-shortcodes-countdown-bg2">'.$html.'</div>';
|
963 |
$html = '<div class="wc-shortcodes-countdown-bg3">'.$html.'</div>';
|
@@ -970,17 +823,11 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
970 |
|
971 |
|
972 |
public function rsvp( $atts ) {
|
973 |
-
|
974 |
-
|
975 |
-
'align' => 'left',
|
976 |
-
'button_align' => 'center',
|
977 |
-
), $atts ) );
|
978 |
|
979 |
wp_enqueue_script('wc-shortcodes-rsvp');
|
980 |
|
981 |
-
$columns = WPC_Shortcodes_Sanitize::positive_number( $columns );
|
982 |
-
$columns = 3 == $columns ? $columns : 1;
|
983 |
-
|
984 |
$html = '';
|
985 |
|
986 |
// RSVP Name
|
@@ -1029,7 +876,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
1029 |
|
1030 |
// Style
|
1031 |
|
1032 |
-
if ( 3 == $columns ) {
|
1033 |
$html .= '<div class="wc-shortcodes-row wc-shortcodes-item wc-shortcodes-clearfix">';
|
1034 |
$html .= ' <div class="wc-shortcodes-column wc-shortcodes-one-third wc-shortcodes-column-first ">'.$name_html.'</div>';
|
1035 |
$html .= ' <div class="wc-shortcodes-column wc-shortcodes-one-third wc-shortcodes-column- ">'.$number_html.'</div>';
|
@@ -1043,7 +890,7 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
1043 |
$html .= $name_html . $number_html . $event_html . $action_html . $message_html . $button_html;
|
1044 |
}
|
1045 |
|
1046 |
-
return '<div class="wc-shortcodes-rsvp wc-shortcodes-content wc-shortcodes-item wc-shortcodes-rsvp-columns-'
|
1047 |
}
|
1048 |
|
1049 |
/**
|
@@ -1352,119 +1199,86 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
1352 |
}
|
1353 |
|
1354 |
public function image( $atts ) {
|
1355 |
-
|
1356 |
-
|
1357 |
-
'title' => '',
|
1358 |
-
'alt' => '',
|
1359 |
-
'caption' => '',
|
1360 |
-
|
1361 |
-
// attachment display settings
|
1362 |
-
'link_to' => '', // post, file, none
|
1363 |
-
'url' => '', // for custom link_to
|
1364 |
-
'align' => '', // none, left, center, right
|
1365 |
-
'attachment_id' => '', // int id
|
1366 |
-
'size' => 'large', // image size
|
1367 |
-
|
1368 |
-
// flag options
|
1369 |
-
'flag' => '',
|
1370 |
-
'left' => '',
|
1371 |
-
'right' => '',
|
1372 |
-
'top' => '',
|
1373 |
-
'bottom' => '',
|
1374 |
-
'text_color' => '',
|
1375 |
-
'background_color' => '',
|
1376 |
-
'font_size' => '',
|
1377 |
-
'text_align' => '', // none, left, center, right
|
1378 |
-
'flag_width' => '',
|
1379 |
-
|
1380 |
-
// misc options
|
1381 |
-
'class' => '',
|
1382 |
-
), $atts ) );
|
1383 |
-
|
1384 |
-
$font_size = WPC_Shortcodes_Sanitize::css_unit( $font_size );
|
1385 |
-
$flag_width = WPC_Shortcodes_Sanitize::css_unit( $flag_width );
|
1386 |
|
1387 |
// function options
|
1388 |
$div_wrapper = false;
|
1389 |
|
1390 |
-
// sanitize
|
1391 |
-
$attachment_id = WPC_Shortcodes_Sanitize::number( $attachment_id );
|
1392 |
-
|
1393 |
// classes
|
1394 |
$classes = array();
|
1395 |
|
1396 |
$classes[] = 'wc-shortcodes-image';
|
1397 |
|
1398 |
-
|
1399 |
-
|
1400 |
-
$classes[] = 'align' . $align;
|
1401 |
|
1402 |
-
if ( ! empty( $size ) )
|
1403 |
-
$classes[] = 'size-' . $size;
|
1404 |
|
1405 |
-
if ( ! empty( $attachment_id ) )
|
1406 |
-
$classes[] = 'wp-image-' . $attachment_id;
|
1407 |
|
1408 |
-
if ( ! empty( $class ) )
|
1409 |
-
$classes[] = $class;
|
1410 |
|
1411 |
// check if src is set
|
1412 |
-
list( $src, $width, $height ) = wp_get_attachment_image_src( $attachment_id, $size );
|
1413 |
if ( empty( $src ) ) {
|
1414 |
return '<p>Please insert a valid image</p>';
|
1415 |
}
|
1416 |
|
1417 |
-
$html = '<img alt="' . esc_attr( $alt ) . '" title="' . esc_attr( $title ) . '" src="' . esc_url( $src ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '" />';
|
1418 |
|
1419 |
// insert flag
|
1420 |
-
if ( ! empty( $flag ) ) {
|
1421 |
$style = array();
|
1422 |
-
if (
|
1423 |
-
$style[] = 'top:' .
|
1424 |
-
if (
|
1425 |
-
$style[] = 'right:' .
|
1426 |
-
if (
|
1427 |
-
$style[] = 'bottom:' .
|
1428 |
-
if (
|
1429 |
-
$style[] = 'left:' .
|
1430 |
-
if ( ! empty( $background_color ) )
|
1431 |
-
$style[] = 'background-color:' . $background_color;
|
1432 |
-
if ( ! empty( $text_color ) )
|
1433 |
-
$style[] = 'color:' . $text_color;
|
1434 |
-
if ( ! empty( $font_size ) )
|
1435 |
-
$style[] = 'font-size:' . $font_size;
|
1436 |
-
if (
|
1437 |
-
$style[] = 'text-align:' . $text_align;
|
1438 |
-
if ( ! empty( $flag_width ) )
|
1439 |
-
$style[] = 'width:' . $flag_width;
|
1440 |
-
|
1441 |
-
|
1442 |
-
$html .= '<span style="' . esc_attr( implode( ';', $style ) ) . '" class="wc-shortcodes-image-flag-bg"><span class="wc-shortcodes-image-flag-text">' . esc_html( $flag ) . '</span></span>';
|
1443 |
$div_wrapper = true;
|
1444 |
|
1445 |
}
|
1446 |
|
1447 |
// check link_to
|
1448 |
-
if ( empty( $url ) ) {
|
1449 |
-
if ( 'file' == $link_to )
|
1450 |
-
$url = wp_get_attachment_url( $attachment_id );
|
1451 |
-
else if ( 'post' == $link_to )
|
1452 |
-
$url = get_attachment_link( $attachment_id );
|
1453 |
}
|
1454 |
|
1455 |
-
if ( 'none' != $link_to )
|
1456 |
-
$html = '<a class="wc-shortcodes-image-anchor" href="' . esc_url( $url ) . '">' . $html . '</a>';
|
1457 |
|
1458 |
// insert caption
|
1459 |
-
if ( ! empty( $caption ) ) {
|
1460 |
-
$html .= '<p class="wp-caption-text">' . esc_html( $caption ) . '</p>';
|
1461 |
$div_wrapper = true;
|
1462 |
}
|
1463 |
|
1464 |
// do we need a div wrapper?
|
1465 |
if ( $div_wrapper ) {
|
1466 |
$html = preg_replace( '/(class=["\'][^\'"]*)align(none|left|right|center)\s?/', '$1', $html );
|
1467 |
-
$html = '<div id="attachment_' . esc_attr( $attachment_id ) . '" class="wc-shortcodes-image-wrapper wc-shortcodes-item wp-caption align' . esc_attr( $align ) . '" style="width:' . $width . 'px">' . $html . '</div>';
|
1468 |
}
|
1469 |
else if ( in_array( $align, array( 'none', 'center' ) ) ) {
|
1470 |
$html = '<p>' . $html . '</p>';
|
@@ -1474,20 +1288,10 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
1474 |
}
|
1475 |
|
1476 |
public function fa( $atts ) {
|
1477 |
-
|
1478 |
-
|
1479 |
-
'icon' => '',
|
1480 |
-
'margin_right' => '0',
|
1481 |
-
'margin_left' => '0',
|
1482 |
|
1483 |
-
|
1484 |
-
'class' => '',
|
1485 |
-
), $atts ) );
|
1486 |
-
|
1487 |
-
$margin_right = WPC_Shortcodes_Sanitize::css_unit( $margin_right );
|
1488 |
-
$margin_left = WPC_Shortcodes_Sanitize::css_unit( $margin_left );
|
1489 |
-
|
1490 |
-
if ( empty( $icon ) )
|
1491 |
return '';
|
1492 |
|
1493 |
// classes
|
@@ -1495,17 +1299,17 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
1495 |
|
1496 |
$classes[] = 'wc-shortcodes-fa';
|
1497 |
$classes[] = 'fa';
|
1498 |
-
$classes[] = 'fa-' . $icon;
|
1499 |
-
if ( empty( $class ) )
|
1500 |
-
$classes[] = $class;
|
1501 |
|
1502 |
$style_attr = '';
|
1503 |
|
1504 |
-
if( $margin_right ) {
|
1505 |
-
$style_attr .= 'margin-right: '. $margin_right .';';
|
1506 |
}
|
1507 |
-
if ( $margin_left ) {
|
1508 |
-
$style_attr .= 'margin-left: '. $margin_left .';';
|
1509 |
}
|
1510 |
|
1511 |
$html = '<i class="' . esc_attr( implode( ' ', $classes ) ) . '" style="'.esc_attr( $style_attr ).'"></i>';
|
@@ -1514,10 +1318,8 @@ class WPC_Shortcodes_Register extends WPC_Shortcodes_Vars {
|
|
1514 |
}
|
1515 |
|
1516 |
public function share_buttons( $atts ) {
|
1517 |
-
|
1518 |
-
|
1519 |
-
'class' => '',
|
1520 |
-
), $atts ) );
|
1521 |
|
1522 |
$share_buttons = get_option( WC_SHORTCODES_PREFIX . 'share_buttons_display' );
|
1523 |
$size = sizeof( $share_buttons );
|
26 |
add_shortcode( 'wc_highlight', array( &$this, 'highlight' ) );
|
27 |
add_shortcode( 'wc_button', array( &$this, 'button' ) );
|
28 |
add_shortcode( 'wc_heading', array( &$this, 'heading' ) );
|
29 |
+
add_shortcode( 'wc_googlemap', array( &$this, 'googlemap' ) );
|
30 |
add_shortcode( 'wc_divider', array( &$this, 'divider' ) );
|
31 |
add_shortcode( 'wc_countdown', array( &$this, 'countdown' ) );
|
32 |
add_shortcode( 'wc_rsvp', array( &$this, 'rsvp' ) );
|
102 |
*/
|
103 |
public function fullwidth( $atts, $content = null ) {
|
104 |
|
105 |
+
$atts = shortcode_atts( parent::$attr->fullwidth, $atts );
|
106 |
+
$atts = WPC_Shortcodes_Sanitize::fullwidth_attr( $atts );
|
|
|
107 |
|
108 |
+
if ( empty( $atts['selector'] ) ) {
|
109 |
+
$atts['selector'] = parent::$theme_support[ 'fullwidth_container' ];
|
110 |
}
|
111 |
|
112 |
wp_enqueue_script('wc-shortcodes-fullwidth');
|
113 |
|
114 |
+
return '<div class="wc-shortcodes-full-width wc-shortcodes-content" data-selector="' . esc_attr( $atts['selector'] ) . '">' . do_shortcode( $content ) . '</div>';
|
115 |
}
|
116 |
|
117 |
|
130 |
if ( $content != null )
|
131 |
return $content;
|
132 |
|
133 |
+
$atts = shortcode_atts( parent::$attr->html, $atts );
|
134 |
+
$atts = WPC_Shortcodes_Sanitize::html_attr( $atts );
|
|
|
135 |
|
136 |
+
if ( empty( $atts['name'] ) )
|
|
|
|
|
|
|
|
|
137 |
return null;
|
138 |
|
139 |
+
if ( $snippet = get_post_meta($post->ID, $atts['name'], true ) ) {
|
140 |
$html = '<div class="wc-shortcodes-html-wrapper wc-shortcodes-item wc-shortcodes-content">' . $snippet . '</div>';
|
141 |
}
|
142 |
|
169 |
if ( $content != null )
|
170 |
return $content;
|
171 |
|
172 |
+
$atts = shortcode_atts( parent::$attr->pre, $atts );
|
173 |
+
$atts = WPC_Shortcodes_Sanitize::pre_attr( $atts );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
|
175 |
$class = array();
|
176 |
+
if ( $atts['color'] ) {
|
177 |
$class[] = 'prettyprint';
|
178 |
+
if ( $atts['linenums'] )
|
179 |
$class[] = 'linenums';
|
180 |
+
if ( ! empty( $atts['lang'] ) )
|
181 |
+
$class[] = 'lang-' . $atts['lang'];
|
182 |
}
|
183 |
+
if ( $atts['scrollable'] )
|
184 |
$class[] = 'pre-scrollable';
|
185 |
+
if ( $atts['wrap'] )
|
186 |
$class[] = 'pre-wrap';
|
187 |
|
188 |
$class = implode( ' ', $class );
|
189 |
|
190 |
+
if ( empty( $atts['name'] ) )
|
|
|
|
|
191 |
return null;
|
192 |
|
193 |
+
if ( $code = get_post_meta($post->ID, $atts['name'], true ) ) {
|
194 |
wp_enqueue_script('wc-shortcodes-prettify');
|
195 |
wp_enqueue_script('wc-shortcodes-pre');
|
196 |
//$code = preg_replace( '/[ ]{4,}|[\t]/', ' ', $code );
|
217 |
* @since v1.3
|
218 |
*/
|
219 |
public function skillbar( $atts ) {
|
220 |
+
$atts = shortcode_atts( parent::$attr->skillbar, $atts );
|
221 |
+
$atts = WPC_Shortcodes_Sanitize::skillbar_attr( $atts );
|
222 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
// Enque scripts
|
224 |
wp_enqueue_script('wc-shortcodes-skillbar');
|
225 |
|
226 |
// Display the accordion ';
|
227 |
+
$output = '<div class="wc-shortcodes-skillbar wc-shortcodes-item wc-shortcodes-clearfix '. esc_attr( $atts['class'] ) .'" data-percent="'. esc_attr( $atts['percentage'] ) .'%">';
|
228 |
+
if ( $atts['title'] !== '' ) $output .= '<div class="wc-shortcodes-skillbar-title" style="background: '. esc_attr( $atts['color'] ) .';"><span>'. esc_html( $atts['title'] ) .'</span></div>';
|
229 |
+
$output .= '<div class="wc-shortcodes-skillbar-bar" style="background: '. esc_attr( $atts['color'] ) .';"></div>';
|
230 |
+
if ( $atts['show_percent'] ) {
|
231 |
+
$output .= '<div class="wc-shortcodes-skill-bar-percent">'.$atts['percentage'].'%</div>';
|
232 |
}
|
233 |
$output .= '</div>';
|
234 |
|
241 |
* @since v1.0
|
242 |
*/
|
243 |
public function spacing( $atts ) {
|
244 |
+
$atts = shortcode_atts( parent::$attr->spacing, $atts );
|
245 |
+
$atts = WPC_Shortcodes_Sanitize::spacing_attr( $atts );
|
|
|
|
|
|
|
|
|
|
|
246 |
|
247 |
+
return '<hr class="wc-shortcodes-spacing '. esc_attr( $atts['class'] ) .'" style="height: '. esc_attr( $atts['size'] ) .'" />';
|
248 |
}
|
249 |
|
250 |
|
253 |
* @since 1.0
|
254 |
*/
|
255 |
public function social_icons( $atts ){
|
256 |
+
$atts = shortcode_atts( parent::$attr->social_icons, $atts );
|
257 |
+
$atts = WPC_Shortcodes_Sanitize::social_icons_attr( $atts );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
|
259 |
$order = get_option( WC_SHORTCODES_PREFIX . 'social_icons_display' );
|
260 |
+
|
261 |
+
if ( 'default' == $atts['format'] ) {
|
262 |
+
$atts['format'] = get_option( WC_SHORTCODES_PREFIX . 'social_icons_format', 'icon' );
|
263 |
+
}
|
264 |
+
|
265 |
+
$show_image = 'image' == $atts['format'] ? true : false;
|
266 |
|
267 |
if ( ! is_array( $order ) || empty( $order ) ) {
|
268 |
return;
|
269 |
}
|
270 |
|
271 |
+
$first = true;
|
272 |
+
|
273 |
+
$column_display = false;
|
274 |
+
if ( is_numeric( $atts['columns'] ) & (int) $atts['columns'] > 0 ) {
|
275 |
+
$column_display = true;
|
276 |
+
}
|
277 |
|
278 |
+
$classes = array();
|
279 |
$classes[] = 'wc-shortcodes-social-icons';
|
280 |
$classes[] = 'wc-shortcodes-clearfix';
|
281 |
+
$classes[] = 'wc-shortcodes-columns-'.$atts['columns'];
|
282 |
+
$classes[] = 'wc-shortcodes-maxheight-'.$atts['maxheight'];
|
283 |
+
$classes[] = 'wc-shortcodes-social-icons-format-'.$atts['format'];
|
284 |
|
285 |
+
if ( ! empty( $atts['class'] ) ) {
|
286 |
+
$atts['class'] = ' ' . $atts['class'];
|
287 |
+
}
|
288 |
+
|
289 |
+
$html = '<div class="wc-shortcodes-social-icons-wrapper'.$atts['class'].'">';
|
290 |
+
$html .= '<ul class="'.implode( ' ', $classes ).'">';
|
291 |
+
$i = 0;
|
292 |
+
foreach ($order as $key => $name) {
|
293 |
+
$li_class = array();
|
294 |
+
$li_class[] = 'wc-shortcodes-social-icon';
|
295 |
+
$li_class[] = 'wc-shortcode-social-icon-' . $key;
|
296 |
+
|
297 |
+
if ( $column_display && $i % $atts['columns'] == 0 ) {
|
298 |
+
$li_class[] = 'clear-left';
|
299 |
+
}
|
300 |
|
|
|
|
|
|
|
301 |
$link_option_name = WC_SHORTCODES_PREFIX . $key . '_link';
|
302 |
$image_icon_option_name = WC_SHORTCODES_PREFIX . $key . '_icon';
|
303 |
$font_icon_option_name = WC_SHORTCODES_PREFIX . $key . '_font_icon';
|
313 |
|
314 |
$html .= '<li class="wc-shortcodes-social-icon wc-shortcode-social-icon-' . esc_attr( $key . $first_class ) . '">';
|
315 |
$html .='<a target="_blank" href="'.esc_url( $social_link ).'">';
|
316 |
+
$html .= '<img src="'.esc_url( $icon_url ).'" alt="'.esc_attr( $name ).'">';
|
317 |
$html .= '</a>';
|
318 |
$html .= '</li>';
|
319 |
}
|
338 |
* @since 1.0
|
339 |
*/
|
340 |
public function highlight( $atts, $content = null ) {
|
341 |
+
$atts = shortcode_atts( parent::$attr->highlight, $atts );
|
342 |
+
$atts = WPC_Shortcodes_Sanitize::highlight_attr( $atts );
|
|
|
|
|
343 |
|
344 |
+
return '<span class="wc-shortcodes-highlight wc-shortcodes-highlight-'. esc_attr( $atts['color'] ) .' '. esc_attr( $atts['class'] ) .'">' . do_shortcode( $content ) . '</span>';
|
|
|
345 |
}
|
346 |
|
347 |
|
350 |
* @since v1.0
|
351 |
*/
|
352 |
public function button( $atts, $content = null ) {
|
353 |
+
$atts = shortcode_atts( parent::$attr->button, $atts );
|
354 |
+
$atts = WPC_Shortcodes_Sanitize::button_attr( $atts );
|
355 |
+
|
356 |
+
$url_rel = ! empty( $atts['rel'] ) ? ' rel="'.esc_attr( $atts['rel'] ).'"' : '';
|
357 |
+
$url_target = ! empty( $atts['target'] ) ? ' target="_'.esc_attr( $atts['target'] ).'"' : '';
|
358 |
+
$atts['type'] = 'wc-shortcodes-button-' . $atts['type'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
359 |
|
360 |
$class = array();
|
361 |
$class[] = 'wc-shortcodes-button';
|
362 |
+
$class[] = $atts['type'];
|
363 |
+
$class[] = 'wc-shortcodes-button-position-' . $atts['position'];
|
364 |
if ( ! empty( $custom_class ) )
|
365 |
$class[] = $custom_class;
|
366 |
|
367 |
$button = null;
|
368 |
+
$button .= '<a href="' . esc_url( $atts['url'] ) . '" class="'.esc_attr( implode( ' ', $class ) ).'"'.$url_rel.$url_target.'" title="'. esc_attr( $atts['title'] ) .'">';
|
369 |
$button .= '<span class="wc-shortcodes-button-inner">';
|
370 |
+
if ( $atts['icon_left'] ) {
|
371 |
+
$button .= '<span class="wc-shortcodes-button-icon-left fa fa-'. esc_attr( $atts['icon_left'] ) .'"></span>';
|
372 |
}
|
373 |
$button .= $content;
|
374 |
+
if ( $atts['icon_right'] ) {
|
375 |
+
$button .= '<span class="wc-shortcodes-button-icon-right fa fa-'. esc_attr( $atts['icon_right'] ) .'"></span>';
|
376 |
}
|
377 |
$button .= '</span>';
|
378 |
$button .= '</a>';
|
379 |
|
380 |
+
if ( ! empty( $atts['position'] ) ) {
|
381 |
+
$button = '<div class="wc-shortcodes-item wc-shortcodes-button-'.$atts['position'].'">'. $button .'</div>';
|
|
|
382 |
}
|
383 |
|
384 |
return $button;
|
392 |
*
|
393 |
*/
|
394 |
public function box( $atts, $content = null ) {
|
395 |
+
$atts = shortcode_atts( parent::$attr->box, $atts );
|
396 |
+
$atts = WPC_Shortcodes_Sanitize::box_attr( $atts );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
|
398 |
$style_attr = '';
|
399 |
|
400 |
+
if( $atts['margin_bottom'] ) {
|
401 |
+
$style_attr .= 'margin-bottom: '. $atts['margin_bottom'] .';';
|
402 |
}
|
403 |
+
if ( $atts['margin_top'] ) {
|
404 |
+
$style_attr .= 'margin-top: '. $atts['margin_top'] .';';
|
405 |
}
|
406 |
|
407 |
+
$alert_content = '<div class="wc-shortcodes-box wc-shortcodes-item wc-shortcodes-content wc-shortcodes-clearfix wc-shortcodes-box-' . esc_attr( $atts['color'] ) . ' '. esc_attr( $atts['class'] ) .'" style="text-align:'. esc_attr( $atts['text_align'] ) .';'. esc_attr( $style_attr ) .'">';
|
|
|
408 |
|
409 |
$alert_content .= ' '. do_shortcode($content) .'</div>';
|
410 |
|
419 |
*
|
420 |
*/
|
421 |
public function testimonial( $atts, $content = null ) {
|
422 |
+
$atts = shortcode_atts( parent::$attr->testimonial, $atts );
|
423 |
+
$atts = WPC_Shortcodes_Sanitize::testimonial_attr( $atts );
|
|
|
|
|
|
|
|
|
424 |
|
425 |
+
if ( ! empty( $atts['url'] ) ) {
|
426 |
+
$atts['by'] = '<a href="' . esc_url( $atts['url'] ) . '">' . $atts['by'] . '</a>';
|
427 |
}
|
428 |
|
429 |
$testimonial_content = '';
|
430 |
+
$testimonial_content .= '<div class="wc-shortcodes-testimonial wc-shortcodes-item wc-shortcodes-clearfix wc-shortcodes-testimonial-'.esc_attr( $atts['position'] ).' '. esc_attr( $atts['class'] ) .'"><div class="wc-shortcodes-testimonial-content wc-shortcodes-content">';
|
431 |
$testimonial_content .= $content;
|
432 |
$testimonial_content .= '</div><div class="wc-shortcodes-testimonial-author">';
|
433 |
+
$testimonial_content .= $atts['by'] .'</div></div>';
|
434 |
|
435 |
return $testimonial_content;
|
436 |
}
|
443 |
*
|
444 |
*/
|
445 |
public function center( $atts, $content = null ){
|
446 |
+
$atts = shortcode_atts( parent::$attr->center, $atts );
|
447 |
+
$atts = WPC_Shortcodes_Sanitize::center_attr( $atts );
|
|
|
|
|
|
|
|
|
|
|
448 |
|
449 |
// $append_clearfix = '<div class="wc-shortcodes-clear-floats"></div>';
|
450 |
+
$style = empty( $atts['max_width'] ) ? '' : ' style="max-width:'.esc_attr( $atts['max_width'] ).';"';
|
451 |
|
452 |
+
return '<div class="wc-shortcodes-center wc-shortcodes-item wc-shortcodes-content wc-shortcodes-clearfix wc-shortcodes-center-inner-align-'. esc_attr( $atts['text_align'] ) .' '. esc_attr( $atts['class'] ) .'"' . $style . '>' . do_shortcode($content) . '</div>';
|
453 |
}
|
454 |
|
455 |
|
460 |
*
|
461 |
*/
|
462 |
public function column( $atts, $content = null ){
|
463 |
+
$atts = shortcode_atts( parent::$attr->column, $atts );
|
464 |
+
$atts = WPC_Shortcodes_Sanitize::column_attr( $atts );
|
|
|
|
|
|
|
|
|
465 |
|
466 |
$style = '';
|
467 |
+
if ( $atts['text_align'] ) {
|
468 |
+
if ( 'left' == $atts['text_align'] )
|
469 |
+
$style = ' style="text-align: '.esc_attr( $atts['text_align'] ).';"';
|
470 |
+
if ( 'center' == $atts['text_align'] )
|
471 |
+
$style = ' style="text-align: '.esc_attr( $atts['text_align'] ).';"';
|
472 |
+
if ( 'right' == $atts['text_align'] )
|
473 |
+
$style = ' style="text-align: '.esc_attr( $atts['text_align'] ).';"';
|
474 |
}
|
475 |
|
476 |
+
$append_clearfix = 'last' == $atts['position'] ? '<div class="wc-shortcodes-clear-floats"></div>' : '';
|
477 |
|
478 |
+
return '<div'.$style.' class="wc-shortcodes-column wc-shortcodes-content wc-shortcodes-' . esc_attr( $atts['size'] ) . ' wc-shortcodes-column-'.esc_attr( $atts['position'] ).' '. esc_attr( $atts['class'] ) .'">' . do_shortcode($content) . '</div>';
|
479 |
}
|
480 |
|
481 |
|
497 |
* @since v1.0
|
498 |
*/
|
499 |
public function toggle( $atts, $content = null ) {
|
500 |
+
$atts = shortcode_atts( parent::$attr->toggle, $atts );
|
501 |
+
$atts = WPC_Shortcodes_Sanitize::toggle_attr( $atts );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
502 |
|
503 |
$classes = array();
|
504 |
|
505 |
$classes[] = 'wc-shortcodes-toggle';
|
506 |
$classes[] = 'wc-shortcodes-item';
|
507 |
|
508 |
+
if ( ! empty( $atts['class'] ) )
|
509 |
+
$classes[] = $atts['class'];
|
510 |
|
511 |
+
if ( ! empty( $atts['layout'] ) )
|
512 |
+
$classes[] = 'wc-shortcodes-toggle-layout-' . $atts['layout'];
|
513 |
|
514 |
$class = implode( ' ', $classes );
|
515 |
|
516 |
$style = array();
|
517 |
|
518 |
+
if ( ! empty( $atts['padding'] ) || '0' === $atts['padding'] )
|
519 |
+
$style[] = 'padding:'.$atts['padding'];
|
520 |
+
if ( ! empty( $atts['border_width'] ) || '0' === $atts['border_width'] )
|
521 |
+
$style[] = 'border-width:'.$atts['border_width'];
|
522 |
|
523 |
$style = implode( ';', $style );
|
524 |
|
526 |
wp_enqueue_script('wc-shortcodes-toggle');
|
527 |
|
528 |
// Display the Toggle
|
529 |
+
return '<div class="'. esc_attr( $class ) .'"><div class="wc-shortcodes-toggle-trigger"><a href="#">'. esc_html( $atts['title'] ) .'</a></div><div style="'.esc_attr( $style ).'" class="wc-shortcodes-toggle-container wc-shortcodes-content">' . do_shortcode($content) . '</div></div>';
|
530 |
}
|
531 |
|
532 |
|
539 |
// Main
|
540 |
public function accordion_main( $atts, $content = null ) {
|
541 |
|
542 |
+
$atts = shortcode_atts( parent::$attr->accordion_main, $atts );
|
543 |
+
$atts = WPC_Shortcodes_Sanitize::accordion_main_attr( $atts );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
544 |
|
545 |
$classes = array();
|
546 |
|
548 |
$classes[] = 'wc-shortcodes-item';
|
549 |
|
550 |
$behavior = 'autoclose';
|
551 |
+
if ( $atts['leaveopen'] ) {
|
552 |
$behavior = 'leaveopen';
|
553 |
}
|
554 |
|
555 |
$state = 'default';
|
556 |
+
if ( $atts['collapse'] ) {
|
557 |
$classes[] = 'wc-shortcodes-accordion-collapse';
|
558 |
$state = 'collapse';
|
559 |
}
|
561 |
$classes[] = 'wc-shortcodes-accordion-default';
|
562 |
}
|
563 |
|
564 |
+
if ( ! empty( $atts['class'] ) )
|
565 |
$classes[] = $class;
|
566 |
|
567 |
+
if ( ! empty( $atts['layout'] ) )
|
568 |
+
$classes[] = 'wc-shortcodes-accordion-layout-' . $atts['layout'];
|
569 |
|
570 |
$class = implode( ' ', $classes );
|
571 |
|
579 |
|
580 |
// Section
|
581 |
public function accordion_section( $atts, $content = null ) {
|
582 |
+
$atts = shortcode_atts( parent::$attr->accordion_section, $atts );
|
583 |
+
$atts = WPC_Shortcodes_Sanitize::accordion_section_attr( $atts );
|
|
|
|
|
584 |
|
585 |
+
return '<div class="wc-shortcodes-accordion-trigger '. esc_attr( $atts['class'] ) .'"><a href="#">'. esc_html( $atts['title'] ) .'</a></div><div class="wc-shortcodes-accordion-content wc-shortcodes-content">' . do_shortcode($content) . '</div>';
|
586 |
}
|
587 |
|
588 |
|
600 |
wp_enqueue_script('wc-shortcodes-tabs');
|
601 |
|
602 |
// Display Tabs
|
603 |
+
$atts = shortcode_atts( parent::$attr->tabgroup, $atts );
|
604 |
+
$atts = WPC_Shortcodes_Sanitize::tabgroup_attr( $atts );
|
|
|
|
|
|
|
605 |
|
606 |
$classes = array();
|
607 |
|
608 |
$classes[] = 'wc-shortcodes-tabs';
|
609 |
$classes[] = 'wc-shortcodes-item';
|
610 |
|
611 |
+
if ( ! empty( $atts['class'] ) )
|
612 |
+
$classes[] = $atts['class'];
|
613 |
|
614 |
+
if ( ! empty( $atts['layout'] ) )
|
615 |
+
$classes[] = 'wc-shortcodes-tabs-layout-' . $atts['layout'];
|
616 |
|
617 |
$class = implode( ' ', $classes );
|
618 |
|
637 |
}
|
638 |
|
639 |
public function tab( $atts, $content = null ) {
|
640 |
+
$atts = shortcode_atts( parent::$attr->tab, $atts );
|
641 |
+
$atts = WPC_Shortcodes_Sanitize::tab_attr( $atts );
|
|
|
|
|
642 |
|
643 |
$classes = array();
|
644 |
|
647 |
|
648 |
$class = implode( ' ', $classes );
|
649 |
|
650 |
+
return '<div id="wc-shortcodes-tab-'. sanitize_title( $atts['title'] ) .'" class="'. esc_attr( $class ) .'">'. do_shortcode( $content ) .'</div>';
|
651 |
}
|
652 |
|
653 |
|
660 |
*/
|
661 |
/*section*/
|
662 |
public function pricing( $atts, $content = null ) {
|
663 |
+
$atts = shortcode_atts( parent::$attr->pricing, $atts );
|
664 |
+
$atts = WPC_Shortcodes_Sanitize::pricing_attr( $atts );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
665 |
|
666 |
//start content
|
667 |
$pricing_content ='';
|
668 |
+
$pricing_content .= '<div class="wc-shortcodes-pricing wc-shortcodes-pricing-type-'. esc_attr( $atts['type'] ) .' '. esc_attr( $atts['class'] ) .'">';
|
669 |
$pricing_content .= '<div class="wc-shortcodes-pricing-header">';
|
670 |
+
$pricing_content .= '<h5>'. esc_html( $atts['plan'] ). '</h5>';
|
671 |
+
$pricing_content .= '<div class="wc-shortcodes-pricing-cost">'. esc_html( $atts['cost'] ) .'</div><div class="wc-shortcodes-pricing-per">'. esc_html( $atts['per'] ) .'</div>';
|
672 |
$pricing_content .= '</div>';
|
673 |
$pricing_content .= '<div class="wc-shortcodes-pricing-content">';
|
674 |
$pricing_content .= ''. $content. '';
|
675 |
$pricing_content .= '</div>';
|
676 |
+
if( $atts['button_url'] ) {
|
677 |
+
$pricing_content .= '<div class="wc-shortcodes-pricing-button"><a href="'. esc_url( $atts['button_url'] ) .'" class="wc-shortcodes-button wc-shortcodes-button-'.esc_attr( $atts['type'] ).'" target="_'. esc_attr( $atts['button_target'] ) .'" rel="'. esc_attr( $atts['button_rel'] ) .'"><span class="wc-shortcodes-button-inner">'. esc_html( $atts['button_text'] ) .'</span></a></div>';
|
678 |
}
|
679 |
$pricing_content .= '</div>';
|
680 |
return $pricing_content;
|
687 |
* @since v1.1
|
688 |
*/
|
689 |
public function heading( $atts ) {
|
690 |
+
$atts = shortcode_atts( parent::$attr->heading, $atts );
|
691 |
+
$atts = WPC_Shortcodes_Sanitize::heading_attr( $atts );
|
692 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
693 |
$style_attr = '';
|
694 |
|
695 |
+
if ( $atts['font_size'] ) {
|
696 |
+
$style_attr .= 'font-size: '. $atts['font_size'] .';';
|
697 |
}
|
698 |
+
if ( $atts['color'] ) {
|
699 |
+
$style_attr .= 'color: '. $atts['color'] .';';
|
700 |
}
|
701 |
+
if( $atts['margin_bottom'] ) {
|
702 |
+
$style_attr .= 'margin-bottom: '. $atts['margin_bottom'] .';';
|
703 |
}
|
704 |
+
if ( $atts['margin_top'] ) {
|
705 |
+
$style_attr .= 'margin-top: '. $atts['margin_top'] .';';
|
706 |
}
|
707 |
|
708 |
+
if ( $atts['text_align'] ) {
|
709 |
+
$text_align = 'text-align-'. $atts['text_align'];
|
710 |
} else {
|
711 |
$text_align = 'text-align-left';
|
712 |
}
|
713 |
|
714 |
+
if ( 'h1' == $atts['type'] ) {
|
715 |
+
$atts['class'] = trim( 'entry-title ' . $atts['class'] );
|
716 |
+
}
|
717 |
|
718 |
+
$output = '<'.$atts['type'].' class="wc-shortcodes-heading '. esc_attr( $text_align ) .' '. esc_attr( $atts['class'] ) .'" style="'.esc_attr( $style_attr ).'"><span>';
|
719 |
|
720 |
+
if ( $atts['icon_left'] )
|
721 |
+
$output .= '<i class="wc-shortcodes-button-icon-left fa fa-'. esc_attr( $atts['icon_left'] ) .'" style="margin-right:'.esc_attr( $atts['icon_spacing'] ).'"></i>';
|
722 |
|
723 |
+
$output .= esc_html( $atts['title'] );
|
724 |
|
725 |
+
if ( $atts['icon_right'] )
|
726 |
+
$output .= '<i class="wc-shortcodes-button-icon-right fa fa-'. esc_attr( $atts['icon_right'] ) .'" style="margin-left:'.esc_attr( $atts['icon_spacing'] ).'"></i>';
|
727 |
|
728 |
+
$output .= '</span></'.$atts['type'].'>';
|
729 |
|
730 |
+
if ( 'h1' == $atts['type'] )
|
731 |
$output = '<header class="entry-header">'. $output . '</header>';
|
732 |
|
733 |
return $output;
|
738 |
* Google Maps
|
739 |
* @since v1.1
|
740 |
*/
|
741 |
+
public function googlemap($atts, $content = null) {
|
742 |
static $instance = 0;
|
743 |
$instance++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
744 |
|
745 |
+
if ( empty( parent::$google_maps_api_key ) ) {
|
746 |
+
return '<div class="wc-shortcodes-googlemap-api-key-needed"><p>Google requires an <a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank">API key</a> to embed Google Maps. Enter your key in your <a href="' . parent::$plugin_settings_url . '&wpcsf_active_tab=wc-shortcodes-options-google-maps-options-tab" target="_blank">Shortcodes option</a> page under the "Maps" tab.</p></div>';
|
747 |
+
}
|
748 |
|
749 |
+
$atts = shortcode_atts( parent::$attr->googlemap, $atts );
|
750 |
+
$atts = WPC_Shortcodes_Sanitize::googlemap_attr( $atts );
|
751 |
|
752 |
// load scripts
|
753 |
wp_enqueue_script('wc-shortcodes-googlemap');
|
756 |
$class[] = 'googlemap';
|
757 |
$class[] = 'wc-shortcodes-item';
|
758 |
|
759 |
+
$output = '<div id="map_canvas_'.$instance.'" class="' . esc_attr( implode( ' ', $class ) ) . '" style="height:'.$atts['height'].';width:100%">';
|
760 |
+
$output .= (!empty($atts['title'])) ? '<input class="title" type="hidden" value="'.esc_html( $atts['title'] ).'" />' : '';
|
761 |
+
$output .= '<input class="location" type="hidden" value="'.esc_attr( $atts['location'] ).'" />';
|
762 |
+
$output .= '<input class="zoom" type="hidden" value="'.$atts['zoom'].'" />';
|
763 |
+
$output .= '<input class="title-on-load" type="hidden" value="'.$atts['title_on_load'].'" />';
|
764 |
$output .= '<div class="map_canvas"></div>';
|
765 |
$output .= '</div>';
|
766 |
|
773 |
* @since v1.1
|
774 |
*/
|
775 |
public function divider( $atts ) {
|
776 |
+
$atts = shortcode_atts( parent::$attr->divider, $atts );
|
777 |
+
$atts = WPC_Shortcodes_Sanitize::divider_attr( $atts );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
778 |
|
779 |
$style_attr = array();
|
780 |
|
781 |
+
if( $atts['margin_bottom'] ) {
|
782 |
+
$style_attr[] = 'margin-bottom: '. $atts['margin_bottom'] .';';
|
783 |
+
}
|
784 |
+
if ( $atts['margin_top'] ) {
|
785 |
+
$style_attr[] = 'margin-top: '. $atts['margin_top'] .';';
|
|
|
786 |
}
|
787 |
|
788 |
if ( ! empty ( $style_attr ) ) {
|
792 |
$style_attr = '';
|
793 |
}
|
794 |
|
795 |
+
return '<hr class="wc-shortcodes-divider wc-shortcodes-item wc-shortcodes-divider-line-'.esc_attr( $atts['line'] ).' wc-shortcodes-divider-style-'. esc_attr( $atts['style'] ) .' '. esc_attr( $atts['class'] ) .'" '.$style_attr.' />';
|
796 |
}
|
797 |
|
798 |
|
801 |
* @since v1.10
|
802 |
*/
|
803 |
public function countdown( $atts ) {
|
804 |
+
$atts = shortcode_atts( parent::$attr->countdown, $atts );
|
805 |
+
$atts = WPC_Shortcodes_Sanitize::countdown_attr( $atts );
|
806 |
+
|
807 |
+
if ( empty( $atts['date'] ) ) {
|
|
|
|
|
|
|
|
|
|
|
808 |
return '<p>*Please enter a date for your countdown*</p>';
|
809 |
}
|
810 |
|
811 |
wp_enqueue_script('wc-shortcodes-countdown');
|
812 |
|
813 |
+
$html = '<div class="wc-shortcodes-countdown" data-labels="'.esc_attr($atts['labels']).'" data-labels1="'.esc_attr($atts['labels1']).'" data-date="'.esc_attr( $atts['date'] ).'" data-format="'.esc_attr( $atts['format'] ).'" data-message="'.esc_attr( $atts['message'] ).'"></div>';
|
814 |
$html = '<div class="wc-shortcodes-countdown-bg1">'.$html.'</div>';
|
815 |
$html = '<div class="wc-shortcodes-countdown-bg2">'.$html.'</div>';
|
816 |
$html = '<div class="wc-shortcodes-countdown-bg3">'.$html.'</div>';
|
823 |
|
824 |
|
825 |
public function rsvp( $atts ) {
|
826 |
+
$atts = shortcode_atts( parent::$attr->rsvp, $atts );
|
827 |
+
$atts = WPC_Shortcodes_Sanitize::rsvp_attr( $atts );
|
|
|
|
|
|
|
828 |
|
829 |
wp_enqueue_script('wc-shortcodes-rsvp');
|
830 |
|
|
|
|
|
|
|
831 |
$html = '';
|
832 |
|
833 |
// RSVP Name
|
876 |
|
877 |
// Style
|
878 |
|
879 |
+
if ( 3 == $atts['columns'] ) {
|
880 |
$html .= '<div class="wc-shortcodes-row wc-shortcodes-item wc-shortcodes-clearfix">';
|
881 |
$html .= ' <div class="wc-shortcodes-column wc-shortcodes-one-third wc-shortcodes-column-first ">'.$name_html.'</div>';
|
882 |
$html .= ' <div class="wc-shortcodes-column wc-shortcodes-one-third wc-shortcodes-column- ">'.$number_html.'</div>';
|
890 |
$html .= $name_html . $number_html . $event_html . $action_html . $message_html . $button_html;
|
891 |
}
|
892 |
|
893 |
+
return '<div class="wc-shortcodes-rsvp wc-shortcodes-content wc-shortcodes-item wc-shortcodes-rsvp-columns-'.esc_attr($atts['columns']).' wc-shortcodes-rsvp-align-'.esc_attr($atts['align']).' rsvp-button-align-'.esc_attr($atts['button_align']).'">' . do_shortcode( $html ) . '</div>';
|
894 |
}
|
895 |
|
896 |
/**
|
1199 |
}
|
1200 |
|
1201 |
public function image( $atts ) {
|
1202 |
+
$atts = shortcode_atts( parent::$attr->image, $atts );
|
1203 |
+
$atts = WPC_Shortcodes_Sanitize::image_attr( $atts );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1204 |
|
1205 |
// function options
|
1206 |
$div_wrapper = false;
|
1207 |
|
|
|
|
|
|
|
1208 |
// classes
|
1209 |
$classes = array();
|
1210 |
|
1211 |
$classes[] = 'wc-shortcodes-image';
|
1212 |
|
1213 |
+
if ( ! empty( $atts['align'] ) )
|
1214 |
+
$classes[] = 'align' . $atts['align'];
|
|
|
1215 |
|
1216 |
+
if ( ! empty( $atts['size'] ) )
|
1217 |
+
$classes[] = 'size-' . $atts['size'];
|
1218 |
|
1219 |
+
if ( ! empty( $atts['attachment_id'] ) )
|
1220 |
+
$classes[] = 'wp-image-' . $atts['attachment_id'];
|
1221 |
|
1222 |
+
if ( ! empty( $atts['class'] ) )
|
1223 |
+
$classes[] = $atts['class'];
|
1224 |
|
1225 |
// check if src is set
|
1226 |
+
list( $src, $width, $height ) = wp_get_attachment_image_src( $atts['attachment_id'], $atts['size'] );
|
1227 |
if ( empty( $src ) ) {
|
1228 |
return '<p>Please insert a valid image</p>';
|
1229 |
}
|
1230 |
|
1231 |
+
$html = '<img alt="' . esc_attr( $atts['alt'] ) . '" title="' . esc_attr( $atts['title'] ) . '" src="' . esc_url( $src ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '" />';
|
1232 |
|
1233 |
// insert flag
|
1234 |
+
if ( ! empty( $atts['flag'] ) ) {
|
1235 |
$style = array();
|
1236 |
+
if ( ! empty( $atts['top'] ) )
|
1237 |
+
$style[] = 'top:' . $atts['top'];
|
1238 |
+
if ( ! empty( $atts['right'] ) )
|
1239 |
+
$style[] = 'right:' . $atts['right'];
|
1240 |
+
if ( ! empty( $atts['bottom'] ) )
|
1241 |
+
$style[] = 'bottom:' . $atts['bottom'];
|
1242 |
+
if ( ! empty( $atts['left'] ) )
|
1243 |
+
$style[] = 'left:' . $atts['left'];
|
1244 |
+
if ( ! empty( $atts['background_color'] ) )
|
1245 |
+
$style[] = 'background-color:' . $atts['background_color'];
|
1246 |
+
if ( ! empty( $atts['text_color'] ) )
|
1247 |
+
$style[] = 'color:' . $atts['text_color'];
|
1248 |
+
if ( ! empty( $atts['font_size'] ) )
|
1249 |
+
$style[] = 'font-size:' . $atts['font_size'];
|
1250 |
+
if ( ! empty( $atts['text_align'] ) )
|
1251 |
+
$style[] = 'text-align:' . $atts['text_align'];
|
1252 |
+
if ( ! empty( $atts['flag_width'] ) )
|
1253 |
+
$style[] = 'width:' . $atts['flag_width'];
|
1254 |
+
|
1255 |
+
|
1256 |
+
$html .= '<span style="' . esc_attr( implode( ';', $style ) ) . '" class="wc-shortcodes-image-flag-bg"><span class="wc-shortcodes-image-flag-text">' . esc_html( $atts['flag'] ) . '</span></span>';
|
1257 |
$div_wrapper = true;
|
1258 |
|
1259 |
}
|
1260 |
|
1261 |
// check link_to
|
1262 |
+
if ( empty( $atts['url'] ) ) {
|
1263 |
+
if ( 'file' == $atts['link_to'] )
|
1264 |
+
$atts['url'] = wp_get_attachment_url( $atts['attachment_id'] );
|
1265 |
+
else if ( 'post' == $atts['link_to'] )
|
1266 |
+
$atts['url'] = get_attachment_link( $atts['attachment_id'] );
|
1267 |
}
|
1268 |
|
1269 |
+
if ( 'none' != $atts['link_to'] )
|
1270 |
+
$html = '<a class="wc-shortcodes-image-anchor" href="' . esc_url( $atts['url'] ) . '">' . $html . '</a>';
|
1271 |
|
1272 |
// insert caption
|
1273 |
+
if ( ! empty( $atts['caption'] ) ) {
|
1274 |
+
$html .= '<p class="wp-caption-text">' . esc_html( $atts['caption'] ) . '</p>';
|
1275 |
$div_wrapper = true;
|
1276 |
}
|
1277 |
|
1278 |
// do we need a div wrapper?
|
1279 |
if ( $div_wrapper ) {
|
1280 |
$html = preg_replace( '/(class=["\'][^\'"]*)align(none|left|right|center)\s?/', '$1', $html );
|
1281 |
+
$html = '<div id="attachment_' . esc_attr( $atts['attachment_id'] ) . '" class="wc-shortcodes-image-wrapper wc-shortcodes-item wp-caption align' . esc_attr( $atts['align'] ) . '" style="width:' . $width . 'px">' . $html . '</div>';
|
1282 |
}
|
1283 |
else if ( in_array( $align, array( 'none', 'center' ) ) ) {
|
1284 |
$html = '<p>' . $html . '</p>';
|
1288 |
}
|
1289 |
|
1290 |
public function fa( $atts ) {
|
1291 |
+
$atts = shortcode_atts( parent::$attr->fa, $atts );
|
1292 |
+
$atts = WPC_Shortcodes_Sanitize::fa_attr( $atts );
|
|
|
|
|
|
|
1293 |
|
1294 |
+
if ( empty( $atts['icon'] ) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1295 |
return '';
|
1296 |
|
1297 |
// classes
|
1299 |
|
1300 |
$classes[] = 'wc-shortcodes-fa';
|
1301 |
$classes[] = 'fa';
|
1302 |
+
$classes[] = 'fa-' . $atts['icon'];
|
1303 |
+
if ( empty( $atts['class'] ) )
|
1304 |
+
$classes[] = $atts['class'];
|
1305 |
|
1306 |
$style_attr = '';
|
1307 |
|
1308 |
+
if( $atts['margin_right'] ) {
|
1309 |
+
$style_attr .= 'margin-right: '. $atts['margin_right'] .';';
|
1310 |
}
|
1311 |
+
if ( $atts['margin_left'] ) {
|
1312 |
+
$style_attr .= 'margin-left: '. $atts['margin_left'] .';';
|
1313 |
}
|
1314 |
|
1315 |
$html = '<i class="' . esc_attr( implode( ' ', $classes ) ) . '" style="'.esc_attr( $style_attr ).'"></i>';
|
1318 |
}
|
1319 |
|
1320 |
public function share_buttons( $atts ) {
|
1321 |
+
$atts = shortcode_atts( parent::$attr->share_buttons, $atts );
|
1322 |
+
$atts = WPC_Shortcodes_Sanitize::share_buttons_attr( $atts );
|
|
|
|
|
1323 |
|
1324 |
$share_buttons = get_option( WC_SHORTCODES_PREFIX . 'share_buttons_display' );
|
1325 |
$size = sizeof( $share_buttons );
|
public/class-sanitize.php
CHANGED
@@ -4,6 +4,9 @@
|
|
4 |
*/
|
5 |
class WPC_Shortcodes_Sanitize {
|
6 |
public static function bool( $value ) {
|
|
|
|
|
|
|
7 |
if ( 'true' == $value ) {
|
8 |
return true;
|
9 |
}
|
@@ -14,17 +17,75 @@ class WPC_Shortcodes_Sanitize {
|
|
14 |
return (bool) $value;
|
15 |
}
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
public static function text_field( $value ) {
|
18 |
return trim( sanitize_text_field( $value ) );
|
19 |
}
|
20 |
|
21 |
public static function int_float( $value ) {
|
|
|
|
|
|
|
22 |
$value = filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
|
23 |
|
24 |
return $value;
|
25 |
}
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
public static function positive_number( $value ) {
|
|
|
|
|
|
|
28 |
$value = preg_replace("/[^0-9\-]/", "",$value);
|
29 |
$value = intval( $value );
|
30 |
|
@@ -38,6 +99,9 @@ class WPC_Shortcodes_Sanitize {
|
|
38 |
}
|
39 |
|
40 |
public static function number( $value ) {
|
|
|
|
|
|
|
41 |
$value = preg_replace("/[^0-9\-]/", "",$value);
|
42 |
$value = intval( $value );
|
43 |
|
@@ -65,6 +129,10 @@ class WPC_Shortcodes_Sanitize {
|
|
65 |
return $value;
|
66 |
|
67 |
$value = trim( $value );
|
|
|
|
|
|
|
|
|
68 |
if ( preg_match( '/(px|em|rem)$/', $value, $match ) ) {
|
69 |
$css_unit = $match[1];
|
70 |
}
|
@@ -87,24 +155,186 @@ class WPC_Shortcodes_Sanitize {
|
|
87 |
return '';
|
88 |
}
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
public static function heading_type( $value, $default = 'h2' ) {
|
91 |
-
$whitelist =
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
return $value;
|
105 |
|
106 |
return $default;
|
107 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
public static function comma_delim_to_array( $string ) {
|
109 |
$a = explode( ',', $string );
|
110 |
$t = array();
|
@@ -124,6 +354,625 @@ class WPC_Shortcodes_Sanitize {
|
|
124 |
}
|
125 |
}
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
public static function posts_attr_key_change( $atts ) {
|
128 |
// Rename keys in shortcode options.
|
129 |
$renamed = array( 'title', 'meta_all', 'meta_author', 'meta_date', 'meta_comments', 'thumbnail', 'content', 'paging' );
|
@@ -140,9 +989,10 @@ class WPC_Shortcodes_Sanitize {
|
|
140 |
return $atts;
|
141 |
}
|
142 |
|
143 |
-
public static function posts_attr( $atts
|
144 |
// sanitize bools
|
145 |
$bools = array( 'ignore_sticky_posts', 'show_meta_category', 'nopaging', 'show_title', 'show_meta_all', 'show_meta_author', 'show_meta_date', 'show_meta_comments', 'show_thumbnail', 'show_content', 'show_paging', 'filtering' );
|
|
|
146 |
foreach ( $bools as $key ) {
|
147 |
if ( isset( $atts[ $key ] ) ) {
|
148 |
if ( "no" == $atts[ $key ] ) {
|
@@ -153,9 +1003,6 @@ class WPC_Shortcodes_Sanitize {
|
|
153 |
$atts[ $key ] = $atts[ $key ] ? 1 : 0;
|
154 |
}
|
155 |
}
|
156 |
-
else if ( $empty_is_false ) {
|
157 |
-
$atts[ $key ] = 0;
|
158 |
-
}
|
159 |
}
|
160 |
|
161 |
$atts['nopaging'] = (bool) $atts['nopaging'];
|
@@ -223,9 +1070,23 @@ class WPC_Shortcodes_Sanitize {
|
|
223 |
return $atts;
|
224 |
}
|
225 |
|
226 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
// sanitize bools
|
228 |
$bools = array( 'ignore_sticky_posts', 'show_meta_category', 'show_title', 'show_content', 'slider_auto', 'nopaging' );
|
|
|
229 |
foreach ( $bools as $key ) {
|
230 |
if ( isset( $atts[ $key ] ) ) {
|
231 |
if ( "no" == $atts[ $key ] ) {
|
@@ -236,9 +1097,6 @@ class WPC_Shortcodes_Sanitize {
|
|
236 |
$atts[ $key ] = $atts[ $key ] ? 1 : 0;
|
237 |
}
|
238 |
}
|
239 |
-
else if ( $empty_is_false ) {
|
240 |
-
$atts[ $key ] = 0;
|
241 |
-
}
|
242 |
}
|
243 |
|
244 |
$atts['nopaging'] = (bool) $atts['nopaging'];
|
@@ -285,7 +1143,7 @@ class WPC_Shortcodes_Sanitize {
|
|
285 |
$atts['heading_type'] = in_array( $atts['heading_type'], $valid_headings ) ? $atts['heading_type'] : 'h2';
|
286 |
|
287 |
// sanitize inputs
|
288 |
-
$atts['button_class'] =
|
289 |
$atts['button_class'] = empty( $atts['button_class'] ) ? 'wc-shortcodes-post-slide-button' : $atts['button_class'];
|
290 |
$atts['terms'] = sanitize_text_field( $atts['terms'] );
|
291 |
$atts['pids'] = sanitize_text_field( $atts['pids'] );
|
4 |
*/
|
5 |
class WPC_Shortcodes_Sanitize {
|
6 |
public static function bool( $value ) {
|
7 |
+
if ( '' == $value )
|
8 |
+
return $value;
|
9 |
+
|
10 |
if ( 'true' == $value ) {
|
11 |
return true;
|
12 |
}
|
17 |
return (bool) $value;
|
18 |
}
|
19 |
|
20 |
+
public static function int_bool( $value ) {
|
21 |
+
if ( '' == $value )
|
22 |
+
return $value;
|
23 |
+
|
24 |
+
if ( "no" == $value ) {
|
25 |
+
$value = 0;
|
26 |
+
}
|
27 |
+
else {
|
28 |
+
$value = (bool) $value;
|
29 |
+
$value = $value ? 1 : 0;
|
30 |
+
}
|
31 |
+
|
32 |
+
return $value;
|
33 |
+
}
|
34 |
+
|
35 |
public static function text_field( $value ) {
|
36 |
return trim( sanitize_text_field( $value ) );
|
37 |
}
|
38 |
|
39 |
public static function int_float( $value ) {
|
40 |
+
if ( '' == $value )
|
41 |
+
return $value;
|
42 |
+
|
43 |
$value = filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
|
44 |
|
45 |
return $value;
|
46 |
}
|
47 |
|
48 |
+
public static function html_classes( $value ) {
|
49 |
+
if ( empty( $value ) ) {
|
50 |
+
return '';
|
51 |
+
}
|
52 |
+
|
53 |
+
$a = explode( ' ', $value );
|
54 |
+
|
55 |
+
if ( ! empty( $a ) && is_array( $a ) ) {
|
56 |
+
foreach( $a as $k => $v ) {
|
57 |
+
$a[ $k ] = sanitize_html_class( $v );
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
$value = implode( ' ', $a );
|
62 |
+
|
63 |
+
return $value;
|
64 |
+
}
|
65 |
+
|
66 |
+
public static function percentage( $value ) {
|
67 |
+
if ( '' == $value )
|
68 |
+
return $value;
|
69 |
+
|
70 |
+
$value = preg_replace( "/[^0-9\.]/", "", $value );
|
71 |
+
$value = floatval( $value );
|
72 |
+
|
73 |
+
if ( empty( $value ) )
|
74 |
+
$value = 0;
|
75 |
+
|
76 |
+
if ( 0 > $value )
|
77 |
+
$value = 0;
|
78 |
+
|
79 |
+
if ( 100 < $value )
|
80 |
+
$value = 100;
|
81 |
+
|
82 |
+
return $value;
|
83 |
+
}
|
84 |
+
|
85 |
public static function positive_number( $value ) {
|
86 |
+
if ( '' == $value )
|
87 |
+
return $value;
|
88 |
+
|
89 |
$value = preg_replace("/[^0-9\-]/", "",$value);
|
90 |
$value = intval( $value );
|
91 |
|
99 |
}
|
100 |
|
101 |
public static function number( $value ) {
|
102 |
+
if ( '' == $value )
|
103 |
+
return $value;
|
104 |
+
|
105 |
$value = preg_replace("/[^0-9\-]/", "",$value);
|
106 |
$value = intval( $value );
|
107 |
|
129 |
return $value;
|
130 |
|
131 |
$value = trim( $value );
|
132 |
+
|
133 |
+
if ( 0 == $value )
|
134 |
+
return $value;
|
135 |
+
|
136 |
if ( preg_match( '/(px|em|rem)$/', $value, $match ) ) {
|
137 |
$css_unit = $match[1];
|
138 |
}
|
155 |
return '';
|
156 |
}
|
157 |
|
158 |
+
public static function custom_field_name( $name ) {
|
159 |
+
if ( '' === $name )
|
160 |
+
return '';
|
161 |
+
|
162 |
+
// 3 or 6 hex digits, or the empty string.
|
163 |
+
$name = trim( sanitize_text_field( $name ) );
|
164 |
+
$name = preg_replace( '/^_/', '', $name );
|
165 |
+
|
166 |
+
return $name;
|
167 |
+
}
|
168 |
+
|
169 |
+
public static function social_icons_format( $value, $default = 'default' ) {
|
170 |
+
$whitelist = WPC_Shortcodes_Widget_Options::social_icons_formats();
|
171 |
+
|
172 |
+
if ( array_key_exists( $value, $whitelist ) )
|
173 |
+
return $value;
|
174 |
+
|
175 |
+
return $default;
|
176 |
+
}
|
177 |
+
|
178 |
+
public static function social_icons_display_type( $value, $default = 'float-left' ) {
|
179 |
+
$whitelist = WPC_Shortcodes_Widget_Options::social_icons_display_types();
|
180 |
+
|
181 |
+
if ( array_key_exists( $value, $whitelist ) )
|
182 |
+
return $value;
|
183 |
+
|
184 |
+
return $default;
|
185 |
+
}
|
186 |
+
|
187 |
+
public static function social_icons_max_height( $value, $default = 48 ) {
|
188 |
+
$whitelist = WPC_Shortcodes_Widget_Options::social_icons_max_height_values();
|
189 |
+
|
190 |
+
if ( array_key_exists( $value, $whitelist ) )
|
191 |
+
return $value;
|
192 |
+
|
193 |
+
return $default;
|
194 |
+
}
|
195 |
+
|
196 |
+
public static function divider_line( $value, $default = 'single' ) {
|
197 |
+
$whitelist = WPC_Shortcodes_Widget_Options::divider_line_values();
|
198 |
+
|
199 |
+
if ( array_key_exists( $value, $whitelist ) )
|
200 |
+
return $value;
|
201 |
+
|
202 |
+
return $default;
|
203 |
+
}
|
204 |
+
|
205 |
+
public static function divider_style( $value, $default = 'solid' ) {
|
206 |
+
$whitelist = WPC_Shortcodes_Widget_Options::divider_style_values();
|
207 |
+
|
208 |
+
if ( array_key_exists( $value, $whitelist ) )
|
209 |
+
return $value;
|
210 |
+
|
211 |
+
return $default;
|
212 |
+
}
|
213 |
+
|
214 |
+
public static function google_map_zoom( $value, $default = 8 ) {
|
215 |
+
$whitelist = WPC_Shortcodes_Widget_Options::google_map_zoom_values();
|
216 |
+
|
217 |
+
if ( array_key_exists( $value, $whitelist ) )
|
218 |
+
return $value;
|
219 |
+
|
220 |
+
return $default;
|
221 |
+
}
|
222 |
+
|
223 |
public static function heading_type( $value, $default = 'h2' ) {
|
224 |
+
$whitelist = WPC_Shortcodes_Widget_Options::heading_tags();
|
225 |
+
|
226 |
+
if ( array_key_exists( $value, $whitelist ) )
|
227 |
+
return $value;
|
228 |
+
|
229 |
+
return $default;
|
230 |
+
}
|
231 |
+
|
232 |
+
public static function image_link_to( $value, $default = '' ) {
|
233 |
+
$whitelist = WPC_Shortcodes_Widget_Options::image_link_to_values();
|
234 |
+
|
235 |
+
if ( array_key_exists( $value, $whitelist ) )
|
236 |
+
return $value;
|
237 |
+
|
238 |
+
return $default;
|
239 |
+
}
|
240 |
+
|
241 |
+
public static function highlight_color( $value, $default = 'yellow' ) {
|
242 |
+
$whitelist = WPC_Shortcodes_Widget_Options::highlight_colors();
|
243 |
+
|
244 |
+
if ( array_key_exists( $value, $whitelist ) )
|
245 |
+
return $value;
|
246 |
+
|
247 |
+
return $default;
|
248 |
+
}
|
249 |
+
|
250 |
+
public static function color_type( $value, $default = 'primary' ) {
|
251 |
+
$whitelist = WPC_Shortcodes_Widget_Options::color_types();
|
252 |
+
|
253 |
+
if ( array_key_exists( $value, $whitelist ) )
|
254 |
+
return $value;
|
255 |
+
|
256 |
+
return $default;
|
257 |
+
}
|
258 |
+
|
259 |
+
public static function url_target( $value, $default = 'self' ) {
|
260 |
+
$value = ltrim( trim( $value ), '_' );
|
261 |
+
|
262 |
+
$whitelist = WPC_Shortcodes_Widget_Options::url_target_values();
|
263 |
+
|
264 |
+
if ( array_key_exists( $value, $whitelist ) )
|
265 |
+
return $value;
|
266 |
+
|
267 |
+
return $default;
|
268 |
+
}
|
269 |
+
|
270 |
+
public static function url_rel( $value, $default = '' ) {
|
271 |
+
$whitelist = WPC_Shortcodes_Widget_Options::url_rel_values();
|
272 |
+
|
273 |
+
if ( array_key_exists( $value, $whitelist ) )
|
274 |
+
return $value;
|
275 |
+
|
276 |
+
return $default;
|
277 |
+
}
|
278 |
+
|
279 |
+
public static function fa_icon( $value ) {
|
280 |
+
$value = preg_replace( '/^fa\-/', '', $value );
|
281 |
+
return sanitize_html_class( $value );
|
282 |
+
}
|
283 |
+
|
284 |
+
public static function column_size( $value, $default = 'one-third' ) {
|
285 |
+
$whitelist = WPC_Shortcodes_Widget_Options::column_sizes();
|
286 |
+
|
287 |
+
if ( array_key_exists( $value, $whitelist ) )
|
288 |
+
return $value;
|
289 |
+
|
290 |
+
return $default;
|
291 |
+
}
|
292 |
+
|
293 |
+
public static function column_position( $value, $default = '' ) {
|
294 |
+
$whitelist = WPC_Shortcodes_Widget_Options::column_positions();
|
295 |
+
|
296 |
+
if ( array_key_exists( $value, $whitelist ) )
|
297 |
+
return $value;
|
298 |
+
|
299 |
+
return $default;
|
300 |
+
}
|
301 |
+
|
302 |
+
public static function left_right_none( $value, $default = '' ) {
|
303 |
+
$whitelist = WPC_Shortcodes_Widget_Options::left_right_none_values();
|
304 |
+
|
305 |
+
if ( array_key_exists( $value, $whitelist ) )
|
306 |
+
return $value;
|
307 |
+
|
308 |
+
return $default;
|
309 |
+
}
|
310 |
+
|
311 |
+
public static function one_three( $value, $default = 3 ) {
|
312 |
+
$whitelist = WPC_Shortcodes_Widget_Options::one_three_values();
|
313 |
+
|
314 |
+
if ( array_key_exists( $value, $whitelist ) )
|
315 |
return $value;
|
316 |
|
317 |
return $default;
|
318 |
}
|
319 |
+
|
320 |
+
public static function image_size( $value, $default = 'large' ) {
|
321 |
+
$whitelist = WPC_Shortcodes_Widget_Options::image_sizes();
|
322 |
+
|
323 |
+
if ( array_key_exists( $value, $whitelist ) )
|
324 |
+
return $value;
|
325 |
+
|
326 |
+
return $default;
|
327 |
+
}
|
328 |
+
|
329 |
+
public static function text_align( $value, $default = '' ) {
|
330 |
+
$whitelist = WPC_Shortcodes_Widget_Options::text_align_values();
|
331 |
+
|
332 |
+
if ( array_key_exists( $value, $whitelist ) )
|
333 |
+
return $value;
|
334 |
+
|
335 |
+
return $default;
|
336 |
+
}
|
337 |
+
|
338 |
public static function comma_delim_to_array( $string ) {
|
339 |
$a = explode( ',', $string );
|
340 |
$t = array();
|
354 |
}
|
355 |
}
|
356 |
|
357 |
+
public static function accordion_main_layout( $value, $default = 'box' ) {
|
358 |
+
$whitelist = WPC_Shortcodes_Widget_Options::accordion_main_layouts();
|
359 |
+
|
360 |
+
if ( array_key_exists( $value, $whitelist ) )
|
361 |
+
return $value;
|
362 |
+
|
363 |
+
return $default;
|
364 |
+
}
|
365 |
+
|
366 |
+
public static function accordion_section_attr( $atts ) {
|
367 |
+
foreach ( $atts as $key => $value ) {
|
368 |
+
switch( $key ) {
|
369 |
+
case 'title' :
|
370 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
371 |
+
break;
|
372 |
+
case 'class' :
|
373 |
+
$atts[ $key ] = self::html_classes( $value );
|
374 |
+
break;
|
375 |
+
}
|
376 |
+
}
|
377 |
+
|
378 |
+
return $atts;
|
379 |
+
}
|
380 |
+
|
381 |
+
public static function accordion_main_attr( $atts ) {
|
382 |
+
foreach ( $atts as $key => $value ) {
|
383 |
+
switch( $key ) {
|
384 |
+
case 'collapse' :
|
385 |
+
$atts[ $key ] = self::int_bool( $value );
|
386 |
+
break;
|
387 |
+
case 'leaveopen' :
|
388 |
+
$atts[ $key ] = self::int_bool( $value );
|
389 |
+
break;
|
390 |
+
case 'class' :
|
391 |
+
$atts[ $key ] = self::html_classes( $value );
|
392 |
+
break;
|
393 |
+
case 'layout' :
|
394 |
+
$atts[ $key ] = self::accordion_main_layout( $value );
|
395 |
+
break;
|
396 |
+
}
|
397 |
+
}
|
398 |
+
|
399 |
+
return $atts;
|
400 |
+
}
|
401 |
+
|
402 |
+
public static function tabgroup_attr( $atts ) {
|
403 |
+
foreach ( $atts as $key => $value ) {
|
404 |
+
switch( $key ) {
|
405 |
+
case 'class' :
|
406 |
+
$atts[ $key ] = self::html_classes( $value );
|
407 |
+
break;
|
408 |
+
case 'layout' :
|
409 |
+
$atts[ $key ] = self::accordion_main_layout( $value );
|
410 |
+
break;
|
411 |
+
}
|
412 |
+
}
|
413 |
+
|
414 |
+
return $atts;
|
415 |
+
}
|
416 |
+
|
417 |
+
public static function tab_attr( $atts ) {
|
418 |
+
foreach ( $atts as $key => $value ) {
|
419 |
+
switch( $key ) {
|
420 |
+
case 'title' :
|
421 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
422 |
+
break;
|
423 |
+
}
|
424 |
+
}
|
425 |
+
|
426 |
+
return $atts;
|
427 |
+
}
|
428 |
+
|
429 |
+
public static function toggle_attr( $atts ) {
|
430 |
+
|
431 |
+
foreach ( $atts as $key => $value ) {
|
432 |
+
switch( $key ) {
|
433 |
+
case 'title' :
|
434 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
435 |
+
break;
|
436 |
+
case 'class' :
|
437 |
+
$atts[ $key ] = self::html_classes( $value );
|
438 |
+
break;
|
439 |
+
case 'padding' :
|
440 |
+
$atts[ $key ] = self::css_unit( $value );
|
441 |
+
break;
|
442 |
+
case 'border_width' :
|
443 |
+
$atts[ $key ] = self::css_unit( $value );
|
444 |
+
break;
|
445 |
+
case 'layout' :
|
446 |
+
$atts[ $key ] = self::accordion_main_layout( $value );
|
447 |
+
break;
|
448 |
+
}
|
449 |
+
}
|
450 |
+
|
451 |
+
return $atts;
|
452 |
+
}
|
453 |
+
|
454 |
+
public static function column_attr( $atts ) {
|
455 |
+
foreach ( $atts as $key => $value ) {
|
456 |
+
switch( $key ) {
|
457 |
+
case 'size' :
|
458 |
+
$atts[ $key ] = self::column_size( $value );
|
459 |
+
break;
|
460 |
+
case 'position' :
|
461 |
+
$atts[ $key ] = self::column_position( $value );
|
462 |
+
break;
|
463 |
+
case 'class' :
|
464 |
+
$atts[ $key ] = self::html_classes( $value );
|
465 |
+
break;
|
466 |
+
case 'text_align' :
|
467 |
+
$atts[ $key ] = self::text_align( $value );
|
468 |
+
break;
|
469 |
+
}
|
470 |
+
}
|
471 |
+
|
472 |
+
return $atts;
|
473 |
+
}
|
474 |
+
|
475 |
+
public static function spacing_attr( $atts ) {
|
476 |
+
foreach ( $atts as $key => $value ) {
|
477 |
+
switch( $key ) {
|
478 |
+
case 'size' :
|
479 |
+
$atts[ $key ] = self::css_unit( $value );
|
480 |
+
break;
|
481 |
+
case 'class' :
|
482 |
+
$atts[ $key ] = self::html_classes( $value );
|
483 |
+
break;
|
484 |
+
}
|
485 |
+
}
|
486 |
+
|
487 |
+
return $atts;
|
488 |
+
}
|
489 |
+
|
490 |
+
public static function button_attr( $atts ) {
|
491 |
+
foreach ( $atts as $key => $value ) {
|
492 |
+
switch( $key ) {
|
493 |
+
case 'type' :
|
494 |
+
$atts[ $key ] = self::color_type( $value );
|
495 |
+
break;
|
496 |
+
case 'url' :
|
497 |
+
$atts[ $key ] = esc_url_raw( $value );
|
498 |
+
break;
|
499 |
+
case 'title' :
|
500 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
501 |
+
break;
|
502 |
+
case 'target' :
|
503 |
+
$atts[ $key ] = self::url_target( $value );
|
504 |
+
break;
|
505 |
+
case 'rel' :
|
506 |
+
$atts[ $key ] = self::url_rel( $value );
|
507 |
+
break;
|
508 |
+
case 'icon_left' :
|
509 |
+
$atts[ $key ] = self::fa_icon( $value );
|
510 |
+
break;
|
511 |
+
case 'icon_right' :
|
512 |
+
$atts[ $key ] = self::fa_icon( $value );
|
513 |
+
break;
|
514 |
+
case 'position' :
|
515 |
+
$atts[ $key ] = self::text_align( $value );
|
516 |
+
break;
|
517 |
+
case 'class' :
|
518 |
+
$atts[ $key ] = self::html_classes( $value );
|
519 |
+
break;
|
520 |
+
}
|
521 |
+
}
|
522 |
+
|
523 |
+
return $atts;
|
524 |
+
}
|
525 |
+
|
526 |
+
public static function box_attr( $atts ) {
|
527 |
+
foreach ( $atts as $key => $value ) {
|
528 |
+
switch( $key ) {
|
529 |
+
case 'color' :
|
530 |
+
$atts[ $key ] = self::color_type( $value );
|
531 |
+
break;
|
532 |
+
case 'text_align' :
|
533 |
+
$atts[ $key ] = self::text_align( $value );
|
534 |
+
break;
|
535 |
+
case 'margin_top' :
|
536 |
+
$atts[ $key ] = self::css_unit( $value );
|
537 |
+
break;
|
538 |
+
case 'margin_bottom' :
|
539 |
+
$atts[ $key ] = self::css_unit( $value );
|
540 |
+
break;
|
541 |
+
case 'class' :
|
542 |
+
$atts[ $key ] = self::html_classes( $value );
|
543 |
+
break;
|
544 |
+
}
|
545 |
+
}
|
546 |
+
|
547 |
+
return $atts;
|
548 |
+
}
|
549 |
+
|
550 |
+
public static function image_attr( $atts ) {
|
551 |
+
foreach ( $atts as $key => $value ) {
|
552 |
+
switch( $key ) {
|
553 |
+
case 'title' :
|
554 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
555 |
+
break;
|
556 |
+
case 'alt' :
|
557 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
558 |
+
break;
|
559 |
+
case 'caption' :
|
560 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
561 |
+
break;
|
562 |
+
case 'link_to' :
|
563 |
+
$atts[ $key ] = self::image_link_to( $value );
|
564 |
+
break;
|
565 |
+
case 'url' :
|
566 |
+
$atts[ $key ] = esc_url_raw( $value );
|
567 |
+
break;
|
568 |
+
case 'align' :
|
569 |
+
$atts[ $key ] = self::text_align( $value );
|
570 |
+
break;
|
571 |
+
case 'attachment_id' :
|
572 |
+
$atts[ $key ] = self::positive_number( $value );
|
573 |
+
break;
|
574 |
+
case 'size' :
|
575 |
+
$atts[ $key ] = self::image_size( $value );
|
576 |
+
break;
|
577 |
+
case 'flag' :
|
578 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
579 |
+
break;
|
580 |
+
case 'left' :
|
581 |
+
$atts[ $key ] = self::css_unit( $value );
|
582 |
+
break;
|
583 |
+
case 'right' :
|
584 |
+
$atts[ $key ] = self::css_unit( $value );
|
585 |
+
break;
|
586 |
+
case 'top' :
|
587 |
+
$atts[ $key ] = self::css_unit( $value );
|
588 |
+
break;
|
589 |
+
case 'bottom' :
|
590 |
+
$atts[ $key ] = self::css_unit( $value );
|
591 |
+
break;
|
592 |
+
case 'text_color' :
|
593 |
+
$atts[ $key ] = self::hex_color( $value );
|
594 |
+
break;
|
595 |
+
case 'background_color' :
|
596 |
+
$atts[ $key ] = self::hex_color( $value );
|
597 |
+
break;
|
598 |
+
case 'font_size' :
|
599 |
+
$atts[ $key ] = self::css_unit( $value );
|
600 |
+
break;
|
601 |
+
case 'text_align' :
|
602 |
+
$atts[ $key ] = self::text_align( $value );
|
603 |
+
break;
|
604 |
+
case 'flag_width' :
|
605 |
+
$atts[ $key ] = self::css_unit( $value );
|
606 |
+
break;
|
607 |
+
case 'class' :
|
608 |
+
$atts[ $key ] = self::html_classes( $value );
|
609 |
+
break;
|
610 |
+
}
|
611 |
+
}
|
612 |
+
|
613 |
+
return $atts;
|
614 |
+
}
|
615 |
+
|
616 |
+
public static function pricing_attr( $atts ) {
|
617 |
+
foreach ( $atts as $key => $value ) {
|
618 |
+
switch( $key ) {
|
619 |
+
case 'type' :
|
620 |
+
$atts[ $key ] = self::color_type( $value );
|
621 |
+
break;
|
622 |
+
case 'plan' :
|
623 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
624 |
+
break;
|
625 |
+
case 'cost' :
|
626 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
627 |
+
break;
|
628 |
+
case 'per' :
|
629 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
630 |
+
break;
|
631 |
+
case 'button_url' :
|
632 |
+
$atts[ $key ] = esc_url_raw( $value );
|
633 |
+
break;
|
634 |
+
case 'button_text' :
|
635 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
636 |
+
break;
|
637 |
+
case 'button_target' :
|
638 |
+
$atts[ $key ] = self::url_target( $value );
|
639 |
+
break;
|
640 |
+
case 'button_rel' :
|
641 |
+
$atts[ $key ] = self::url_rel( $value );
|
642 |
+
break;
|
643 |
+
case 'class' :
|
644 |
+
$atts[ $key ] = self::html_classes( $value );
|
645 |
+
break;
|
646 |
+
}
|
647 |
+
}
|
648 |
+
|
649 |
+
return $atts;
|
650 |
+
}
|
651 |
+
|
652 |
+
public static function highlight_attr( $atts ) {
|
653 |
+
foreach ( $atts as $key => $value ) {
|
654 |
+
switch( $key ) {
|
655 |
+
case 'color' :
|
656 |
+
$atts[ $key ] = self::highlight_color( $value );
|
657 |
+
break;
|
658 |
+
case 'class' :
|
659 |
+
$atts[ $key ] = self::html_classes( $value );
|
660 |
+
break;
|
661 |
+
}
|
662 |
+
}
|
663 |
+
|
664 |
+
return $atts;
|
665 |
+
}
|
666 |
+
|
667 |
+
public static function skillbar_attr( $atts ) {
|
668 |
+
foreach ( $atts as $key => $value ) {
|
669 |
+
switch( $key ) {
|
670 |
+
case 'title' :
|
671 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
672 |
+
break;
|
673 |
+
case 'percentage' :
|
674 |
+
$atts[ $key ] = self::percentage( $value );
|
675 |
+
break;
|
676 |
+
case 'color' :
|
677 |
+
$atts[ $key ] = self::hex_color( $value );
|
678 |
+
break;
|
679 |
+
case 'show_percent' :
|
680 |
+
$atts[ $key ] = self::int_bool( $value );
|
681 |
+
break;
|
682 |
+
case 'class' :
|
683 |
+
$atts[ $key ] = self::html_classes( $value );
|
684 |
+
break;
|
685 |
+
}
|
686 |
+
}
|
687 |
+
|
688 |
+
return $atts;
|
689 |
+
}
|
690 |
+
|
691 |
+
public static function social_icons_attr( $atts ) {
|
692 |
+
foreach ( $atts as $key => $value ) {
|
693 |
+
switch( $key ) {
|
694 |
+
case 'title' :
|
695 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
696 |
+
break;
|
697 |
+
case 'format' :
|
698 |
+
$atts[ $key ] = self::social_icons_format( $value );
|
699 |
+
break;
|
700 |
+
case 'columns' :
|
701 |
+
$atts[ $key ] = self::social_icons_display_type( $value );
|
702 |
+
break;
|
703 |
+
case 'maxheight' :
|
704 |
+
$atts[ $key ] = self::social_icons_max_height( $value );
|
705 |
+
break;
|
706 |
+
case 'align' :
|
707 |
+
$atts[ $key ] = self::text_align( $value );
|
708 |
+
break;
|
709 |
+
case 'class' :
|
710 |
+
$atts[ $key ] = self::html_classes( $value );
|
711 |
+
break;
|
712 |
+
}
|
713 |
+
}
|
714 |
+
|
715 |
+
return $atts;
|
716 |
+
}
|
717 |
+
|
718 |
+
public static function rsvp_attr( $atts ) {
|
719 |
+
foreach ( $atts as $key => $value ) {
|
720 |
+
switch( $key ) {
|
721 |
+
case 'columns' :
|
722 |
+
$atts[ $key ] = self::one_three( $value );
|
723 |
+
break;
|
724 |
+
case 'align' :
|
725 |
+
$atts[ $key ] = self::text_align( $value );
|
726 |
+
break;
|
727 |
+
case 'button_align' :
|
728 |
+
$atts[ $key ] = self::text_align( $value );
|
729 |
+
break;
|
730 |
+
}
|
731 |
+
}
|
732 |
+
|
733 |
+
return $atts;
|
734 |
+
}
|
735 |
+
|
736 |
+
public static function share_buttons_attr( $atts ) {
|
737 |
+
foreach ( $atts as $key => $value ) {
|
738 |
+
switch( $key ) {
|
739 |
+
case 'class' :
|
740 |
+
$atts[ $key ] = self::html_classes( $value );
|
741 |
+
break;
|
742 |
+
}
|
743 |
+
}
|
744 |
+
|
745 |
+
return $atts;
|
746 |
+
}
|
747 |
+
|
748 |
+
public static function testimonial_attr( $atts ) {
|
749 |
+
foreach ( $atts as $key => $value ) {
|
750 |
+
switch( $key ) {
|
751 |
+
case 'by' :
|
752 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
753 |
+
break;
|
754 |
+
case 'url' :
|
755 |
+
$atts[ $key ] = esc_url_raw( $value );
|
756 |
+
break;
|
757 |
+
case 'position' :
|
758 |
+
$atts[ $key ] = self::testimonial_position( $value );
|
759 |
+
break;
|
760 |
+
case 'class' :
|
761 |
+
$atts[ $key ] = self::html_classes( $value );
|
762 |
+
break;
|
763 |
+
}
|
764 |
+
}
|
765 |
+
|
766 |
+
return $atts;
|
767 |
+
}
|
768 |
+
|
769 |
+
public static function fa_attr( $atts ) {
|
770 |
+
foreach ( $atts as $key => $value ) {
|
771 |
+
switch( $key ) {
|
772 |
+
case 'icon' :
|
773 |
+
$atts[ $key ] = self::fa_icon( $value );
|
774 |
+
break;
|
775 |
+
case 'margin_left' :
|
776 |
+
$atts[ $key ] = self::css_unit( $value );
|
777 |
+
break;
|
778 |
+
case 'margin_right' :
|
779 |
+
$atts[ $key ] = self::css_unit( $value );
|
780 |
+
break;
|
781 |
+
case 'class' :
|
782 |
+
$atts[ $key ] = self::html_classes( $value );
|
783 |
+
break;
|
784 |
+
}
|
785 |
+
}
|
786 |
+
|
787 |
+
return $atts;
|
788 |
+
}
|
789 |
+
|
790 |
+
public static function googlemap_attr( $atts ) {
|
791 |
+
foreach ( $atts as $key => $value ) {
|
792 |
+
switch( $key ) {
|
793 |
+
case 'title' :
|
794 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
795 |
+
break;
|
796 |
+
case 'title_on_load' :
|
797 |
+
$atts[ $key ] = self::int_bool( $value );
|
798 |
+
break;
|
799 |
+
case 'location' :
|
800 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
801 |
+
break;
|
802 |
+
case 'height' :
|
803 |
+
$atts[ $key ] = self::css_unit( $value );
|
804 |
+
break;
|
805 |
+
case 'zoom' :
|
806 |
+
$atts[ $key ] = self::google_map_zoom( $value );
|
807 |
+
break;
|
808 |
+
case 'class' :
|
809 |
+
$atts[ $key ] = self::html_classes( $value );
|
810 |
+
break;
|
811 |
+
}
|
812 |
+
}
|
813 |
+
|
814 |
+
return $atts;
|
815 |
+
}
|
816 |
+
|
817 |
+
public static function divider_attr( $atts ) {
|
818 |
+
foreach ( $atts as $key => $value ) {
|
819 |
+
switch( $key ) {
|
820 |
+
case 'style' :
|
821 |
+
$atts[ $key ] = self::divider_style( $value );
|
822 |
+
break;
|
823 |
+
case 'line' :
|
824 |
+
$atts[ $key ] = self::divider_line( $value );
|
825 |
+
break;
|
826 |
+
case 'margin_top' :
|
827 |
+
$atts[ $key ] = self::css_unit( $value );
|
828 |
+
break;
|
829 |
+
case 'margin_bottom' :
|
830 |
+
$atts[ $key ] = self::css_unit( $value );
|
831 |
+
break;
|
832 |
+
case 'class' :
|
833 |
+
$atts[ $key ] = self::html_classes( $value );
|
834 |
+
break;
|
835 |
+
}
|
836 |
+
}
|
837 |
+
|
838 |
+
return $atts;
|
839 |
+
}
|
840 |
+
|
841 |
+
public static function countdown_attr( $atts ) {
|
842 |
+
foreach ( $atts as $key => $value ) {
|
843 |
+
switch( $key ) {
|
844 |
+
case 'date' :
|
845 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
846 |
+
break;
|
847 |
+
case 'format' :
|
848 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
849 |
+
break;
|
850 |
+
case 'labels' :
|
851 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
852 |
+
break;
|
853 |
+
case 'labels1' :
|
854 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
855 |
+
break;
|
856 |
+
case 'message' :
|
857 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
858 |
+
break;
|
859 |
+
}
|
860 |
+
}
|
861 |
+
|
862 |
+
return $atts;
|
863 |
+
}
|
864 |
+
|
865 |
+
public static function html_attr( $atts ) {
|
866 |
+
foreach ( $atts as $key => $value ) {
|
867 |
+
switch( $key ) {
|
868 |
+
case 'name' :
|
869 |
+
$atts[ $key ] = self::custom_field_name( $value );
|
870 |
+
break;
|
871 |
+
}
|
872 |
+
}
|
873 |
+
|
874 |
+
return $atts;
|
875 |
+
}
|
876 |
+
|
877 |
+
public static function pre_attr( $atts ) {
|
878 |
+
foreach ( $atts as $key => $value ) {
|
879 |
+
switch( $key ) {
|
880 |
+
case 'name' :
|
881 |
+
$atts[ $key ] = self::custom_field_name( $value );
|
882 |
+
break;
|
883 |
+
case 'scrollable' :
|
884 |
+
$atts[ $key ] = self::int_bool( $value );
|
885 |
+
break;
|
886 |
+
case 'color' :
|
887 |
+
$atts[ $key ] = self::int_bool( $value );
|
888 |
+
break;
|
889 |
+
case 'lang' :
|
890 |
+
$atts[ $key ] = self::html_classes( $value );
|
891 |
+
break;
|
892 |
+
case 'linenums' :
|
893 |
+
$atts[ $key ] = self::int_bool( $value );
|
894 |
+
break;
|
895 |
+
case 'wrap' :
|
896 |
+
$atts[ $key ] = self::int_bool( $value );
|
897 |
+
break;
|
898 |
+
}
|
899 |
+
}
|
900 |
+
|
901 |
+
return $atts;
|
902 |
+
}
|
903 |
+
|
904 |
+
public static function center_attr( $atts ) {
|
905 |
+
foreach ( $atts as $key => $value ) {
|
906 |
+
switch( $key ) {
|
907 |
+
case 'max_width' :
|
908 |
+
$atts[ $key ] = self::css_unit( $value );
|
909 |
+
break;
|
910 |
+
case 'text_align' :
|
911 |
+
$atts[ $key ] = self::text_align( $value );
|
912 |
+
break;
|
913 |
+
case 'class' :
|
914 |
+
$atts[ $key ] = self::html_classes( $value );
|
915 |
+
break;
|
916 |
+
}
|
917 |
+
}
|
918 |
+
|
919 |
+
return $atts;
|
920 |
+
}
|
921 |
+
|
922 |
+
public static function fullwidth_attr( $atts ) {
|
923 |
+
foreach ( $atts as $key => $value ) {
|
924 |
+
switch( $key ) {
|
925 |
+
case 'selector' :
|
926 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
927 |
+
break;
|
928 |
+
}
|
929 |
+
}
|
930 |
+
|
931 |
+
return $atts;
|
932 |
+
}
|
933 |
+
|
934 |
+
public static function heading_attr( $atts ) {
|
935 |
+
foreach ( $atts as $key => $value ) {
|
936 |
+
switch( $key ) {
|
937 |
+
case 'title' :
|
938 |
+
$atts[ $key ] = sanitize_text_field( $value );
|
939 |
+
break;
|
940 |
+
case 'type' :
|
941 |
+
$atts[ $key ] = self::heading_type( $value );
|
942 |
+
break;
|
943 |
+
case 'margin_top' :
|
944 |
+
$atts[ $key ] = self::css_unit( $value );
|
945 |
+
break;
|
946 |
+
case 'margin_bottom' :
|
947 |
+
$atts[ $key ] = self::css_unit( $value );
|
948 |
+
break;
|
949 |
+
case 'text_align' :
|
950 |
+
$atts[ $key ] = self::text_align( $value );
|
951 |
+
break;
|
952 |
+
case 'font_size' :
|
953 |
+
$atts[ $key ] = self::css_unit( $value );
|
954 |
+
break;
|
955 |
+
case 'color' :
|
956 |
+
$atts[ $key ] = self::hex_color( $value );
|
957 |
+
break;
|
958 |
+
case 'icon_left' :
|
959 |
+
$atts[ $key ] = self::fa_icon( $value );
|
960 |
+
break;
|
961 |
+
case 'icon_right' :
|
962 |
+
$atts[ $key ] = self::fa_icon( $value );
|
963 |
+
break;
|
964 |
+
case 'icon_spacing' :
|
965 |
+
$atts[ $key ] = self::css_unit( $value );
|
966 |
+
break;
|
967 |
+
case 'class' :
|
968 |
+
$atts[ $key ] = self::html_classes( $value );
|
969 |
+
break;
|
970 |
+
}
|
971 |
+
}
|
972 |
+
|
973 |
+
return $atts;
|
974 |
+
}
|
975 |
+
|
976 |
public static function posts_attr_key_change( $atts ) {
|
977 |
// Rename keys in shortcode options.
|
978 |
$renamed = array( 'title', 'meta_all', 'meta_author', 'meta_date', 'meta_comments', 'thumbnail', 'content', 'paging' );
|
989 |
return $atts;
|
990 |
}
|
991 |
|
992 |
+
public static function posts_attr( $atts ) {
|
993 |
// sanitize bools
|
994 |
$bools = array( 'ignore_sticky_posts', 'show_meta_category', 'nopaging', 'show_title', 'show_meta_all', 'show_meta_author', 'show_meta_date', 'show_meta_comments', 'show_thumbnail', 'show_content', 'show_paging', 'filtering' );
|
995 |
+
|
996 |
foreach ( $bools as $key ) {
|
997 |
if ( isset( $atts[ $key ] ) ) {
|
998 |
if ( "no" == $atts[ $key ] ) {
|
1003 |
$atts[ $key ] = $atts[ $key ] ? 1 : 0;
|
1004 |
}
|
1005 |
}
|
|
|
|
|
|
|
1006 |
}
|
1007 |
|
1008 |
$atts['nopaging'] = (bool) $atts['nopaging'];
|
1070 |
return $atts;
|
1071 |
}
|
1072 |
|
1073 |
+
// Fixes bools on widget update when checkbox is empty, and thus blank. We don't want to revert to the default value, but false.
|
1074 |
+
public static function post_slider_attr_fix_bools( $atts ) {
|
1075 |
+
$bools = array( 'ignore_sticky_posts', 'show_meta_category', 'show_title', 'show_content', 'slider_auto', 'nopaging' );
|
1076 |
+
|
1077 |
+
foreach ( $bools as $key ) {
|
1078 |
+
if ( ! isset( $atts[ $key ] ) ) {
|
1079 |
+
$atts[ $key ] = 0;
|
1080 |
+
}
|
1081 |
+
}
|
1082 |
+
|
1083 |
+
return $atts;
|
1084 |
+
}
|
1085 |
+
|
1086 |
+
public static function post_slider_attr( $atts ) {
|
1087 |
// sanitize bools
|
1088 |
$bools = array( 'ignore_sticky_posts', 'show_meta_category', 'show_title', 'show_content', 'slider_auto', 'nopaging' );
|
1089 |
+
|
1090 |
foreach ( $bools as $key ) {
|
1091 |
if ( isset( $atts[ $key ] ) ) {
|
1092 |
if ( "no" == $atts[ $key ] ) {
|
1097 |
$atts[ $key ] = $atts[ $key ] ? 1 : 0;
|
1098 |
}
|
1099 |
}
|
|
|
|
|
|
|
1100 |
}
|
1101 |
|
1102 |
$atts['nopaging'] = (bool) $atts['nopaging'];
|
1143 |
$atts['heading_type'] = in_array( $atts['heading_type'], $valid_headings ) ? $atts['heading_type'] : 'h2';
|
1144 |
|
1145 |
// sanitize inputs
|
1146 |
+
$atts['button_class'] = self::html_classes( $atts['button_class'] );
|
1147 |
$atts['button_class'] = empty( $atts['button_class'] ) ? 'wc-shortcodes-post-slide-button' : $atts['button_class'];
|
1148 |
$atts['terms'] = sanitize_text_field( $atts['terms'] );
|
1149 |
$atts['pids'] = sanitize_text_field( $atts['pids'] );
|
public/class-vars.php
CHANGED
@@ -8,7 +8,7 @@ class WPC_Shortcodes_Vars {
|
|
8 |
*
|
9 |
* @var string
|
10 |
*/
|
11 |
-
const VERSION = '3.
|
12 |
const DB_VERSION = '1.0';
|
13 |
|
14 |
/**
|
@@ -31,9 +31,11 @@ class WPC_Shortcodes_Vars {
|
|
31 |
protected static $options;
|
32 |
protected static $social_icons;
|
33 |
protected static $share_buttons;
|
34 |
-
|
35 |
-
|
|
|
36 |
public static $attr;
|
|
|
37 |
|
38 |
public static function init_vars() {
|
39 |
define( 'WC_SHORTCODES_IS_ACTIVATED', true );
|
@@ -45,6 +47,9 @@ class WPC_Shortcodes_Vars {
|
|
45 |
define( 'WC_SHORTCODES_FONT_AWESOME_ENABLED', get_option( WC_SHORTCODES_PREFIX . 'enable_font_awesome', true ) );
|
46 |
define( 'WC_SHORTCODES_SLIDE_POST_TYPE_ENABLED', get_option( WC_SHORTCODES_PREFIX . 'enable_slide_post_type', true ) );
|
47 |
|
|
|
|
|
|
|
48 |
self::$options = array();
|
49 |
self::$social_icons = array(
|
50 |
'facebook' => 'Facebook',
|
@@ -130,6 +135,192 @@ class WPC_Shortcodes_Vars {
|
|
130 |
|
131 |
// Shortcode Options
|
132 |
self::$attr = (object) array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
self::$attr->posts = array(
|
134 |
'author' => '', //use author id
|
135 |
'author_name' => '', //use 'user_nicename' (NOT name).
|
8 |
*
|
9 |
* @var string
|
10 |
*/
|
11 |
+
const VERSION = '3.9';
|
12 |
const DB_VERSION = '1.0';
|
13 |
|
14 |
/**
|
31 |
protected static $options;
|
32 |
protected static $social_icons;
|
33 |
protected static $share_buttons;
|
34 |
+
public static $theme_support;
|
35 |
+
|
36 |
+
public static $google_maps_api_key;
|
37 |
public static $attr;
|
38 |
+
public static $plugin_settings_url = '';
|
39 |
|
40 |
public static function init_vars() {
|
41 |
define( 'WC_SHORTCODES_IS_ACTIVATED', true );
|
47 |
define( 'WC_SHORTCODES_FONT_AWESOME_ENABLED', get_option( WC_SHORTCODES_PREFIX . 'enable_font_awesome', true ) );
|
48 |
define( 'WC_SHORTCODES_SLIDE_POST_TYPE_ENABLED', get_option( WC_SHORTCODES_PREFIX . 'enable_slide_post_type', true ) );
|
49 |
|
50 |
+
self::$plugin_settings_url = admin_url( 'themes.php?page=' . self::$plugin_slug );
|
51 |
+
self::$google_maps_api_key = get_option( WC_SHORTCODES_PREFIX . 'google_maps_api_key' );
|
52 |
+
|
53 |
self::$options = array();
|
54 |
self::$social_icons = array(
|
55 |
'facebook' => 'Facebook',
|
135 |
|
136 |
// Shortcode Options
|
137 |
self::$attr = (object) array();
|
138 |
+
self::$attr->spacing = array(
|
139 |
+
'size' => '20px',
|
140 |
+
'class' => '',
|
141 |
+
);
|
142 |
+
self::$attr->accordion_main = array(
|
143 |
+
'class' => '',
|
144 |
+
'collapse' => 0,
|
145 |
+
'leaveopen' => 0,
|
146 |
+
'layout' => 'box',
|
147 |
+
);
|
148 |
+
self::$attr->accordion_section = array(
|
149 |
+
'title' => 'Title',
|
150 |
+
'class' => '',
|
151 |
+
);
|
152 |
+
self::$attr->tabgroup = array(
|
153 |
+
'class' => '',
|
154 |
+
'layout' => 'box',
|
155 |
+
);
|
156 |
+
self::$attr->tab = array(
|
157 |
+
'title' => 'Tab',
|
158 |
+
);
|
159 |
+
self::$attr->toggle = array(
|
160 |
+
'title' => 'Toggle Title',
|
161 |
+
'class' => '',
|
162 |
+
'padding' => '',
|
163 |
+
'border_width' => '',
|
164 |
+
'layout' => 'box',
|
165 |
+
);
|
166 |
+
self::$attr->column = array(
|
167 |
+
'size' => 'one-third',
|
168 |
+
'position' =>'',
|
169 |
+
'class' => '',
|
170 |
+
'text_align'=> '',
|
171 |
+
);
|
172 |
+
self::$attr->button = array(
|
173 |
+
'type' => 'primary', // or inverse
|
174 |
+
'url' => 'http://angiemakes.com',
|
175 |
+
'title' => 'Visit Site',
|
176 |
+
'target' => 'self',
|
177 |
+
'rel' => '',
|
178 |
+
'icon_left' => '',
|
179 |
+
'icon_right' => '',
|
180 |
+
'position' => 'float',
|
181 |
+
'class' => '',
|
182 |
+
);
|
183 |
+
self::$attr->fa = array(
|
184 |
+
'icon' => '',
|
185 |
+
'margin_right' => '',
|
186 |
+
'margin_left' => '',
|
187 |
+
'class' => '',
|
188 |
+
);
|
189 |
+
self::$attr->googlemap = array(
|
190 |
+
'title' => '', // content inside the info window
|
191 |
+
'title_on_load' => 0, // should the info window display on map load
|
192 |
+
'location' => '', // Enter a valid address that Google can geocode.
|
193 |
+
'height' => '300', // set the height of your google map in pixels
|
194 |
+
'zoom' => 10, // the lower the zoom, the farther away the map appears
|
195 |
+
'class' => '', // add a custom class to your google map
|
196 |
+
);
|
197 |
+
self::$attr->heading = array(
|
198 |
+
'title' => __('Sample Heading', 'wc'),
|
199 |
+
'type' => 'h2',
|
200 |
+
'margin_top' => '',
|
201 |
+
'margin_bottom' => '',
|
202 |
+
'text_align' => '',
|
203 |
+
'font_size' => '',
|
204 |
+
'color' => '',
|
205 |
+
'class' => '',
|
206 |
+
'icon_left' => '',
|
207 |
+
'icon_right' => '',
|
208 |
+
'icon_spacing' => '',
|
209 |
+
);
|
210 |
+
self::$attr->fullwidth = array(
|
211 |
+
'selector' => self::$theme_support[ 'fullwidth_container' ],
|
212 |
+
);
|
213 |
+
self::$attr->pricing = array(
|
214 |
+
'type' => 'primary', // primary, secondary, inverse
|
215 |
+
'plan' => 'Basic', // string
|
216 |
+
'cost' => '$20', // string
|
217 |
+
'per' => 'month', // month, day, year, week, etc
|
218 |
+
'button_url' => '', // url to payment gateway
|
219 |
+
'button_text' => 'Purchase', // call to action button
|
220 |
+
'button_target' => 'self', // self, blank
|
221 |
+
'button_rel' => 'nofollow', // alternate, author, bookmark, help, license, next, nofollow, noreferrer, prefetch, prev, search, tag
|
222 |
+
'class' => '', // add your own css class for customization.
|
223 |
+
);
|
224 |
+
self::$attr->skillbar = array(
|
225 |
+
'title' => '',
|
226 |
+
'percentage' => '100',
|
227 |
+
'color' => '#6adcfa',
|
228 |
+
'class' => '',
|
229 |
+
'show_percent' => 1
|
230 |
+
);
|
231 |
+
self::$attr->social_icons = array(
|
232 |
+
'title' => '', // for widget title
|
233 |
+
'format' => 'default',
|
234 |
+
'columns' => 'float-left',
|
235 |
+
'class' => '',
|
236 |
+
'size' => 'large', // deprecated. using maxheight now
|
237 |
+
'align' => 'left', //deprecated?
|
238 |
+
'maxheight' => '48',
|
239 |
+
);
|
240 |
+
self::$attr->share_buttons = array(
|
241 |
+
// misc options
|
242 |
+
'class' => '',
|
243 |
+
);
|
244 |
+
self::$attr->testimonial = array(
|
245 |
+
'by' => '',
|
246 |
+
'url' => '',
|
247 |
+
'position' => 'left',
|
248 |
+
'class' => '',
|
249 |
+
);
|
250 |
+
self::$attr->image = array(
|
251 |
+
// attachment detail settings
|
252 |
+
'title' => '',
|
253 |
+
'alt' => '',
|
254 |
+
'caption' => '',
|
255 |
+
|
256 |
+
// attachment display settings
|
257 |
+
'link_to' => '', // post, file, none
|
258 |
+
'url' => '', // for custom link_to
|
259 |
+
'align' => '', // none, left, center, right
|
260 |
+
'attachment_id' => '', // int id
|
261 |
+
'size' => 'large', // image size
|
262 |
+
|
263 |
+
// flag options
|
264 |
+
'flag' => '',
|
265 |
+
'left' => '',
|
266 |
+
'right' => '',
|
267 |
+
'top' => '',
|
268 |
+
'bottom' => '',
|
269 |
+
'text_color' => '',
|
270 |
+
'background_color' => '',
|
271 |
+
'font_size' => '',
|
272 |
+
'text_align' => '', // none, left, center, right
|
273 |
+
'flag_width' => '',
|
274 |
+
|
275 |
+
// misc options
|
276 |
+
'class' => '',
|
277 |
+
);
|
278 |
+
self::$attr->countdown = array(
|
279 |
+
'date' => '',
|
280 |
+
'format' => 'wdHMs',
|
281 |
+
'labels' => 'Years,Months,Weeks,Days,Hours,Minutes,Seconds',
|
282 |
+
'labels1' => 'Year,Month,Week,Day,Hour,Minute,Second',
|
283 |
+
'message' => 'Your Message Here!',
|
284 |
+
);
|
285 |
+
self::$attr->rsvp = array(
|
286 |
+
'columns' => '3',
|
287 |
+
'align' => 'left',
|
288 |
+
'button_align' => 'center',
|
289 |
+
);
|
290 |
+
self::$attr->html = array(
|
291 |
+
'name' => ''
|
292 |
+
);
|
293 |
+
self::$attr->box = array(
|
294 |
+
'color' => 'primary',
|
295 |
+
'text_align' => 'left',
|
296 |
+
'margin_top' => '',
|
297 |
+
'margin_bottom' => '',
|
298 |
+
'class' => '',
|
299 |
+
);
|
300 |
+
self::$attr->highlight = array(
|
301 |
+
'color' => 'yellow',
|
302 |
+
'class' => '',
|
303 |
+
);
|
304 |
+
self::$attr->divider = array(
|
305 |
+
'style' => 'solid',
|
306 |
+
'line' => 'single',
|
307 |
+
'margin_top' => '',
|
308 |
+
'margin_bottom' => '',
|
309 |
+
'class' => '',
|
310 |
+
);
|
311 |
+
self::$attr->pre = array(
|
312 |
+
'name' => '',
|
313 |
+
'scrollable' => 1,
|
314 |
+
'color' => 1,
|
315 |
+
'lang' => '',
|
316 |
+
'linenums' => 0,
|
317 |
+
'wrap' => 0,
|
318 |
+
);
|
319 |
+
self::$attr->center = array(
|
320 |
+
'max_width' => '500px',
|
321 |
+
'text_align' => 'center',
|
322 |
+
'class' => '',
|
323 |
+
);
|
324 |
self::$attr->posts = array(
|
325 |
'author' => '', //use author id
|
326 |
'author_name' => '', //use 'user_nicename' (NOT name).
|
public/class-widget-base.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WPC_Shortcodes_Widget_Base {
|
4 |
+
|
5 |
+
protected $number = 1;
|
6 |
+
protected $id_base = 1;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Constructs id attributes for use in WP_Widget::form() fields.
|
10 |
+
*
|
11 |
+
* This function should be used in form() methods to create id attributes
|
12 |
+
* for fields to be saved by WP_Widget::update().
|
13 |
+
*
|
14 |
+
* @since 2.8.0
|
15 |
+
* @since 4.4.0 Array format field IDs are now accepted.
|
16 |
+
* @access public
|
17 |
+
*
|
18 |
+
* @param string $field_name Field name.
|
19 |
+
* @return string ID attribute for `$field_name`.
|
20 |
+
*/
|
21 |
+
public function get_field_id( $field_name ) {
|
22 |
+
return 'widget-' . $this->id_base . '-' . $this->number . '-' . trim( str_replace( array( '[]', '[', ']' ), array( '', '-', '' ), $field_name ), '-' );
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Constructs name attributes for use in form() fields
|
27 |
+
*
|
28 |
+
* This function should be used in form() methods to create name attributes for fields
|
29 |
+
* to be saved by update()
|
30 |
+
*
|
31 |
+
* @since 2.8.0
|
32 |
+
* @since 4.4.0 Array format field names are now accepted.
|
33 |
+
* @access public
|
34 |
+
*
|
35 |
+
* @param string $field_name Field name
|
36 |
+
* @return string Name attribute for $field_name
|
37 |
+
*/
|
38 |
+
public function get_field_name($field_name) {
|
39 |
+
if ( false === $pos = strpos( $field_name, '[' ) ) {
|
40 |
+
return 'widget-' . $this->id_base . '[' . $this->number . '][' . $field_name . ']';
|
41 |
+
} else {
|
42 |
+
return 'widget-' . $this->id_base . '[' . $this->number . '][' . substr_replace( $field_name, '][', $pos, strlen( '[' ) );
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
public/class-widget-options.php
ADDED
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Widget_Options
|
4 |
+
*/
|
5 |
+
class WPC_Shortcodes_Widget_Options {
|
6 |
+
public static function heading_tags() {
|
7 |
+
return array(
|
8 |
+
'h1' => 'h1',
|
9 |
+
'h2' => 'h2',
|
10 |
+
'h3' => 'h3',
|
11 |
+
'h4' => 'h4',
|
12 |
+
'h5' => 'h5',
|
13 |
+
'h6' => 'h6',
|
14 |
+
);
|
15 |
+
}
|
16 |
+
|
17 |
+
public static function order_fields() {
|
18 |
+
return array(
|
19 |
+
'DESC' => 'DESC',
|
20 |
+
'ASC' => 'ASC',
|
21 |
+
);
|
22 |
+
}
|
23 |
+
|
24 |
+
public static function order_by_fields() {
|
25 |
+
return array(
|
26 |
+
'none' => 'No Order',
|
27 |
+
'ID' => 'Post ID',
|
28 |
+
'author' => 'Author',
|
29 |
+
'title' => 'Title',
|
30 |
+
'name' => 'Post Name',
|
31 |
+
'type' => 'Post Type',
|
32 |
+
'date' => 'Date',
|
33 |
+
'modified' => 'Last Modified Date',
|
34 |
+
'parent' => 'Post/Page Parent ID',
|
35 |
+
'rand' => 'Random',
|
36 |
+
'comment_count' => 'Number of Comments',
|
37 |
+
'menu_order' => 'Menu Order',
|
38 |
+
'post__in' => 'Preserve Post ID Order',
|
39 |
+
);
|
40 |
+
}
|
41 |
+
|
42 |
+
public static function posts_layouts() {
|
43 |
+
return array(
|
44 |
+
'masonry' => 'Masonry',
|
45 |
+
'grid' => 'Grid',
|
46 |
+
);
|
47 |
+
}
|
48 |
+
|
49 |
+
public static function posts_templates() {
|
50 |
+
return array(
|
51 |
+
'box' => 'Box',
|
52 |
+
'borderless' => 'Borderless',
|
53 |
+
);
|
54 |
+
}
|
55 |
+
|
56 |
+
public static function post_slider_templates() {
|
57 |
+
return array(
|
58 |
+
'slider1' => 'Slider 1',
|
59 |
+
'slider2' => 'Slider 2',
|
60 |
+
);
|
61 |
+
}
|
62 |
+
|
63 |
+
public static function post_slider_modes() {
|
64 |
+
return array(
|
65 |
+
'fade' => 'Fade',
|
66 |
+
'horizontal' => 'Horizontal',
|
67 |
+
'vertical' => 'Vertical',
|
68 |
+
);
|
69 |
+
}
|
70 |
+
|
71 |
+
public static function posts_columns() {
|
72 |
+
return array(
|
73 |
+
'1' => '1',
|
74 |
+
'2' => '2',
|
75 |
+
'3' => '3',
|
76 |
+
'4' => '4',
|
77 |
+
'5' => '5',
|
78 |
+
'6' => '6',
|
79 |
+
'7' => '7',
|
80 |
+
'8' => '8',
|
81 |
+
'9' => '9',
|
82 |
+
);
|
83 |
+
}
|
84 |
+
|
85 |
+
public static function image_sizes() {
|
86 |
+
$sizes = apply_filters( 'image_size_names_choose', array(
|
87 |
+
'thumbnail' => __('Thumbnail'),
|
88 |
+
'medium' => __('Medium'),
|
89 |
+
'large' => __('Large'),
|
90 |
+
'full' => __('Full Size'),
|
91 |
+
));
|
92 |
+
|
93 |
+
return $sizes;
|
94 |
+
}
|
95 |
+
|
96 |
+
public static function post_types( $add_post_type = null ) {
|
97 |
+
$args = array(
|
98 |
+
'public' => true,
|
99 |
+
);
|
100 |
+
$post_types = get_post_types( $args );
|
101 |
+
|
102 |
+
if ( ! empty( $add_post_type ) ) {
|
103 |
+
if ( post_type_exists( $add_post_type ) ) {
|
104 |
+
$post_types[ $add_post_type ] = $add_post_type;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
unset( $post_types['attachment'] );
|
109 |
+
|
110 |
+
return $post_types;
|
111 |
+
}
|
112 |
+
|
113 |
+
public static function accordion_main_layouts() {
|
114 |
+
return array(
|
115 |
+
'box' => 'Box',
|
116 |
+
'none' => 'None',
|
117 |
+
);
|
118 |
+
}
|
119 |
+
|
120 |
+
public static function column_sizes() {
|
121 |
+
return array(
|
122 |
+
'one-half' => 'One Half',
|
123 |
+
'one-third' => 'One Third',
|
124 |
+
'one-fourth' => 'One Fourth',
|
125 |
+
);
|
126 |
+
}
|
127 |
+
|
128 |
+
public static function column_positions() {
|
129 |
+
return array(
|
130 |
+
'first' => 'First',
|
131 |
+
'' => 'None',
|
132 |
+
'last' => 'Last',
|
133 |
+
);
|
134 |
+
}
|
135 |
+
|
136 |
+
public static function highlight_colors() {
|
137 |
+
return array(
|
138 |
+
'blue' => 'Blue',
|
139 |
+
'gray' => 'Gray',
|
140 |
+
'green' => 'Green',
|
141 |
+
'red' => 'Red',
|
142 |
+
'yellow' => 'Yellow',
|
143 |
+
);
|
144 |
+
}
|
145 |
+
|
146 |
+
public static function divider_style_values() {
|
147 |
+
return array(
|
148 |
+
'solid' => 'Solid',
|
149 |
+
'dashed' => 'Dashed',
|
150 |
+
'dotted' => 'Dotted',
|
151 |
+
'image' => 'Image 1',
|
152 |
+
'image2' => 'Image 2',
|
153 |
+
'image3' => 'Image 3',
|
154 |
+
);
|
155 |
+
}
|
156 |
+
|
157 |
+
public static function divider_line_values() {
|
158 |
+
return array(
|
159 |
+
'' => 'None',
|
160 |
+
'single' => 'Single',
|
161 |
+
'double' => 'Double',
|
162 |
+
);
|
163 |
+
}
|
164 |
+
|
165 |
+
public static function color_types() {
|
166 |
+
return array(
|
167 |
+
'primary' => 'Primary',
|
168 |
+
'secondary' => 'Secondary',
|
169 |
+
'inverse' => 'Inverse',
|
170 |
+
'success' => 'Success',
|
171 |
+
'warning' => 'Warning',
|
172 |
+
'danger' => 'Danger',
|
173 |
+
'info' => 'Info',
|
174 |
+
);
|
175 |
+
}
|
176 |
+
|
177 |
+
public static function image_link_to_values() {
|
178 |
+
return array(
|
179 |
+
'' => 'None',
|
180 |
+
'post' => 'Parent Post',
|
181 |
+
'file' => 'Image File',
|
182 |
+
);
|
183 |
+
}
|
184 |
+
|
185 |
+
public static function url_rel_values() {
|
186 |
+
return array(
|
187 |
+
'' => 'None',
|
188 |
+
'nofollow' => 'No Follow',
|
189 |
+
);
|
190 |
+
}
|
191 |
+
|
192 |
+
public static function url_target_values() {
|
193 |
+
return array(
|
194 |
+
'' => 'Same Window',
|
195 |
+
'blank' => 'New Tab',
|
196 |
+
);
|
197 |
+
}
|
198 |
+
|
199 |
+
public static function google_map_zoom_values() {
|
200 |
+
return array(
|
201 |
+
'1' => '1 (World)',
|
202 |
+
'2' => '2',
|
203 |
+
'3' => '3',
|
204 |
+
'4' => '4',
|
205 |
+
'5' => '5 (Landmass/continent)',
|
206 |
+
'6' => '6',
|
207 |
+
'7' => '7',
|
208 |
+
'8' => '8',
|
209 |
+
'9' => '9',
|
210 |
+
'10' => '10 (City)',
|
211 |
+
'11' => '11',
|
212 |
+
'12' => '12',
|
213 |
+
'13' => '13',
|
214 |
+
'14' => '14',
|
215 |
+
'15' => '15 (Streets)',
|
216 |
+
'16' => '16',
|
217 |
+
'17' => '17',
|
218 |
+
'18' => '18',
|
219 |
+
'19' => '19',
|
220 |
+
'20' => '20 (Buildings)',
|
221 |
+
);
|
222 |
+
}
|
223 |
+
|
224 |
+
public static function one_three_values() {
|
225 |
+
return array(
|
226 |
+
'1' => '1',
|
227 |
+
'3' => '3',
|
228 |
+
);
|
229 |
+
}
|
230 |
+
|
231 |
+
public static function left_right_none_values() {
|
232 |
+
return array(
|
233 |
+
'' => 'None',
|
234 |
+
'left' => 'Left',
|
235 |
+
'right' => 'Right',
|
236 |
+
);
|
237 |
+
}
|
238 |
+
|
239 |
+
public static function text_align_values() {
|
240 |
+
return array(
|
241 |
+
'' => 'None',
|
242 |
+
'left' => 'Left',
|
243 |
+
'center' => 'Center',
|
244 |
+
'right' => 'Right',
|
245 |
+
);
|
246 |
+
}
|
247 |
+
|
248 |
+
public static function social_icons_formats() {
|
249 |
+
return array(
|
250 |
+
'default' => 'Default',
|
251 |
+
'icon' => 'Icon',
|
252 |
+
'image' => 'Image',
|
253 |
+
);
|
254 |
+
}
|
255 |
+
|
256 |
+
public static function social_icons_display_types() {
|
257 |
+
return array(
|
258 |
+
'float-center' => 'Float Center',
|
259 |
+
'float-left' => 'Float Left',
|
260 |
+
'float-right' => 'Float Right',
|
261 |
+
'1' => '1 Column',
|
262 |
+
'2' => '2 Columns',
|
263 |
+
'3' => '3 Columns',
|
264 |
+
'4' => '4 Columns',
|
265 |
+
'5' => '5 Columns',
|
266 |
+
'6' => '6 Columns',
|
267 |
+
'7' => '7 Columns',
|
268 |
+
'8' => '8 Columns',
|
269 |
+
);
|
270 |
+
}
|
271 |
+
|
272 |
+
public static function social_icons_max_height_values() {
|
273 |
+
return array(
|
274 |
+
'10' => '10',
|
275 |
+
'12' => '12',
|
276 |
+
'14' => '14',
|
277 |
+
'16' => '16',
|
278 |
+
'18' => '18',
|
279 |
+
'20' => '20',
|
280 |
+
'22' => '22',
|
281 |
+
'24' => '24',
|
282 |
+
'26' => '26',
|
283 |
+
'28' => '28',
|
284 |
+
'30' => '30',
|
285 |
+
'32' => '32',
|
286 |
+
'34' => '34',
|
287 |
+
'36' => '36',
|
288 |
+
'38' => '38',
|
289 |
+
'40' => '40',
|
290 |
+
'42' => '42',
|
291 |
+
'44' => '44',
|
292 |
+
'46' => '46',
|
293 |
+
'48' => '48',
|
294 |
+
'50' => '50',
|
295 |
+
'52' => '52',
|
296 |
+
'54' => '54',
|
297 |
+
'56' => '56',
|
298 |
+
'58' => '58',
|
299 |
+
'60' => '60',
|
300 |
+
'62' => '62',
|
301 |
+
'64' => '64',
|
302 |
+
'66' => '66',
|
303 |
+
'68' => '68',
|
304 |
+
'70' => '70',
|
305 |
+
);
|
306 |
+
}
|
307 |
+
}
|
public/class-widgets.php
CHANGED
@@ -32,8 +32,7 @@ class WPC_Shortcodes_Widgets extends WPC_Shortcodes_Vars {
|
|
32 |
}
|
33 |
|
34 |
public function register_widgets() {
|
35 |
-
register_widget( '
|
36 |
-
register_widget( '
|
37 |
-
// register_widget( 'WC_Shortcodes_Posts_Widget' );
|
38 |
}
|
39 |
}
|
32 |
}
|
33 |
|
34 |
public function register_widgets() {
|
35 |
+
register_widget( 'WPC_Shortcodes_Widget_Social_Icons' );
|
36 |
+
register_widget( 'WPC_Shortcodes_Widget_Post_Slider' );
|
|
|
37 |
}
|
38 |
}
|
public/widgets/widget-accordion-main.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Accordion_Main extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->accordion_main, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::accordion_main_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-accordion-main-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('collapse'); ?>" name="<?php echo $this->get_field_name('collapse'); ?>" value="1" <?php checked( $o['collapse'], 1 ); ?> />
|
20 |
+
<label for="<?php echo $this->get_field_id('collapse'); ?>"><?php _e('Collapse?') ?></label>
|
21 |
+
</p>
|
22 |
+
<p>
|
23 |
+
<input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('leaveopen'); ?>" name="<?php echo $this->get_field_name('leaveopen'); ?>" value="1" <?php checked( $o['leaveopen'], 1 ); ?> />
|
24 |
+
<label for="<?php echo $this->get_field_id('leaveopen'); ?>"><?php _e('Leave Open?') ?></label>
|
25 |
+
</p>
|
26 |
+
<p>
|
27 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
28 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
29 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
30 |
+
</p>
|
31 |
+
<p>
|
32 |
+
<label for="<?php echo $this->get_field_id('layout'); ?>"><?php _e('Layout:'); ?></label>
|
33 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('layout'); ?>" name="<?php echo $this->get_field_name('layout'); ?>">
|
34 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::accordion_main_layouts() as $key => $value ) : ?>
|
35 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['layout'], $key ); ?>><?php echo $value; ?></option>';
|
36 |
+
<?php endforeach; ?>
|
37 |
+
</select>
|
38 |
+
</p>
|
39 |
+
</div>
|
40 |
+
<?php
|
41 |
+
}
|
42 |
+
}
|
public/widgets/widget-accordion-section.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Accordion_Section extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->accordion_section, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::accordion_section_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-accordion-section-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p class="wcs-instruction">Make sure you enter this shortcode inside a <code>[wc_accordion]</code> shortcode.</p>
|
19 |
+
<p>
|
20 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
21 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $o['title']; ?>" />
|
22 |
+
</p>
|
23 |
+
<p>
|
24 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
25 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
26 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
27 |
+
</p>
|
28 |
+
</div>
|
29 |
+
<?php
|
30 |
+
}
|
31 |
+
}
|
public/widgets/widget-box.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Box extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->box, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::box_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-box-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('color'); ?>"><?php _e('Color Type:'); ?></label>
|
20 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('color'); ?>" name="<?php echo $this->get_field_name('color'); ?>">
|
21 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::color_types() as $key => $value ) : ?>
|
22 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['color'], $key ); ?>><?php echo $value; ?></option>';
|
23 |
+
<?php endforeach; ?>
|
24 |
+
</select>
|
25 |
+
</p>
|
26 |
+
<p>
|
27 |
+
<label for="<?php echo $this->get_field_id('text_align'); ?>"><?php _e('Text Align:'); ?></label>
|
28 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('text_align'); ?>" name="<?php echo $this->get_field_name('text_align'); ?>">
|
29 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::text_align_values() as $key => $value ) : ?>
|
30 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['text_align'], $key ); ?>><?php echo $value; ?></option>';
|
31 |
+
<?php endforeach; ?>
|
32 |
+
</select>
|
33 |
+
</p>
|
34 |
+
<p>
|
35 |
+
<label for="<?php echo $this->get_field_id('margin_top'); ?>"><?php _e('Top Margin:') ?></label>
|
36 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('margin_top'); ?>" name="<?php echo $this->get_field_name('margin_top'); ?>" value="<?php echo $o['margin_top']; ?>" />
|
37 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
38 |
+
</p>
|
39 |
+
<p>
|
40 |
+
<label for="<?php echo $this->get_field_id('margin_bottom'); ?>"><?php _e('Bottom Margin:') ?></label>
|
41 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('margin_bottom'); ?>" name="<?php echo $this->get_field_name('margin_bottom'); ?>" value="<?php echo $o['margin_bottom']; ?>" />
|
42 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
43 |
+
</p>
|
44 |
+
<p>
|
45 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
46 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
47 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
48 |
+
</p>
|
49 |
+
</div>
|
50 |
+
<?php
|
51 |
+
}
|
52 |
+
}
|
public/widgets/widget-button.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Button extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->button, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::button_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-button-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('button_type'); ?>"><?php _e('Button Type:'); ?></label>
|
20 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('button_type'); ?>" name="<?php echo $this->get_field_name('button_type'); ?>">
|
21 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::color_types() as $key => $value ) : ?>
|
22 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['button_type'], $key ); ?>><?php echo $value; ?></option>';
|
23 |
+
<?php endforeach; ?>
|
24 |
+
</select>
|
25 |
+
</p>
|
26 |
+
<p>
|
27 |
+
<label for="<?php echo $this->get_field_id('url'); ?>"><?php _e('URL:') ?></label>
|
28 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('url'); ?>" name="<?php echo $this->get_field_name('url'); ?>" value="<?php echo $o['url']; ?>" />
|
29 |
+
</p>
|
30 |
+
<p>
|
31 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
32 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $o['title']; ?>" />
|
33 |
+
</p>
|
34 |
+
<p>
|
35 |
+
<label for="<?php echo $this->get_field_id('target'); ?>"><?php _e('URL Target:'); ?></label>
|
36 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('target'); ?>" name="<?php echo $this->get_field_name('target'); ?>">
|
37 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::url_target_values() as $key => $value ) : ?>
|
38 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['target'], $key ); ?>><?php echo $value; ?></option>';
|
39 |
+
<?php endforeach; ?>
|
40 |
+
</select>
|
41 |
+
</p>
|
42 |
+
<p>
|
43 |
+
<label for="<?php echo $this->get_field_id('url_rel'); ?>"><?php _e('URL Rel:'); ?></label>
|
44 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('url_rel'); ?>" name="<?php echo $this->get_field_name('url_rel'); ?>">
|
45 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::url_rel_values() as $key => $value ) : ?>
|
46 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['url_rel'], $key ); ?>><?php echo $value; ?></option>';
|
47 |
+
<?php endforeach; ?>
|
48 |
+
</select>
|
49 |
+
</p>
|
50 |
+
<p>
|
51 |
+
<label for="<?php echo $this->get_field_id('icon_left'); ?>"><?php _e('Icon Left:') ?></label>
|
52 |
+
<input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-autocomplete-select" id="<?php echo $this->get_field_id('icon_left'); ?>" name="<?php echo $this->get_field_name('icon_left'); ?>" value="<?php echo $o['icon_left']; ?>" />
|
53 |
+
<span class="wcs-description">Enter name of <a href="http://fontawesome.io/icons/" target="_blank">Font Awesome icon</a>.</span>
|
54 |
+
</p>
|
55 |
+
<p>
|
56 |
+
<label for="<?php echo $this->get_field_id('icon_right'); ?>"><?php _e('Icon Right:') ?></label>
|
57 |
+
<input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-autocomplete-select" id="<?php echo $this->get_field_id('icon_right'); ?>" name="<?php echo $this->get_field_name('icon_right'); ?>" value="<?php echo $o['icon_right']; ?>" />
|
58 |
+
<span class="wcs-description">Enter name of <a href="http://fontawesome.io/icons/" target="_blank">Font Awesome icon</a>.</span>
|
59 |
+
</p>
|
60 |
+
<p>
|
61 |
+
<label for="<?php echo $this->get_field_id('position'); ?>"><?php _e('Position:'); ?></label>
|
62 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('position'); ?>" name="<?php echo $this->get_field_name('position'); ?>">
|
63 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::text_align_values() as $key => $value ) : ?>
|
64 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['position'], $key ); ?>><?php echo $value; ?></option>';
|
65 |
+
<?php endforeach; ?>
|
66 |
+
</select>
|
67 |
+
</p>
|
68 |
+
<p>
|
69 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
70 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
71 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
72 |
+
</p>
|
73 |
+
</div>
|
74 |
+
|
75 |
+
<script type="text/javascript">
|
76 |
+
/* <![CDATA[ */
|
77 |
+
jQuery(document).ready(function($){
|
78 |
+
$('#wc-shortcodes-button-widget-<?php echo $this->number; ?>').wcFontAwesomeWidget();
|
79 |
+
});
|
80 |
+
/* ]]> */
|
81 |
+
</script>
|
82 |
+
<?php
|
83 |
+
}
|
84 |
+
}
|
public/widgets/widget-center.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Center extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->center, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::center_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-center-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('max_width'); ?>"><?php _e('Max Width:') ?></label>
|
20 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('max_width'); ?>" name="<?php echo $this->get_field_name('max_width'); ?>" value="<?php echo $o['max_width']; ?>" />
|
21 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
22 |
+
</p>
|
23 |
+
<p>
|
24 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
25 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
26 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
27 |
+
</p>
|
28 |
+
<p>
|
29 |
+
<label for="<?php echo $this->get_field_id('text_align'); ?>"><?php _e('Text Align:'); ?></label>
|
30 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('text_align'); ?>" name="<?php echo $this->get_field_name('text_align'); ?>">
|
31 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::text_align_values() as $key => $value ) : ?>
|
32 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['text_align'], $key ); ?>><?php echo $value; ?></option>';
|
33 |
+
<?php endforeach; ?>
|
34 |
+
</select>
|
35 |
+
</p>
|
36 |
+
</div>
|
37 |
+
<?php
|
38 |
+
}
|
39 |
+
}
|
public/widgets/widget-column.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Column extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->column, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::column_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-column-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p class="wcs-instruction">Make sure you enter this shortcode inside a <code>[wc_row]</code> shortcode.</p>
|
19 |
+
<p>
|
20 |
+
<label for="<?php echo $this->get_field_id('size'); ?>"><?php _e('Size:'); ?></label>
|
21 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('size'); ?>" name="<?php echo $this->get_field_name('size'); ?>">
|
22 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::column_sizes() as $key => $value ) : ?>
|
23 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['size'], $key ); ?>><?php echo $value; ?></option>';
|
24 |
+
<?php endforeach; ?>
|
25 |
+
</select>
|
26 |
+
</p>
|
27 |
+
<p>
|
28 |
+
<label for="<?php echo $this->get_field_id('position'); ?>"><?php _e('Position:'); ?></label>
|
29 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('position'); ?>" name="<?php echo $this->get_field_name('position'); ?>">
|
30 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::column_positions() as $key => $value ) : ?>
|
31 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['position'], $key ); ?>><?php echo $value; ?></option>';
|
32 |
+
<?php endforeach; ?>
|
33 |
+
</select>
|
34 |
+
</p>
|
35 |
+
<p>
|
36 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
37 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
38 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
39 |
+
</p>
|
40 |
+
<p>
|
41 |
+
<label for="<?php echo $this->get_field_id('text_align'); ?>"><?php _e('Text Align:'); ?></label>
|
42 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('text_align'); ?>" name="<?php echo $this->get_field_name('text_align'); ?>">
|
43 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::text_align_values() as $key => $value ) : ?>
|
44 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['text_align'], $key ); ?>><?php echo $value; ?></option>';
|
45 |
+
<?php endforeach; ?>
|
46 |
+
</select>
|
47 |
+
</p>
|
48 |
+
</div>
|
49 |
+
<?php
|
50 |
+
}
|
51 |
+
}
|
public/widgets/widget-countdown.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Countdown extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->countdown, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::countdown_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-countdown-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('date'); ?>"><?php _e('Date Format:') ?></label>
|
20 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('date'); ?>" name="<?php echo $this->get_field_name('date'); ?>" value="<?php echo $o['date']; ?>" />
|
21 |
+
<span class="wcs-description">Insert a valid date string. Example: <code>Jan 1, <?php echo date('Y', strtotime('+1 year')); ?>, 12:00:00 AM</code></span>
|
22 |
+
</p>
|
23 |
+
<p>
|
24 |
+
<label for="<?php echo $this->get_field_id('format'); ?>"><?php _e('Format:') ?></label>
|
25 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('format'); ?>" name="<?php echo $this->get_field_name('format'); ?>" value="<?php echo $o['format']; ?>" />
|
26 |
+
<span class="wcs-description">Format for display - upper case for always, lower case only if non-zero, 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds.</span>
|
27 |
+
</p>
|
28 |
+
<p>
|
29 |
+
<label for="<?php echo $this->get_field_id('labels'); ?>"><?php _e('Plural Labels:') ?></label>
|
30 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('labels'); ?>" name="<?php echo $this->get_field_name('labels'); ?>" value="<?php echo $o['labels']; ?>" />
|
31 |
+
<span class="wcs-description">Plural names for date display. Example: <code>Years,Months,Weeks,Days,Hours,Minutes,Seconds</code></span>
|
32 |
+
</p>
|
33 |
+
<p>
|
34 |
+
<label for="<?php echo $this->get_field_id('labels1'); ?>"><?php _e('Singular Labels:') ?></label>
|
35 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('labels1'); ?>" name="<?php echo $this->get_field_name('labels1'); ?>" value="<?php echo $o['labels1']; ?>" />
|
36 |
+
<span class="wcs-description">Singular names for date display. Example: <code>Year,Month,Week,Day,Hour,Minute,Second</code></span>
|
37 |
+
</p>
|
38 |
+
<p>
|
39 |
+
<label for="<?php echo $this->get_field_id('message'); ?>"><?php _e('Message:') ?></label>
|
40 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('message'); ?>" name="<?php echo $this->get_field_name('message'); ?>" value="<?php echo $o['message']; ?>" />
|
41 |
+
<span class="wcs-description">Text to display after countdown completes. Example: <code>Happy New Year!</code></span>
|
42 |
+
</p>
|
43 |
+
</div>
|
44 |
+
<?php
|
45 |
+
}
|
46 |
+
}
|
public/widgets/widget-divider.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Divider extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->divider, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::divider_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-divider-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('style'); ?>"><?php _e('Style Type:'); ?></label>
|
20 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('style'); ?>" name="<?php echo $this->get_field_name('style'); ?>">
|
21 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::divider_style_values() as $key => $value ) : ?>
|
22 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['style'], $key ); ?>><?php echo $value; ?></option>';
|
23 |
+
<?php endforeach; ?>
|
24 |
+
</select>
|
25 |
+
</p>
|
26 |
+
<p>
|
27 |
+
<label for="<?php echo $this->get_field_id('line'); ?>"><?php _e('Line Type:'); ?></label>
|
28 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('line'); ?>" name="<?php echo $this->get_field_name('line'); ?>">
|
29 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::divider_line_values() as $key => $value ) : ?>
|
30 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['line'], $key ); ?>><?php echo $value; ?></option>';
|
31 |
+
<?php endforeach; ?>
|
32 |
+
</select>
|
33 |
+
</p>
|
34 |
+
<p>
|
35 |
+
<label for="<?php echo $this->get_field_id('margin_top'); ?>"><?php _e('Top Margin:') ?></label>
|
36 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('margin_top'); ?>" name="<?php echo $this->get_field_name('margin_top'); ?>" value="<?php echo $o['margin_top']; ?>" />
|
37 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
38 |
+
</p>
|
39 |
+
<p>
|
40 |
+
<label for="<?php echo $this->get_field_id('margin_bottom'); ?>"><?php _e('Bottom Margin:') ?></label>
|
41 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('margin_bottom'); ?>" name="<?php echo $this->get_field_name('margin_bottom'); ?>" value="<?php echo $o['margin_bottom']; ?>" />
|
42 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
43 |
+
</p>
|
44 |
+
<p>
|
45 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
46 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
47 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
48 |
+
</p>
|
49 |
+
</div>
|
50 |
+
<?php
|
51 |
+
}
|
52 |
+
}
|
public/widgets/widget-fa.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_FA extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->fa, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::fa_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-fa-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('icon'); ?>"><?php _e('Icon:') ?></label>
|
20 |
+
<input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-autocomplete-select" id="<?php echo $this->get_field_id('icon'); ?>" name="<?php echo $this->get_field_name('icon'); ?>" value="<?php echo $o['icon']; ?>" />
|
21 |
+
<span class="wcs-description">Enter name of <a href="http://fontawesome.io/icons/" target="_blank">Font Awesome icon</a>.</span>
|
22 |
+
</p>
|
23 |
+
<p>
|
24 |
+
<label for="<?php echo $this->get_field_id('margin_left'); ?>"><?php _e('Left Margin Spacing:') ?></label>
|
25 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('margin_left'); ?>" name="<?php echo $this->get_field_name('margin_left'); ?>" value="<?php echo $o['margin_left']; ?>" />
|
26 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
27 |
+
</p>
|
28 |
+
<p>
|
29 |
+
<label for="<?php echo $this->get_field_id('margin_right'); ?>"><?php _e('Right Margin Spacing:') ?></label>
|
30 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('margin_right'); ?>" name="<?php echo $this->get_field_name('margin_right'); ?>" value="<?php echo $o['margin_right']; ?>" />
|
31 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
32 |
+
</p>
|
33 |
+
<p>
|
34 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
35 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
36 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
37 |
+
</p>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<script type="text/javascript">
|
41 |
+
/* <![CDATA[ */
|
42 |
+
jQuery(document).ready(function($){
|
43 |
+
$('#wc-shortcodes-fa-widget-<?php echo $this->number; ?>').wcFontAwesomeWidget();
|
44 |
+
});
|
45 |
+
/* ]]> */
|
46 |
+
</script>
|
47 |
+
<?php
|
48 |
+
}
|
49 |
+
}
|
public/widgets/widget-fullwidth.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_FullWidth extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->fullwidth, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::fullwidth_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-fullwidth-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('selector'); ?>"><?php _e('Selector:') ?></label>
|
20 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('selector'); ?>" name="<?php echo $this->get_field_name('selector'); ?>" value="<?php echo $o['selector']; ?>" />
|
21 |
+
<span class="wcs-description">Enter the name of the selector of the outer container element you want your content to span full width to.<br /><br />Example: <code>#main</code>, <code>.site-content</code>, <code>body</code>.<br /><br />Leave blank to use default selector <code><?php echo WPC_Shortcodes_Vars::$theme_support[ 'fullwidth_container' ]; ?></code></span>
|
22 |
+
</p>
|
23 |
+
</div>
|
24 |
+
<?php
|
25 |
+
}
|
26 |
+
}
|
public/widgets/widget-googlemap.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_GoogleMap extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->googlemap, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::googlemap_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-google-maps-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<?php if ( empty( WPC_Shortcodes_Vars::$google_maps_api_key ) ) : ?>
|
19 |
+
<p class="wcs-instruction">Google requires you to enter an API key for your Maps. Go to your <a href="<?php echo WPC_Shortcodes_Vars::$plugin_settings_url . '&wpcsf_active_tab=wc-shortcodes-options-google-maps-options-tab'; ?>" target="_blank">Shortcodes Settings Page</a> for more details.</p>
|
20 |
+
<?php endif; ?>
|
21 |
+
<p>
|
22 |
+
|
23 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
24 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $o['title']; ?>" />
|
25 |
+
</p>
|
26 |
+
<p>
|
27 |
+
<input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('title_on_load'); ?>" name="<?php echo $this->get_field_name('title_on_load'); ?>" value="1" <?php checked( $o['title_on_load'], 1 ); ?> />
|
28 |
+
<label for="<?php echo $this->get_field_id('title_on_load'); ?>"><?php _e('Show Title On Load?') ?></label>
|
29 |
+
</p>
|
30 |
+
<p>
|
31 |
+
<label for="<?php echo $this->get_field_id('location'); ?>"><?php _e('Location:') ?></label>
|
32 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('location'); ?>" name="<?php echo $this->get_field_name('location'); ?>" value="<?php echo $o['location']; ?>" />
|
33 |
+
<span class="wcs-description">Enter address of the location.</span>
|
34 |
+
</p>
|
35 |
+
<p>
|
36 |
+
<label for="<?php echo $this->get_field_id('height'); ?>"><?php _e('Height:') ?></label>
|
37 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" value="<?php echo $o['height']; ?>" />
|
38 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
39 |
+
</p>
|
40 |
+
<p>
|
41 |
+
<label for="<?php echo $this->get_field_id('zoom'); ?>"><?php _e('Zoom:'); ?></label>
|
42 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('zoom'); ?>" name="<?php echo $this->get_field_name('zoom'); ?>">
|
43 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::google_map_zoom_values() as $key => $value ) : ?>
|
44 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['zoom'], $key ); ?>><?php echo $value; ?></option>';
|
45 |
+
<?php endforeach; ?>
|
46 |
+
</select>
|
47 |
+
</p>
|
48 |
+
<p>
|
49 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
50 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
51 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
52 |
+
</p>
|
53 |
+
</div>
|
54 |
+
<?php
|
55 |
+
}
|
56 |
+
}
|
public/widgets/widget-heading.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Heading extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->heading, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::heading_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-heading-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
20 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $o['title']; ?>" />
|
21 |
+
</p>
|
22 |
+
<p>
|
23 |
+
<label for="<?php echo $this->get_field_id('heading_type'); ?>"><?php _e('Heading Type:'); ?></label>
|
24 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('heading_type'); ?>" name="<?php echo $this->get_field_name('heading_type'); ?>">
|
25 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::heading_tags() as $key => $value ) : ?>
|
26 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['heading_type'], $key ); ?>><?php echo $value; ?></option>';
|
27 |
+
<?php endforeach; ?>
|
28 |
+
</select>
|
29 |
+
</p>
|
30 |
+
<p>
|
31 |
+
<label for="<?php echo $this->get_field_id('margin_top'); ?>"><?php _e('Top Margin:') ?></label>
|
32 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('margin_top'); ?>" name="<?php echo $this->get_field_name('margin_top'); ?>" value="<?php echo $o['margin_top']; ?>" />
|
33 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
34 |
+
</p>
|
35 |
+
<p>
|
36 |
+
<label for="<?php echo $this->get_field_id('margin_bottom'); ?>"><?php _e('Bottom Margin:') ?></label>
|
37 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('margin_bottom'); ?>" name="<?php echo $this->get_field_name('margin_bottom'); ?>" value="<?php echo $o['margin_bottom']; ?>" />
|
38 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
39 |
+
</p>
|
40 |
+
<p>
|
41 |
+
<label for="<?php echo $this->get_field_id('text_align'); ?>"><?php _e('Text Align:'); ?></label>
|
42 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('text_align'); ?>" name="<?php echo $this->get_field_name('text_align'); ?>">
|
43 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::text_align_values() as $key => $value ) : ?>
|
44 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['text_align'], $key ); ?>><?php echo $value; ?></option>';
|
45 |
+
<?php endforeach; ?>
|
46 |
+
</select>
|
47 |
+
</p>
|
48 |
+
<p>
|
49 |
+
<label for="<?php echo $this->get_field_id('font_size'); ?>"><?php _e('Font Size:') ?></label>
|
50 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('font_size'); ?>" name="<?php echo $this->get_field_name('font_size'); ?>" value="<?php echo $o['font_size']; ?>" />
|
51 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
52 |
+
</p>
|
53 |
+
<p>
|
54 |
+
<label for="<?php echo $this->get_field_id('color'); ?>"><?php _e('Font Color:') ?></label><br />
|
55 |
+
<input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-color-picker" id="<?php echo $this->get_field_id('color'); ?>" name="<?php echo $this->get_field_name('color'); ?>" value="<?php echo $o['color']; ?>" />
|
56 |
+
</p>
|
57 |
+
<p>
|
58 |
+
<label for="<?php echo $this->get_field_id('icon_left'); ?>"><?php _e('Icon Left:') ?></label>
|
59 |
+
<input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-autocomplete-select" id="<?php echo $this->get_field_id('icon_left'); ?>" name="<?php echo $this->get_field_name('icon_left'); ?>" value="<?php echo $o['icon_left']; ?>" />
|
60 |
+
<span class="wcs-description">Enter name of <a href="http://fontawesome.io/icons/" target="_blank">Font Awesome icon</a>.</span>
|
61 |
+
</p>
|
62 |
+
<p>
|
63 |
+
<label for="<?php echo $this->get_field_id('icon_right'); ?>"><?php _e('Icon Right:') ?></label>
|
64 |
+
<input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-autocomplete-select" id="<?php echo $this->get_field_id('icon_right'); ?>" name="<?php echo $this->get_field_name('icon_right'); ?>" value="<?php echo $o['icon_right']; ?>" />
|
65 |
+
<span class="wcs-description">Enter name of <a href="http://fontawesome.io/icons/" target="_blank">Font Awesome icon</a>.</span>
|
66 |
+
</p>
|
67 |
+
<p>
|
68 |
+
<label for="<?php echo $this->get_field_id('icon_spacing'); ?>"><?php _e('Icon Spacing:') ?></label>
|
69 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('icon_spacing'); ?>" name="<?php echo $this->get_field_name('icon_spacing'); ?>" value="<?php echo $o['icon_spacing']; ?>" />
|
70 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
71 |
+
</p>
|
72 |
+
<p>
|
73 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
74 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
75 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
76 |
+
</p>
|
77 |
+
</div>
|
78 |
+
|
79 |
+
<script type="text/javascript">
|
80 |
+
/* <![CDATA[ */
|
81 |
+
jQuery(document).ready(function($){
|
82 |
+
$('#wc-shortcodes-heading-widget-<?php echo $this->number; ?>').wcFontAwesomeWidget();
|
83 |
+
$('#wc-shortcodes-heading-widget-<?php echo $this->number; ?>').wcColorPickerWidget();
|
84 |
+
|
85 |
+
});
|
86 |
+
/* ]]> */
|
87 |
+
</script>
|
88 |
+
<?php
|
89 |
+
}
|
90 |
+
}
|
public/widgets/widget-highlight.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Highlight extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->highlight, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::highlight_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-highlight-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('color'); ?>"><?php _e('Color Type:'); ?></label>
|
20 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('color'); ?>" name="<?php echo $this->get_field_name('color'); ?>">
|
21 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::highlight_colors() as $key => $value ) : ?>
|
22 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['color'], $key ); ?>><?php echo $value; ?></option>';
|
23 |
+
<?php endforeach; ?>
|
24 |
+
</select>
|
25 |
+
</p>
|
26 |
+
<p>
|
27 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
28 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
29 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
30 |
+
</p>
|
31 |
+
</div>
|
32 |
+
<?php
|
33 |
+
}
|
34 |
+
}
|
public/widgets/widget-html.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_HTML extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->html, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::html_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-html-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('name'); ?>"><?php _e('Name:') ?></label>
|
20 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('name'); ?>" name="<?php echo $this->get_field_name('name'); ?>" value="<?php echo $o['name']; ?>" />
|
21 |
+
<span class="wcs-description">Enter the name of the custom field you will use for your custom HTML. See our <a href="http://knowledgebase.angiemakes.com/how-to-insert-custom-html-and-javascript-to-the-wp-editor/?cat=24" target="_blank">help article</a> for detailed instructions.</span>
|
22 |
+
</p>
|
23 |
+
</div>
|
24 |
+
<?php
|
25 |
+
}
|
26 |
+
}
|
public/widgets/widget-image.php
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Image extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->image, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::image_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-image-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('attachment_id'); ?>"><?php _e('Attachment ID:') ?></label>
|
20 |
+
<input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-autocomplete-select" id="<?php echo $this->get_field_id('attachment_id'); ?>" data-autocomplete-type="single" data-autocomplete-lookup="attachment" name="<?php echo $this->get_field_name('attachment_id'); ?>" value="<?php echo $o['attachment_id']; ?>" />
|
21 |
+
<span class="wcs-description">Search for image title.</span>
|
22 |
+
</p>
|
23 |
+
<p>
|
24 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
25 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $o['title']; ?>" />
|
26 |
+
</p>
|
27 |
+
<p>
|
28 |
+
<label for="<?php echo $this->get_field_id('alt'); ?>"><?php _e('Alt:') ?></label>
|
29 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('alt'); ?>" name="<?php echo $this->get_field_name('alt'); ?>" value="<?php echo $o['alt']; ?>" />
|
30 |
+
</p>
|
31 |
+
<p>
|
32 |
+
<label for="<?php echo $this->get_field_id('caption'); ?>"><?php _e('Caption:') ?></label>
|
33 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('caption'); ?>" name="<?php echo $this->get_field_name('caption'); ?>" value="<?php echo $o['caption']; ?>" />
|
34 |
+
</p>
|
35 |
+
<p>
|
36 |
+
<label for="<?php echo $this->get_field_id('link_to'); ?>"><?php _e('Image Link To:'); ?></label>
|
37 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('link_to'); ?>" name="<?php echo $this->get_field_name('link_to'); ?>">
|
38 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::image_link_to_values() as $key => $value ) : ?>
|
39 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['link_to'], $key ); ?>><?php echo $value; ?></option>';
|
40 |
+
<?php endforeach; ?>
|
41 |
+
</select>
|
42 |
+
</p>
|
43 |
+
<p>
|
44 |
+
<label for="<?php echo $this->get_field_id('url'); ?>"><?php _e('URL:') ?></label>
|
45 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('url'); ?>" name="<?php echo $this->get_field_name('url'); ?>" value="<?php echo $o['url']; ?>" />
|
46 |
+
</p>
|
47 |
+
<p>
|
48 |
+
<label for="<?php echo $this->get_field_id('align'); ?>"><?php _e('Image Align:'); ?></label>
|
49 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('align'); ?>" name="<?php echo $this->get_field_name('align'); ?>">
|
50 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::text_align_values() as $key => $value ) : ?>
|
51 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['align'], $key ); ?>><?php echo $value; ?></option>';
|
52 |
+
<?php endforeach; ?>
|
53 |
+
</select>
|
54 |
+
</p>
|
55 |
+
<p>
|
56 |
+
<label for="<?php echo $this->get_field_id('size'); ?>"><?php _e('Image Size:'); ?></label>
|
57 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('size'); ?>" name="<?php echo $this->get_field_name('size'); ?>">
|
58 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::image_sizes() as $key => $value ) : ?>
|
59 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['size'], $key ); ?>><?php echo $value; ?></option>
|
60 |
+
<?php endforeach; ?>
|
61 |
+
</select>
|
62 |
+
</p>
|
63 |
+
<p>
|
64 |
+
<label for="<?php echo $this->get_field_id('text_align'); ?>"><?php _e('Text Align:'); ?></label>
|
65 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('text_align'); ?>" name="<?php echo $this->get_field_name('text_align'); ?>">
|
66 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::text_align_values() as $key => $value ) : ?>
|
67 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['text_align'], $key ); ?>><?php echo $value; ?></option>';
|
68 |
+
<?php endforeach; ?>
|
69 |
+
</select>
|
70 |
+
</p>
|
71 |
+
<p>
|
72 |
+
<label for="<?php echo $this->get_field_id('flag'); ?>"><?php _e('flag:') ?></label>
|
73 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('flag'); ?>" name="<?php echo $this->get_field_name('flag'); ?>" value="<?php echo $o['flag']; ?>" />
|
74 |
+
</p>
|
75 |
+
<p>
|
76 |
+
<label for="<?php echo $this->get_field_id('left'); ?>"><?php _e('Left:') ?></label>
|
77 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('left'); ?>" name="<?php echo $this->get_field_name('left'); ?>" value="<?php echo $o['left']; ?>" />
|
78 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
79 |
+
</p>
|
80 |
+
<p>
|
81 |
+
<label for="<?php echo $this->get_field_id('right'); ?>"><?php _e('Right:') ?></label>
|
82 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('right'); ?>" name="<?php echo $this->get_field_name('right'); ?>" value="<?php echo $o['right']; ?>" />
|
83 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
84 |
+
</p>
|
85 |
+
<p>
|
86 |
+
<label for="<?php echo $this->get_field_id('top'); ?>"><?php _e('Top:') ?></label>
|
87 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('top'); ?>" name="<?php echo $this->get_field_name('top'); ?>" value="<?php echo $o['top']; ?>" />
|
88 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
89 |
+
</p>
|
90 |
+
<p>
|
91 |
+
<label for="<?php echo $this->get_field_id('bottom'); ?>"><?php _e('Bottom:') ?></label>
|
92 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('bottom'); ?>" name="<?php echo $this->get_field_name('bottom'); ?>" value="<?php echo $o['bottom']; ?>" />
|
93 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
94 |
+
</p>
|
95 |
+
<p>
|
96 |
+
<label for="<?php echo $this->get_field_id('text_color'); ?>"><?php _e('Text Color:') ?></label><br />
|
97 |
+
<input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-color-picker" id="<?php echo $this->get_field_id('text_color'); ?>" name="<?php echo $this->get_field_name('text_color'); ?>" value="<?php echo $o['text_color']; ?>" />
|
98 |
+
</p>
|
99 |
+
<p>
|
100 |
+
<label for="<?php echo $this->get_field_id('background_color'); ?>"><?php _e('Background Color:') ?></label><br />
|
101 |
+
<input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-color-picker" id="<?php echo $this->get_field_id('background_color'); ?>" name="<?php echo $this->get_field_name('background_color'); ?>" value="<?php echo $o['background_color']; ?>" />
|
102 |
+
</p>
|
103 |
+
<p>
|
104 |
+
<label for="<?php echo $this->get_field_id('flag_width'); ?>"><?php _e('Flag Width:') ?></label>
|
105 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('flag_width'); ?>" name="<?php echo $this->get_field_name('flag_width'); ?>" value="<?php echo $o['flag_width']; ?>" />
|
106 |
+
<span class="wcs-description">Enter CSS unit value.</span>
|
107 |
+
</p>
|
108 |
+
<p>
|
109 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
110 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
111 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
112 |
+
</p>
|
113 |
+
</div>
|
114 |
+
|
115 |
+
<script type="text/javascript">
|
116 |
+
/* <![CDATA[ */
|
117 |
+
jQuery(document).ready(function($){
|
118 |
+
$('#wc-shortcodes-image-widget-<?php echo $this->number; ?>').wcPostsWidget().wcColorPickerWidget();
|
119 |
+
});
|
120 |
+
/* ]]> */
|
121 |
+
</script>
|
122 |
+
<?php
|
123 |
+
}
|
124 |
+
}
|
public/widgets/widget-post-slider.php
CHANGED
@@ -1,11 +1,9 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* WC_Shortcodes_Post_Slider_Widget
|
4 |
-
*
|
5 |
* @uses WP
|
6 |
* @uses _Widget
|
7 |
*/
|
8 |
-
class
|
9 |
function __construct() {
|
10 |
|
11 |
$widget_ops = array( 'description' => __('Add a post slider to your widget area.') );
|
@@ -32,7 +30,8 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
|
|
32 |
}
|
33 |
|
34 |
function update( $new_instance, $old_instance ) {
|
35 |
-
$
|
|
|
36 |
|
37 |
return $instance;
|
38 |
}
|
@@ -46,15 +45,7 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
|
|
46 |
$o = array_merge( WPC_Shortcodes_Vars::$attr->post_slider, $instance );
|
47 |
$o = WPC_Shortcodes_Sanitize::post_slider_attr( $o );
|
48 |
|
49 |
-
$
|
50 |
-
'public' => true,
|
51 |
-
);
|
52 |
-
$post_types = get_post_types( $args );
|
53 |
-
$slide_post_type = 'wcs_slide';
|
54 |
-
if ( post_type_exists( $slide_post_type ) ) {
|
55 |
-
$post_types[ $slide_post_type ] = $slide_post_type;
|
56 |
-
}
|
57 |
-
unset( $post_types['attachment'] );
|
58 |
?>
|
59 |
|
60 |
<div id="wc-shortcodes-post-slider-widget-<?php echo $this->number; ?>" class="wc-shortcodes-post-slider-widget wc-shortcodes-visual-manager wpc-ui-theme-override">
|
@@ -68,13 +59,7 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
|
|
68 |
<p>
|
69 |
<label for="<?php echo $this->get_field_id('order'); ?>"><?php _e('Order:'); ?></label>
|
70 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('order'); ?>" name="<?php echo $this->get_field_name('order'); ?>">
|
71 |
-
<?php
|
72 |
-
$options = array(
|
73 |
-
'DESC' => 'DESC',
|
74 |
-
'ASC' => 'ASC',
|
75 |
-
);
|
76 |
-
?>
|
77 |
-
<?php foreach ( $options as $key => $value ) : ?>
|
78 |
<option value="<?php echo $key; ?>"<?php selected( $o['order'], $key ); ?>><?php echo $value; ?></option>';
|
79 |
<?php endforeach; ?>
|
80 |
</select>
|
@@ -82,24 +67,7 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
|
|
82 |
<p>
|
83 |
<label for="<?php echo $this->get_field_id('orderby'); ?>"><?php _e('Order By:'); ?></label>
|
84 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('orderby'); ?>" name="<?php echo $this->get_field_name('orderby'); ?>">
|
85 |
-
<?php
|
86 |
-
$options = array(
|
87 |
-
'none' => 'No Order',
|
88 |
-
'ID' => 'Post ID',
|
89 |
-
'author' => 'Author',
|
90 |
-
'title' => 'Title',
|
91 |
-
'name' => 'Post Name',
|
92 |
-
'type' => 'Post Type',
|
93 |
-
'date' => 'Date',
|
94 |
-
'modified' => 'Last Modified Date',
|
95 |
-
'parent' => 'Post/Page Parent ID',
|
96 |
-
'rand' => 'Random',
|
97 |
-
'comment_count' => 'Number of Comments',
|
98 |
-
'menu_order' => 'Menu Order',
|
99 |
-
'post__in' => 'Preserve Post ID Order',
|
100 |
-
);
|
101 |
-
?>
|
102 |
-
<?php foreach ( $options as $key => $value ) : ?>
|
103 |
<option value="<?php echo $key; ?>"<?php selected( $o['orderby'], $key ); ?>><?php echo $value; ?></option>';
|
104 |
<?php endforeach; ?>
|
105 |
</select>
|
@@ -162,19 +130,12 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
|
|
162 |
<p>
|
163 |
<label for="<?php echo $this->get_field_id('button_class'); ?>"><?php _e('Button Class:') ?></label>
|
164 |
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('button_class'); ?>" name="<?php echo $this->get_field_name('button_class'); ?>" value="<?php echo $o['button_class']; ?>" />
|
|
|
165 |
</p>
|
166 |
<p>
|
167 |
<label for="<?php echo $this->get_field_id('size'); ?>"><?php _e('Image Size:'); ?></label>
|
168 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('size'); ?>" name="<?php echo $this->get_field_name('size'); ?>">
|
169 |
-
<?php
|
170 |
-
$sizes = apply_filters( 'image_size_names_choose', array(
|
171 |
-
'thumbnail' => __('Thumbnail'),
|
172 |
-
'medium' => __('Medium'),
|
173 |
-
'large' => __('Large'),
|
174 |
-
'full' => __('Full Size'),
|
175 |
-
));
|
176 |
-
?>
|
177 |
-
<?php foreach ( $sizes as $key => $value ) : ?>
|
178 |
<option value="<?php echo $key; ?>"<?php selected( $o['size'], $key ); ?>><?php echo $value; ?></option>
|
179 |
<?php endforeach; ?>
|
180 |
</select>
|
@@ -182,17 +143,7 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
|
|
182 |
<p>
|
183 |
<label for="<?php echo $this->get_field_id('heading_type'); ?>"><?php _e('Heading Type:'); ?></label>
|
184 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('heading_type'); ?>" name="<?php echo $this->get_field_name('heading_type'); ?>">
|
185 |
-
<?php
|
186 |
-
$options = array(
|
187 |
-
'h1' => 'H1',
|
188 |
-
'h2' => 'H2',
|
189 |
-
'h3' => 'H3',
|
190 |
-
'h4' => 'H4',
|
191 |
-
'h5' => 'H5',
|
192 |
-
'h6' => 'H6',
|
193 |
-
);
|
194 |
-
?>
|
195 |
-
<?php foreach ( $options as $key => $value ) : ?>
|
196 |
<option value="<?php echo $key; ?>"<?php selected( $o['heading_type'], $key ); ?>><?php echo $value; ?></option>';
|
197 |
<?php endforeach; ?>
|
198 |
</select>
|
@@ -203,13 +154,7 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
|
|
203 |
<p>
|
204 |
<label for="<?php echo $this->get_field_id('template'); ?>"><?php _e('Template:'); ?></label>
|
205 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('template'); ?>" name="<?php echo $this->get_field_name('template'); ?>">
|
206 |
-
<?php
|
207 |
-
$options = array(
|
208 |
-
'slider1' => 'Slider 1',
|
209 |
-
'slider2' => 'Slider 2',
|
210 |
-
);
|
211 |
-
?>
|
212 |
-
<?php foreach ( $options as $key => $value ) : ?>
|
213 |
<option value="<?php echo $key; ?>"<?php selected( $o['template'], $key ); ?>><?php echo $value; ?></option>';
|
214 |
<?php endforeach; ?>
|
215 |
</select>
|
@@ -244,14 +189,7 @@ class WC_Shortcodes_Post_Slider_Widget extends WP_Widget {
|
|
244 |
<p>
|
245 |
<label for="<?php echo $this->get_field_id('slider_mode'); ?>"><?php _e('Slider Mode:'); ?></label>
|
246 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('slider_mode'); ?>" name="<?php echo $this->get_field_name('slider_mode'); ?>">
|
247 |
-
<?php
|
248 |
-
$options = array(
|
249 |
-
'fade' => 'Fade',
|
250 |
-
'horizontal' => 'Horizontal',
|
251 |
-
'vertical' => 'Vertical',
|
252 |
-
);
|
253 |
-
?>
|
254 |
-
<?php foreach ( $options as $key => $value ) : ?>
|
255 |
<option value="<?php echo $key; ?>"<?php selected( $o['slider_mode'], $key ); ?>><?php echo $value; ?></option>';
|
256 |
<?php endforeach; ?>
|
257 |
</select>
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
3 |
* @uses WP
|
4 |
* @uses _Widget
|
5 |
*/
|
6 |
+
class WPC_Shortcodes_Widget_Post_Slider extends WP_Widget {
|
7 |
function __construct() {
|
8 |
|
9 |
$widget_ops = array( 'description' => __('Add a post slider to your widget area.') );
|
30 |
}
|
31 |
|
32 |
function update( $new_instance, $old_instance ) {
|
33 |
+
$new_instance = WPC_Shortcodes_Sanitize::post_slider_attr_fix_bools( $new_instance );
|
34 |
+
$instance = WPC_Shortcodes_Sanitize::post_slider_attr( $new_instance );
|
35 |
|
36 |
return $instance;
|
37 |
}
|
45 |
$o = array_merge( WPC_Shortcodes_Vars::$attr->post_slider, $instance );
|
46 |
$o = WPC_Shortcodes_Sanitize::post_slider_attr( $o );
|
47 |
|
48 |
+
$post_types = WPC_Shortcodes_Widget_Options::post_types('wcs_slide');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
?>
|
50 |
|
51 |
<div id="wc-shortcodes-post-slider-widget-<?php echo $this->number; ?>" class="wc-shortcodes-post-slider-widget wc-shortcodes-visual-manager wpc-ui-theme-override">
|
59 |
<p>
|
60 |
<label for="<?php echo $this->get_field_id('order'); ?>"><?php _e('Order:'); ?></label>
|
61 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('order'); ?>" name="<?php echo $this->get_field_name('order'); ?>">
|
62 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::order_fields() as $key => $value ) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
<option value="<?php echo $key; ?>"<?php selected( $o['order'], $key ); ?>><?php echo $value; ?></option>';
|
64 |
<?php endforeach; ?>
|
65 |
</select>
|
67 |
<p>
|
68 |
<label for="<?php echo $this->get_field_id('orderby'); ?>"><?php _e('Order By:'); ?></label>
|
69 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('orderby'); ?>" name="<?php echo $this->get_field_name('orderby'); ?>">
|
70 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::order_by_fields() as $key => $value ) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
<option value="<?php echo $key; ?>"<?php selected( $o['orderby'], $key ); ?>><?php echo $value; ?></option>';
|
72 |
<?php endforeach; ?>
|
73 |
</select>
|
130 |
<p>
|
131 |
<label for="<?php echo $this->get_field_id('button_class'); ?>"><?php _e('Button Class:') ?></label>
|
132 |
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('button_class'); ?>" name="<?php echo $this->get_field_name('button_class'); ?>" value="<?php echo $o['button_class']; ?>" />
|
133 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
134 |
</p>
|
135 |
<p>
|
136 |
<label for="<?php echo $this->get_field_id('size'); ?>"><?php _e('Image Size:'); ?></label>
|
137 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('size'); ?>" name="<?php echo $this->get_field_name('size'); ?>">
|
138 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::image_sizes() as $key => $value ) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
<option value="<?php echo $key; ?>"<?php selected( $o['size'], $key ); ?>><?php echo $value; ?></option>
|
140 |
<?php endforeach; ?>
|
141 |
</select>
|
143 |
<p>
|
144 |
<label for="<?php echo $this->get_field_id('heading_type'); ?>"><?php _e('Heading Type:'); ?></label>
|
145 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('heading_type'); ?>" name="<?php echo $this->get_field_name('heading_type'); ?>">
|
146 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::heading_tags() as $key => $value ) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
<option value="<?php echo $key; ?>"<?php selected( $o['heading_type'], $key ); ?>><?php echo $value; ?></option>';
|
148 |
<?php endforeach; ?>
|
149 |
</select>
|
154 |
<p>
|
155 |
<label for="<?php echo $this->get_field_id('template'); ?>"><?php _e('Template:'); ?></label>
|
156 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('template'); ?>" name="<?php echo $this->get_field_name('template'); ?>">
|
157 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::post_slider_templates() as $key => $value ) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
<option value="<?php echo $key; ?>"<?php selected( $o['template'], $key ); ?>><?php echo $value; ?></option>';
|
159 |
<?php endforeach; ?>
|
160 |
</select>
|
189 |
<p>
|
190 |
<label for="<?php echo $this->get_field_id('slider_mode'); ?>"><?php _e('Slider Mode:'); ?></label>
|
191 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('slider_mode'); ?>" name="<?php echo $this->get_field_name('slider_mode'); ?>">
|
192 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::post_slider_modes() as $key => $value ) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
<option value="<?php echo $key; ?>"<?php selected( $o['slider_mode'], $key ); ?>><?php echo $value; ?></option>';
|
194 |
<?php endforeach; ?>
|
195 |
</select>
|
public/widgets/widget-posts.php
CHANGED
@@ -1,42 +1,9 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* WC_Shortcodes_Posts_Widget
|
4 |
-
*
|
5 |
* @uses WP
|
6 |
* @uses _Widget
|
7 |
*/
|
8 |
-
class
|
9 |
-
function __construct() {
|
10 |
-
|
11 |
-
$widget_ops = array( 'description' => __('Add your posts to your widget area.') );
|
12 |
-
parent::__construct( 'wc_shortcodes_posts', __('Posts'), $widget_ops );
|
13 |
-
}
|
14 |
-
|
15 |
-
function widget($args, $instance) {
|
16 |
-
$shortcode = array();
|
17 |
-
foreach ( $instance as $key => $value ) {
|
18 |
-
$shortcode[] = $key . '="' . $value . '"';
|
19 |
-
}
|
20 |
-
|
21 |
-
if ( ! empty( $shortcode ) ) {
|
22 |
-
$shortcode = implode( " ", $shortcode );
|
23 |
-
$shortcode = '[wc_posts ' . $shortcode . '][/wc_posts]';
|
24 |
-
}
|
25 |
-
else {
|
26 |
-
$shortcode = '[wc_posts][/wc_posts]';
|
27 |
-
}
|
28 |
-
|
29 |
-
echo $args['before_widget'];
|
30 |
-
echo do_shortcode( $shortcode );
|
31 |
-
echo $args['after_widget'];
|
32 |
-
}
|
33 |
-
|
34 |
-
function update( $new_instance, $old_instance ) {
|
35 |
-
$instance = WPC_Shortcodes_Sanitize::posts_attr( $new_instance, $empty_is_false = true );
|
36 |
-
|
37 |
-
return $instance;
|
38 |
-
}
|
39 |
-
|
40 |
function form( $instance ) {
|
41 |
// array_merge needs both values to be array.
|
42 |
if ( ! is_array( $instance ) ) {
|
@@ -47,11 +14,7 @@ class WC_Shortcodes_Posts_Widget extends WP_Widget {
|
|
47 |
$o = array_merge( WPC_Shortcodes_Vars::$attr->posts, $instance );
|
48 |
$o = WPC_Shortcodes_Sanitize::posts_attr( $o );
|
49 |
|
50 |
-
$
|
51 |
-
'public' => true,
|
52 |
-
);
|
53 |
-
$post_types = get_post_types( $args );
|
54 |
-
unset( $post_types['attachment'] );
|
55 |
?>
|
56 |
|
57 |
<div id="wc-shortcodes-posts-widget-<?php echo $this->number; ?>" class="wc-shortcodes-posts-widget wc-shortcodes-visual-manager wpc-ui-theme-override">
|
@@ -65,13 +28,7 @@ class WC_Shortcodes_Posts_Widget extends WP_Widget {
|
|
65 |
<p>
|
66 |
<label for="<?php echo $this->get_field_id('order'); ?>"><?php _e('Order:'); ?></label>
|
67 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('order'); ?>" name="<?php echo $this->get_field_name('order'); ?>">
|
68 |
-
<?php
|
69 |
-
$options = array(
|
70 |
-
'DESC' => 'DESC',
|
71 |
-
'ASC' => 'ASC',
|
72 |
-
);
|
73 |
-
?>
|
74 |
-
<?php foreach ( $options as $key => $value ) : ?>
|
75 |
<option value="<?php echo $key; ?>"<?php selected( $o['order'], $key ); ?>><?php echo $value; ?></option>';
|
76 |
<?php endforeach; ?>
|
77 |
</select>
|
@@ -79,24 +36,7 @@ class WC_Shortcodes_Posts_Widget extends WP_Widget {
|
|
79 |
<p>
|
80 |
<label for="<?php echo $this->get_field_id('orderby'); ?>"><?php _e('Order By:'); ?></label>
|
81 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('orderby'); ?>" name="<?php echo $this->get_field_name('orderby'); ?>">
|
82 |
-
<?php
|
83 |
-
$options = array(
|
84 |
-
'none' => 'No Order',
|
85 |
-
'ID' => 'Post ID',
|
86 |
-
'author' => 'Author',
|
87 |
-
'title' => 'Title',
|
88 |
-
'name' => 'Post Name',
|
89 |
-
'type' => 'Post Type',
|
90 |
-
'date' => 'Date',
|
91 |
-
'modified' => 'Last Modified Date',
|
92 |
-
'parent' => 'Post/Page Parent ID',
|
93 |
-
'rand' => 'Random',
|
94 |
-
'comment_count' => 'Number of Comments',
|
95 |
-
'menu_order' => 'Menu Order',
|
96 |
-
'post__in' => 'Preserve Post ID Order',
|
97 |
-
);
|
98 |
-
?>
|
99 |
-
<?php foreach ( $options as $key => $value ) : ?>
|
100 |
<option value="<?php echo $key; ?>"<?php selected( $o['orderby'], $key ); ?>><?php echo $value; ?></option>';
|
101 |
<?php endforeach; ?>
|
102 |
</select>
|
@@ -175,15 +115,7 @@ class WC_Shortcodes_Posts_Widget extends WP_Widget {
|
|
175 |
<p>
|
176 |
<label for="<?php echo $this->get_field_id('size'); ?>"><?php _e('Image Size:'); ?></label>
|
177 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('size'); ?>" name="<?php echo $this->get_field_name('size'); ?>">
|
178 |
-
<?php
|
179 |
-
$sizes = apply_filters( 'image_size_names_choose', array(
|
180 |
-
'thumbnail' => __('Thumbnail'),
|
181 |
-
'medium' => __('Medium'),
|
182 |
-
'large' => __('Large'),
|
183 |
-
'full' => __('Full Size'),
|
184 |
-
));
|
185 |
-
?>
|
186 |
-
<?php foreach ( $sizes as $key => $value ) : ?>
|
187 |
<option value="<?php echo $key; ?>"<?php selected( $o['size'], $key ); ?>><?php echo $value; ?></option>
|
188 |
<?php endforeach; ?>
|
189 |
</select>
|
@@ -191,6 +123,7 @@ class WC_Shortcodes_Posts_Widget extends WP_Widget {
|
|
191 |
<p>
|
192 |
<input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('filtering'); ?>" name="<?php echo $this->get_field_name('filtering'); ?>" value="1" <?php checked( $o['filtering'], 1 ); ?> />
|
193 |
<label for="<?php echo $this->get_field_id('filtering'); ?>"><?php _e('Enable Post Filtering') ?></label>
|
|
|
194 |
</p>
|
195 |
</div>
|
196 |
<h3>Style</h3>
|
@@ -198,20 +131,7 @@ class WC_Shortcodes_Posts_Widget extends WP_Widget {
|
|
198 |
<p>
|
199 |
<label for="<?php echo $this->get_field_id('columns'); ?>"><?php _e('Columns:'); ?></label>
|
200 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('columns'); ?>" name="<?php echo $this->get_field_name('columns'); ?>">
|
201 |
-
<?php
|
202 |
-
$options = array(
|
203 |
-
'1' => '1',
|
204 |
-
'2' => '2',
|
205 |
-
'3' => '3',
|
206 |
-
'4' => '4',
|
207 |
-
'5' => '5',
|
208 |
-
'6' => '6',
|
209 |
-
'7' => '7',
|
210 |
-
'8' => '8',
|
211 |
-
'9' => '9',
|
212 |
-
);
|
213 |
-
?>
|
214 |
-
<?php foreach ( $options as $key => $value ) : ?>
|
215 |
<option value="<?php echo $key; ?>"<?php selected( $o['columns'], $key ); ?>><?php echo $value; ?></option>';
|
216 |
<?php endforeach; ?>
|
217 |
</select>
|
@@ -224,17 +144,7 @@ class WC_Shortcodes_Posts_Widget extends WP_Widget {
|
|
224 |
<p>
|
225 |
<label for="<?php echo $this->get_field_id('heading_type'); ?>"><?php _e('Heading Type:'); ?></label>
|
226 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('heading_type'); ?>" name="<?php echo $this->get_field_name('heading_type'); ?>">
|
227 |
-
<?php
|
228 |
-
$options = array(
|
229 |
-
'h1' => 'H1',
|
230 |
-
'h2' => 'H2',
|
231 |
-
'h3' => 'H3',
|
232 |
-
'h4' => 'H4',
|
233 |
-
'h5' => 'H5',
|
234 |
-
'h6' => 'H6',
|
235 |
-
);
|
236 |
-
?>
|
237 |
-
<?php foreach ( $options as $key => $value ) : ?>
|
238 |
<option value="<?php echo $key; ?>"<?php selected( $o['heading_type'], $key ); ?>><?php echo $value; ?></option>';
|
239 |
<?php endforeach; ?>
|
240 |
</select>
|
@@ -242,13 +152,7 @@ class WC_Shortcodes_Posts_Widget extends WP_Widget {
|
|
242 |
<p>
|
243 |
<label for="<?php echo $this->get_field_id('layout'); ?>"><?php _e('Layout:'); ?></label>
|
244 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('layout'); ?>" name="<?php echo $this->get_field_name('layout'); ?>">
|
245 |
-
<?php
|
246 |
-
$options = array(
|
247 |
-
'masonry' => 'Masonry',
|
248 |
-
'grid' => 'Grid',
|
249 |
-
);
|
250 |
-
?>
|
251 |
-
<?php foreach ( $options as $key => $value ) : ?>
|
252 |
<option value="<?php echo $key; ?>"<?php selected( $o['layout'], $key ); ?>><?php echo $value; ?></option>';
|
253 |
<?php endforeach; ?>
|
254 |
</select>
|
@@ -256,13 +160,7 @@ class WC_Shortcodes_Posts_Widget extends WP_Widget {
|
|
256 |
<p>
|
257 |
<label for="<?php echo $this->get_field_id('template'); ?>"><?php _e('Template:'); ?></label>
|
258 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('template'); ?>" name="<?php echo $this->get_field_name('template'); ?>">
|
259 |
-
<?php
|
260 |
-
$options = array(
|
261 |
-
'box' => 'Box',
|
262 |
-
'borderless' => 'Borderless',
|
263 |
-
);
|
264 |
-
?>
|
265 |
-
<?php foreach ( $options as $key => $value ) : ?>
|
266 |
<option value="<?php echo $key; ?>"<?php selected( $o['template'], $key ); ?>><?php echo $value; ?></option>';
|
267 |
<?php endforeach; ?>
|
268 |
</select>
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
3 |
* @uses WP
|
4 |
* @uses _Widget
|
5 |
*/
|
6 |
+
class WPC_Shortcodes_Widget_Posts extends WPC_Shortcodes_Widget_Base {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
function form( $instance ) {
|
8 |
// array_merge needs both values to be array.
|
9 |
if ( ! is_array( $instance ) ) {
|
14 |
$o = array_merge( WPC_Shortcodes_Vars::$attr->posts, $instance );
|
15 |
$o = WPC_Shortcodes_Sanitize::posts_attr( $o );
|
16 |
|
17 |
+
$post_types = WPC_Shortcodes_Widget_Options::post_types();
|
|
|
|
|
|
|
|
|
18 |
?>
|
19 |
|
20 |
<div id="wc-shortcodes-posts-widget-<?php echo $this->number; ?>" class="wc-shortcodes-posts-widget wc-shortcodes-visual-manager wpc-ui-theme-override">
|
28 |
<p>
|
29 |
<label for="<?php echo $this->get_field_id('order'); ?>"><?php _e('Order:'); ?></label>
|
30 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('order'); ?>" name="<?php echo $this->get_field_name('order'); ?>">
|
31 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::order_fields() as $key => $value ) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
<option value="<?php echo $key; ?>"<?php selected( $o['order'], $key ); ?>><?php echo $value; ?></option>';
|
33 |
<?php endforeach; ?>
|
34 |
</select>
|
36 |
<p>
|
37 |
<label for="<?php echo $this->get_field_id('orderby'); ?>"><?php _e('Order By:'); ?></label>
|
38 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('orderby'); ?>" name="<?php echo $this->get_field_name('orderby'); ?>">
|
39 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::order_by_fields() as $key => $value ) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
<option value="<?php echo $key; ?>"<?php selected( $o['orderby'], $key ); ?>><?php echo $value; ?></option>';
|
41 |
<?php endforeach; ?>
|
42 |
</select>
|
115 |
<p>
|
116 |
<label for="<?php echo $this->get_field_id('size'); ?>"><?php _e('Image Size:'); ?></label>
|
117 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('size'); ?>" name="<?php echo $this->get_field_name('size'); ?>">
|
118 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::image_sizes() as $key => $value ) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
<option value="<?php echo $key; ?>"<?php selected( $o['size'], $key ); ?>><?php echo $value; ?></option>
|
120 |
<?php endforeach; ?>
|
121 |
</select>
|
123 |
<p>
|
124 |
<input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('filtering'); ?>" name="<?php echo $this->get_field_name('filtering'); ?>" value="1" <?php checked( $o['filtering'], 1 ); ?> />
|
125 |
<label for="<?php echo $this->get_field_id('filtering'); ?>"><?php _e('Enable Post Filtering') ?></label>
|
126 |
+
<span class="wcs-description">You need to have a Taxonomy set for the filtering to show. Look under "Select Posts" to set your Taxonomy.</span>
|
127 |
</p>
|
128 |
</div>
|
129 |
<h3>Style</h3>
|
131 |
<p>
|
132 |
<label for="<?php echo $this->get_field_id('columns'); ?>"><?php _e('Columns:'); ?></label>
|
133 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('columns'); ?>" name="<?php echo $this->get_field_name('columns'); ?>">
|
134 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::posts_columns() as $key => $value ) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
<option value="<?php echo $key; ?>"<?php selected( $o['columns'], $key ); ?>><?php echo $value; ?></option>';
|
136 |
<?php endforeach; ?>
|
137 |
</select>
|
144 |
<p>
|
145 |
<label for="<?php echo $this->get_field_id('heading_type'); ?>"><?php _e('Heading Type:'); ?></label>
|
146 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('heading_type'); ?>" name="<?php echo $this->get_field_name('heading_type'); ?>">
|
147 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::heading_tags() as $key => $value ) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
<option value="<?php echo $key; ?>"<?php selected( $o['heading_type'], $key ); ?>><?php echo $value; ?></option>';
|
149 |
<?php endforeach; ?>
|
150 |
</select>
|
152 |
<p>
|
153 |
<label for="<?php echo $this->get_field_id('layout'); ?>"><?php _e('Layout:'); ?></label>
|
154 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('layout'); ?>" name="<?php echo $this->get_field_name('layout'); ?>">
|
155 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::posts_layouts() as $key => $value ) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
<option value="<?php echo $key; ?>"<?php selected( $o['layout'], $key ); ?>><?php echo $value; ?></option>';
|
157 |
<?php endforeach; ?>
|
158 |
</select>
|
160 |
<p>
|
161 |
<label for="<?php echo $this->get_field_id('template'); ?>"><?php _e('Template:'); ?></label>
|
162 |
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('template'); ?>" name="<?php echo $this->get_field_name('template'); ?>">
|
163 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::posts_templates() as $key => $value ) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
<option value="<?php echo $key; ?>"<?php selected( $o['template'], $key ); ?>><?php echo $value; ?></option>';
|
165 |
<?php endforeach; ?>
|
166 |
</select>
|
public/widgets/widget-pre.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Pre extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->pre, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::pre_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-pre-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('name'); ?>"><?php _e('Name:') ?></label>
|
20 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('name'); ?>" name="<?php echo $this->get_field_name('name'); ?>" value="<?php echo $o['name']; ?>" />
|
21 |
+
<span class="wcs-description">Enter the name of the custom field you will use for your custom HTML. See our <a href="http://knowledgebase.angiemakes.com/how-to-insert-custom-html-and-javascript-to-the-wp-editor/?cat=24" target="_blank">help article</a> for detailed instructions.</span>
|
22 |
+
</p>
|
23 |
+
<p>
|
24 |
+
<input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('scrollable'); ?>" name="<?php echo $this->get_field_name('scrollable'); ?>" value="1" <?php checked( $o['scrollable'], 1 ); ?> />
|
25 |
+
<label for="<?php echo $this->get_field_id('scrollable'); ?>"><?php _e('Enable Scroll?') ?></label>
|
26 |
+
</p>
|
27 |
+
<p>
|
28 |
+
<input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('color'); ?>" name="<?php echo $this->get_field_name('color'); ?>" value="1" <?php checked( $o['color'], 1 ); ?> />
|
29 |
+
<label for="<?php echo $this->get_field_id('color'); ?>"><?php _e('Display Code Color?') ?></label>
|
30 |
+
</p>
|
31 |
+
<p>
|
32 |
+
<input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('linenums'); ?>" name="<?php echo $this->get_field_name('linenums'); ?>" value="1" <?php checked( $o['linenums'], 1 ); ?> />
|
33 |
+
<label for="<?php echo $this->get_field_id('linenums'); ?>"><?php _e('Display Line Numbers?') ?></label>
|
34 |
+
</p>
|
35 |
+
<p>
|
36 |
+
<input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('wrap'); ?>" name="<?php echo $this->get_field_name('wrap'); ?>" value="1" <?php checked( $o['wrap'], 1 ); ?> />
|
37 |
+
<label for="<?php echo $this->get_field_id('wrap'); ?>"><?php _e('Wrap Text?') ?></label>
|
38 |
+
</p>
|
39 |
+
</div>
|
40 |
+
<?php
|
41 |
+
}
|
42 |
+
}
|
public/widgets/widget-pricing.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Pricing extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->pricing, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::pricing_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-pricing-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('type'); ?>"><?php _e('Pricing Type:'); ?></label>
|
20 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('type'); ?>" name="<?php echo $this->get_field_name('type'); ?>">
|
21 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::color_types() as $key => $value ) : ?>
|
22 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['type'], $key ); ?>><?php echo $value; ?></option>';
|
23 |
+
<?php endforeach; ?>
|
24 |
+
</select>
|
25 |
+
</p>
|
26 |
+
<p>
|
27 |
+
<label for="<?php echo $this->get_field_id('plan'); ?>"><?php _e('Plan:') ?></label>
|
28 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('plan'); ?>" name="<?php echo $this->get_field_name('plan'); ?>" value="<?php echo $o['plan']; ?>" />
|
29 |
+
</p>
|
30 |
+
<p>
|
31 |
+
<label for="<?php echo $this->get_field_id('cost'); ?>"><?php _e('Cost:') ?></label>
|
32 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('cost'); ?>" name="<?php echo $this->get_field_name('cost'); ?>" value="<?php echo $o['cost']; ?>" />
|
33 |
+
</p>
|
34 |
+
<p>
|
35 |
+
<label for="<?php echo $this->get_field_id('per'); ?>"><?php _e('Per:') ?></label>
|
36 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('per'); ?>" name="<?php echo $this->get_field_name('per'); ?>" value="<?php echo $o['per']; ?>" />
|
37 |
+
</p>
|
38 |
+
<p>
|
39 |
+
<label for="<?php echo $this->get_field_id('button_url'); ?>"><?php _e('Button URL:') ?></label>
|
40 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('button_url'); ?>" name="<?php echo $this->get_field_name('button_url'); ?>" value="<?php echo $o['button_url']; ?>" />
|
41 |
+
</p>
|
42 |
+
<p>
|
43 |
+
<label for="<?php echo $this->get_field_id('button_text'); ?>"><?php _e('Button Text:') ?></label>
|
44 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('button_text'); ?>" name="<?php echo $this->get_field_name('button_text'); ?>" value="<?php echo $o['button_text']; ?>" />
|
45 |
+
</p>
|
46 |
+
<p>
|
47 |
+
<label for="<?php echo $this->get_field_id('button_target'); ?>"><?php _e('URL Target:'); ?></label>
|
48 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('button_target'); ?>" name="<?php echo $this->get_field_name('button_target'); ?>">
|
49 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::url_target_values() as $key => $value ) : ?>
|
50 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['button_target'], $key ); ?>><?php echo $value; ?></option>';
|
51 |
+
<?php endforeach; ?>
|
52 |
+
</select>
|
53 |
+
</p>
|
54 |
+
<p>
|
55 |
+
<label for="<?php echo $this->get_field_id('button_rel'); ?>"><?php _e('URL Rel:'); ?></label>
|
56 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('button_rel'); ?>" name="<?php echo $this->get_field_name('button_rel'); ?>">
|
57 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::url_rel_values() as $key => $value ) : ?>
|
58 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['button_rel'], $key ); ?>><?php echo $value; ?></option>';
|
59 |
+
<?php endforeach; ?>
|
60 |
+
</select>
|
61 |
+
</p>
|
62 |
+
<p>
|
63 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
64 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
65 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
66 |
+
</p>
|
67 |
+
</div>
|
68 |
+
<?php
|
69 |
+
}
|
70 |
+
}
|
public/widgets/widget-rsvp.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_RSVP extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->rsvp, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::rsvp_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-rsvp-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p class="wcs-instruction">You can configure your RSVP display in your <a href="<?php echo WPC_Shortcodes_Vars::$plugin_settings_url . '&wpcsf_active_tab=wc-shortcodes-options-rsvp-options-tab'; ?>" target="_blank">Shortcodes Settings Page</a>.</p>
|
19 |
+
<p>
|
20 |
+
<label for="<?php echo $this->get_field_id('columns'); ?>"><?php _e('Columns:'); ?></label>
|
21 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('columns'); ?>" name="<?php echo $this->get_field_name('columns'); ?>">
|
22 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::one_three_values() as $key => $value ) : ?>
|
23 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['columns'], $key ); ?>><?php echo $value; ?></option>';
|
24 |
+
<?php endforeach; ?>
|
25 |
+
</select>
|
26 |
+
</p>
|
27 |
+
<p>
|
28 |
+
<label for="<?php echo $this->get_field_id('align'); ?>"><?php _e('Align:'); ?></label>
|
29 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('align'); ?>" name="<?php echo $this->get_field_name('align'); ?>">
|
30 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::text_align_values() as $key => $value ) : ?>
|
31 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['align'], $key ); ?>><?php echo $value; ?></option>';
|
32 |
+
<?php endforeach; ?>
|
33 |
+
</select>
|
34 |
+
</p>
|
35 |
+
<p>
|
36 |
+
<label for="<?php echo $this->get_field_id('button_align'); ?>"><?php _e('Button Align:'); ?></label>
|
37 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('button_align'); ?>" name="<?php echo $this->get_field_name('button_align'); ?>">
|
38 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::text_align_values() as $key => $value ) : ?>
|
39 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['button_align'], $key ); ?>><?php echo $value; ?></option>';
|
40 |
+
<?php endforeach; ?>
|
41 |
+
</select>
|
42 |
+
</p>
|
43 |
+
</div>
|
44 |
+
<?php
|
45 |
+
}
|
46 |
+
}
|
public/widgets/widget-share-buttons.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Share_Buttons extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->share_buttons, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::share_buttons_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-share-buttons-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p class="wcs-instruction">You can configure your share buttons in your <a href="<?php echo WPC_Shortcodes_Vars::$plugin_settings_url . '&wpcsf_active_tab=wc-shortcodes-options-share-buttons-options-tab'; ?>" target="_blank">Shortcode Settings Page</a>.</p>
|
19 |
+
<p>
|
20 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
21 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
22 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
23 |
+
</p>
|
24 |
+
</div>
|
25 |
+
<?php
|
26 |
+
}
|
27 |
+
}
|
public/widgets/widget-skillbar.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Skillbar extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->skillbar, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::skillbar_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-skillbar-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
20 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $o['title']; ?>" />
|
21 |
+
</p>
|
22 |
+
<p>
|
23 |
+
<label for="<?php echo $this->get_field_id('percentage'); ?>"><?php _e('Percentage:') ?></label>
|
24 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('percentage'); ?>" name="<?php echo $this->get_field_name('percentage'); ?>" value="<?php echo $o['percentage']; ?>" />
|
25 |
+
</p>
|
26 |
+
<p>
|
27 |
+
<label for="<?php echo $this->get_field_id('color'); ?>"><?php _e('Font Color:') ?></label><br />
|
28 |
+
<input type="text" class="wc-shortcodes-widget-option widefat wc-shortcodes-widget-color-picker" id="<?php echo $this->get_field_id('color'); ?>" name="<?php echo $this->get_field_name('color'); ?>" value="<?php echo $o['color']; ?>" />
|
29 |
+
</p>
|
30 |
+
<p>
|
31 |
+
<input type="checkbox" class="wc-shortcodes-widget-option checkbox" id="<?php echo $this->get_field_id('show_percent'); ?>" name="<?php echo $this->get_field_name('show_percent'); ?>" value="1" <?php checked( $o['show_percent'], 1 ); ?> />
|
32 |
+
<label for="<?php echo $this->get_field_id('show_percent'); ?>"><?php _e('Show Percent?') ?></label>
|
33 |
+
</p>
|
34 |
+
<p>
|
35 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
36 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
37 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
38 |
+
</p>
|
39 |
+
</div>
|
40 |
+
<script type="text/javascript">
|
41 |
+
/* <![CDATA[ */
|
42 |
+
jQuery(document).ready(function($){
|
43 |
+
$('#wc-shortcodes-skillbar-widget-<?php echo $this->number; ?>').wcColorPickerWidget();
|
44 |
+
});
|
45 |
+
/* ]]> */
|
46 |
+
</script>
|
47 |
+
<?php
|
48 |
+
}
|
49 |
+
}
|
public/widgets/widget-social-icons.php
CHANGED
@@ -1,13 +1,9 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* WC_Shortcodes_Social_Icons_Widget
|
4 |
-
*
|
5 |
-
* This displays a sidebar widget of social media icons.
|
6 |
-
*
|
7 |
* @uses WP
|
8 |
* @uses _Widget
|
9 |
*/
|
10 |
-
class
|
11 |
function __construct() {
|
12 |
$widget_ops = array( 'description' => __('Add your social icons to your sidebar.') );
|
13 |
parent::__construct( 'wc_shortcodes_social_icons', __('WP Canvas - Social Media Icons'), $widget_ops );
|
@@ -17,164 +13,81 @@ class WC_Shortcodes_Social_Icons_Widget extends WP_Widget {
|
|
17 |
|
18 |
$instance['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
|
19 |
|
20 |
-
echo $args['before_widget'];
|
21 |
-
|
22 |
if ( !empty($instance['title']) )
|
23 |
echo $args['before_title'] . $instance['title'] . $args['after_title'];
|
24 |
|
25 |
-
|
26 |
-
|
|
|
27 |
}
|
28 |
-
$format = $instance['format'];
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
$columns = 'float-left';
|
34 |
}
|
35 |
-
|
36 |
-
|
37 |
-
$maxheight = $instance['maxheight'];
|
38 |
}
|
39 |
|
40 |
-
$
|
41 |
-
|
42 |
-
switch ( $format ) {
|
43 |
-
case 'default' :
|
44 |
-
$format = get_option( WC_SHORTCODES_PREFIX . 'social_icons_format', 'icon' );
|
45 |
-
break;
|
46 |
-
case 'icon' :
|
47 |
-
$format = 'icon';
|
48 |
-
break;
|
49 |
-
default :
|
50 |
-
$format = 'image';
|
51 |
-
}
|
52 |
-
|
53 |
-
$show_image = 'image' == $format ? true : false;
|
54 |
-
|
55 |
-
if ( ! is_array( $order ) || empty( $order ) ) {
|
56 |
-
return;
|
57 |
-
}
|
58 |
-
|
59 |
-
$first = true;
|
60 |
-
|
61 |
-
$column_display = false;
|
62 |
-
if ( is_numeric( $columns ) & (int) $columns > 0 ) {
|
63 |
-
$column_display = true;
|
64 |
-
}
|
65 |
-
|
66 |
-
$classes = array();
|
67 |
-
$classes[] = 'wc-shortcodes-social-icons';
|
68 |
-
$classes[] = 'wc-shortcodes-clearfix';
|
69 |
-
$classes[] = 'wc-shortcodes-columns-'.$columns;
|
70 |
-
$classes[] = 'wc-shortcodes-maxheight-'.$maxheight;
|
71 |
-
$classes[] = 'wc-shortcodes-social-icons-format-'.$format;
|
72 |
-
|
73 |
-
$html = '<ul class="'.implode( ' ', $classes ).'">';
|
74 |
-
$i = 0;
|
75 |
-
foreach ($order as $key => $name) {
|
76 |
-
$li_class = array();
|
77 |
-
$li_class[] = 'wc-shortcodes-social-icon';
|
78 |
-
$li_class[] = 'wc-shortcode-social-icon-' . $key;
|
79 |
-
|
80 |
-
if ( $column_display && $i % $columns == 0 ) {
|
81 |
-
$li_class[] = 'clear-left';
|
82 |
-
}
|
83 |
-
|
84 |
-
$link_option_name = WC_SHORTCODES_PREFIX . $key . '_link';
|
85 |
-
$image_icon_option_name = WC_SHORTCODES_PREFIX . $key . '_icon';
|
86 |
-
$font_icon_option_name = WC_SHORTCODES_PREFIX . $key . '_font_icon';
|
87 |
-
|
88 |
-
$social_link = get_option( $link_option_name );
|
89 |
-
$social_link = apply_filters( 'wc_shortcodes_social_link', $social_link, $key );
|
90 |
-
|
91 |
-
$first_class = $first ? ' first-icon' : '';
|
92 |
-
$first = false;
|
93 |
-
|
94 |
-
if ( $show_image ) {
|
95 |
-
$icon_url = get_option( $image_icon_option_name );
|
96 |
-
|
97 |
-
$html .= '<li class="wc-shortcodes-social-icon wc-shortcode-social-icon-' . $key . $first_class . '">';
|
98 |
-
$html .='<a target="_blank" href="'.$social_link.'">';
|
99 |
-
$html .= '<img src="'.$icon_url.'" alt="'.$name.'">';
|
100 |
-
$html .= '</a>';
|
101 |
-
$html .= '</li>';
|
102 |
-
}
|
103 |
-
else {
|
104 |
-
$icon_class = get_option( $font_icon_option_name );
|
105 |
-
|
106 |
-
$html .= '<li class="wc-shortcodes-social-icon wc-shortcode-social-icon-' . $key . $first_class . '">';
|
107 |
-
$html .='<a target="_blank" href="'.$social_link.'">';
|
108 |
-
$html .= '<i class="fa '.$icon_class.'"></i>';
|
109 |
-
$html .= '</a>';
|
110 |
-
$html .= '</li>';
|
111 |
-
}
|
112 |
-
}
|
113 |
-
$html .= '</ul>';
|
114 |
-
|
115 |
-
echo $html;
|
116 |
-
|
117 |
echo $args['after_widget'];
|
118 |
}
|
119 |
|
120 |
function update( $new_instance, $old_instance ) {
|
121 |
-
$instance
|
122 |
-
|
123 |
-
$instance['columns'] = $new_instance['columns'];
|
124 |
-
$instance['maxheight'] = $new_instance['maxheight'];
|
125 |
return $instance;
|
126 |
}
|
127 |
|
128 |
function form( $instance ) {
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
|
|
|
|
133 |
?>
|
134 |
-
|
135 |
-
|
136 |
-
<
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
<
|
153 |
-
<option
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
<?php
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
jQuery(document).ready(function($){
|
174 |
-
$('.wc-shortcodes-social-icons').sortable({ axis: "y" });
|
175 |
-
});
|
176 |
-
/* ]]> */
|
177 |
-
</script>
|
178 |
<?php
|
179 |
}
|
180 |
}
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
3 |
* @uses WP
|
4 |
* @uses _Widget
|
5 |
*/
|
6 |
+
class WPC_Shortcodes_Widget_Social_Icons extends WP_Widget {
|
7 |
function __construct() {
|
8 |
$widget_ops = array( 'description' => __('Add your social icons to your sidebar.') );
|
9 |
parent::__construct( 'wc_shortcodes_social_icons', __('WP Canvas - Social Media Icons'), $widget_ops );
|
13 |
|
14 |
$instance['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
|
15 |
|
|
|
|
|
16 |
if ( !empty($instance['title']) )
|
17 |
echo $args['before_title'] . $instance['title'] . $args['after_title'];
|
18 |
|
19 |
+
$shortcode = array();
|
20 |
+
foreach ( $instance as $key => $value ) {
|
21 |
+
$shortcode[] = $key . '="' . $value . '"';
|
22 |
}
|
|
|
23 |
|
24 |
+
if ( ! empty( $shortcode ) ) {
|
25 |
+
$shortcode = implode( " ", $shortcode );
|
26 |
+
$shortcode = '[wc_social_icons ' . $shortcode . '][/wc_social_icons]';
|
|
|
27 |
}
|
28 |
+
else {
|
29 |
+
$shortcode = '[wc_social_icons][/wc_social_icons]';
|
|
|
30 |
}
|
31 |
|
32 |
+
echo $args['before_widget'];
|
33 |
+
echo do_shortcode( $shortcode );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
echo $args['after_widget'];
|
35 |
}
|
36 |
|
37 |
function update( $new_instance, $old_instance ) {
|
38 |
+
$instance = WPC_Shortcodes_Sanitize::social_icons_attr( $new_instance );
|
39 |
+
|
|
|
|
|
40 |
return $instance;
|
41 |
}
|
42 |
|
43 |
function form( $instance ) {
|
44 |
+
// array_merge needs both values to be array.
|
45 |
+
if ( ! is_array( $instance ) ) {
|
46 |
+
$instance = array();
|
47 |
+
}
|
48 |
+
|
49 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->social_icons, $instance );
|
50 |
+
$o = WPC_Shortcodes_Sanitize::social_icons_attr( $o );
|
51 |
?>
|
52 |
+
|
53 |
+
<div id="wc-shortcodes-social-icons-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
54 |
+
<p class="wcs-instruction">You can configure your social icons in your <a href="<?php echo WPC_Shortcodes_Vars::$plugin_settings_url . '&wpcsf_active_tab=wc-shortcodes-options-social-icons-options-tab'; ?>" target="_blank">Shortcode Settings Page</a>.</p>
|
55 |
+
<?php if ( ! isset( $o['wc_shortcodes_using_visual_manager'] ) ) : ?>
|
56 |
+
<p>
|
57 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
58 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $o['title']; ?>" />
|
59 |
+
</p>
|
60 |
+
<?php endif; ?>
|
61 |
+
<p>
|
62 |
+
<label for="<?php echo $this->get_field_id('format'); ?>"><?php _e('Format:'); ?></label>
|
63 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('format'); ?>" name="<?php echo $this->get_field_name('format'); ?>">
|
64 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::social_icons_formats() as $key => $value ) : ?>
|
65 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['format'], $key ); ?>><?php echo $value; ?></option>';
|
66 |
+
<?php endforeach; ?>
|
67 |
+
</select>
|
68 |
+
</p>
|
69 |
+
<p>
|
70 |
+
<label for="<?php echo $this->get_field_id('columns'); ?>"><?php _e('Display:'); ?></label>
|
71 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('columns'); ?>" name="<?php echo $this->get_field_name('columns'); ?>">
|
72 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::social_icons_display_types() as $key => $value ) : ?>
|
73 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['columns'], $key ); ?>><?php echo $value; ?></option>';
|
74 |
+
<?php endforeach; ?>
|
75 |
+
</select>
|
76 |
+
</p>
|
77 |
+
<p>
|
78 |
+
<label for="<?php echo $this->get_field_id('maxheight'); ?>"><?php _e('Max Height:'); ?></label>
|
79 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('maxheight'); ?>" name="<?php echo $this->get_field_name('maxheight'); ?>">
|
80 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::social_icons_max_height_values() as $key => $value ) : ?>
|
81 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['maxheight'], $key ); ?>><?php echo $value; ?></option>';
|
82 |
+
<?php endforeach; ?>
|
83 |
+
</select>
|
84 |
+
</p>
|
85 |
+
<p>
|
86 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
87 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
88 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
89 |
+
</p>
|
90 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
91 |
<?php
|
92 |
}
|
93 |
}
|
public/widgets/widget-spacing.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Spacing extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->spacing, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::spacing_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-spacing-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('size'); ?>"><?php _e('Size:') ?></label>
|
20 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('size'); ?>" name="<?php echo $this->get_field_name('size'); ?>" value="<?php echo $o['size']; ?>" />
|
21 |
+
<span class="wcs-description">Set the size or height of the spacing.</span>
|
22 |
+
</p>
|
23 |
+
<p>
|
24 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
25 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
26 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
27 |
+
</p>
|
28 |
+
</div>
|
29 |
+
<?php
|
30 |
+
}
|
31 |
+
}
|
public/widgets/widget-tab.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Tab extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->tab, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::tab_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-tab-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p class="wcs-instruction">Make sure you enter this shortcode inside a <code>[wc_tabgroup]</code> shortcode.</p>
|
19 |
+
<p>
|
20 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
21 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $o['title']; ?>" />
|
22 |
+
</p>
|
23 |
+
</div>
|
24 |
+
<?php
|
25 |
+
}
|
26 |
+
}
|
public/widgets/widget-tabgroup.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Tabgroup extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->tabgroup, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::tabgroup_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-tabgroup-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
20 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
21 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
22 |
+
</p>
|
23 |
+
<p>
|
24 |
+
<label for="<?php echo $this->get_field_id('layout'); ?>"><?php _e('Layout:'); ?></label>
|
25 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('layout'); ?>" name="<?php echo $this->get_field_name('layout'); ?>">
|
26 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::accordion_main_layouts() as $key => $value ) : ?>
|
27 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['layout'], $key ); ?>><?php echo $value; ?></option>';
|
28 |
+
<?php endforeach; ?>
|
29 |
+
</select>
|
30 |
+
</p>
|
31 |
+
</div>
|
32 |
+
<?php
|
33 |
+
}
|
34 |
+
}
|
public/widgets/widget-testimonial.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Testimonial extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->testimonial, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::testimonial_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-testimonial-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('by'); ?>"><?php _e('By:') ?></label>
|
20 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('by'); ?>" name="<?php echo $this->get_field_name('by'); ?>" value="<?php echo $o['by']; ?>" />
|
21 |
+
</p>
|
22 |
+
<p>
|
23 |
+
<label for="<?php echo $this->get_field_id('url'); ?>"><?php _e('URL:') ?></label>
|
24 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('url'); ?>" name="<?php echo $this->get_field_name('url'); ?>" value="<?php echo $o['url']; ?>" />
|
25 |
+
</p>
|
26 |
+
<p>
|
27 |
+
<label for="<?php echo $this->get_field_id('position'); ?>"><?php _e('Position:'); ?></label>
|
28 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('position'); ?>" name="<?php echo $this->get_field_name('position'); ?>">
|
29 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::left_right_none_values() as $key => $value ) : ?>
|
30 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['position'], $key ); ?>><?php echo $value; ?></option>';
|
31 |
+
<?php endforeach; ?>
|
32 |
+
</select>
|
33 |
+
</p>
|
34 |
+
<p>
|
35 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
36 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
37 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
38 |
+
</p>
|
39 |
+
</div>
|
40 |
+
<?php
|
41 |
+
}
|
42 |
+
}
|
public/widgets/widget-toggle.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @uses WP
|
4 |
+
* @uses _Widget
|
5 |
+
*/
|
6 |
+
class WPC_Shortcodes_Widget_Toggle extends WPC_Shortcodes_Widget_Base {
|
7 |
+
function form( $instance ) {
|
8 |
+
// array_merge needs both values to be array.
|
9 |
+
if ( ! is_array( $instance ) ) {
|
10 |
+
$instance = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
$o = array_merge( WPC_Shortcodes_Vars::$attr->toggle, $instance );
|
14 |
+
$o = WPC_Shortcodes_Sanitize::toggle_attr( $o );
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="wc-shortcodes-toggle-widget-<?php echo $this->number; ?>" class="wc-shortcodes-visual-manager">
|
18 |
+
<p>
|
19 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
20 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $o['title']; ?>" />
|
21 |
+
</p>
|
22 |
+
<p>
|
23 |
+
<label for="<?php echo $this->get_field_id('padding'); ?>"><?php _e('Padding:') ?></label>
|
24 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('padding'); ?>" name="<?php echo $this->get_field_name('padding'); ?>" value="<?php echo $o['padding']; ?>" />
|
25 |
+
</p>
|
26 |
+
<p>
|
27 |
+
<label for="<?php echo $this->get_field_id('borde_width'); ?>"><?php _e('Border Width:') ?></label>
|
28 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('border_width'); ?>" name="<?php echo $this->get_field_name('border_width'); ?>" value="<?php echo $o['border_width']; ?>" />
|
29 |
+
</p>
|
30 |
+
<p>
|
31 |
+
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Class:') ?></label>
|
32 |
+
<input type="text" class="wc-shortcodes-widget-option widefat" id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $o['class']; ?>" />
|
33 |
+
<span class="wcs-description">Enter class name for custom CSS styling.</span>
|
34 |
+
</p>
|
35 |
+
<p>
|
36 |
+
<label for="<?php echo $this->get_field_id('layout'); ?>"><?php _e('Layout:'); ?></label>
|
37 |
+
<select class="wc-shortcodes-widget-option" id="<?php echo $this->get_field_id('layout'); ?>" name="<?php echo $this->get_field_name('layout'); ?>">
|
38 |
+
<?php foreach ( WPC_Shortcodes_Widget_Options::accordion_main_layouts() as $key => $value ) : ?>
|
39 |
+
<option value="<?php echo $key; ?>"<?php selected( $o['layout'], $key ); ?>><?php echo $value; ?></option>';
|
40 |
+
<?php endforeach; ?>
|
41 |
+
</select>
|
42 |
+
</p>
|
43 |
+
</div>
|
44 |
+
<?php
|
45 |
+
}
|
46 |
+
}
|
readme.txt
CHANGED
@@ -1,55 +1,89 @@
|
|
1 |
-
===
|
2 |
|
3 |
Contributors: cbaldelomar
|
4 |
-
|
5 |
-
Tags: shortcode, shortcodes, accordion, accordions, tab, tabs, toggle, columns, column, section, sections, testimonials, border, borders, button, buttons, fullwidth, full width, notification, notifications, google maps, maps, googlemaps, social icons, progress bar, pricing, pricing box, highlights, image, flags, banners, countdown, rsvp, custom html, code, code snippets, snippets, isotope, masonry, posts, post_type, font awesome, icons, fontawesome, fa icons
|
6 |
Requires at least: 3.7
|
7 |
-
Tested up to: 4.7
|
8 |
Stable tag: trunk
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
12 |
-
A family of shortcodes to
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
* Accordion
|
|
|
19 |
* Tabs
|
|
|
20 |
* Toggle
|
21 |
-
*
|
22 |
-
* Testimonials
|
23 |
-
* Borders
|
24 |
-
* Buttons
|
25 |
-
* Full Width
|
26 |
-
* Notifications
|
27 |
-
* Google Maps
|
28 |
-
* Social Icons
|
29 |
-
* Progress Bars
|
30 |
-
* Pricing
|
31 |
-
* Images with Flags
|
32 |
-
* Highlights
|
33 |
-
* Countdown
|
34 |
* RSVP
|
35 |
-
* Custom HTML
|
36 |
-
* Code Snippets
|
37 |
-
* Isotope / Masonry Posts
|
38 |
-
* Font Awesome Icons
|
39 |
|
40 |
-
|
41 |
|
42 |
-
|
|
|
43 |
|
44 |
-
|
45 |
|
46 |
-
|
47 |
|
48 |
-
|
49 |
|
50 |
-
=
|
51 |
|
52 |
-
|
53 |
|
54 |
== Installation ==
|
55 |
|
@@ -58,6 +92,8 @@ Thank you so much for even considering supporting my work. If you have benefited
|
|
58 |
3. In your WordPress dashboard, head over to the *Plugins* section.
|
59 |
4. Activate *WP Canvas - Shortcodes*.
|
60 |
|
|
|
|
|
61 |
== Frequently Asked Questions ==
|
62 |
|
63 |
= How do I use the shortcodes? =
|
1 |
+
=== Shortcodes by Angie Makes ===
|
2 |
|
3 |
Contributors: cbaldelomar
|
4 |
+
Tags: shortcode, shortcodes, accordion, accordions, tab, tabs, toggle, columns, column, section, sections, testimonials, border, borders, button, buttons, fullwidth, full width, notification, notifications, google maps, maps, googlemaps, social icons, progress bar, pricing, pricing box, highlights, image, flags, banners, countdown, rsvp, custom html, code, code snippets, snippets, isotope, masonry, posts, post_type, post slider, slider, font awesome, icons, fontawesome, fa, box, heading, inline code, divider, spacing, grid, center content, center, icons, image flag, image flags
|
|
|
5 |
Requires at least: 3.7
|
6 |
+
Tested up to: 4.7.3
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
+
A plugin that adds a useful family of shortcodes to your WordPress theme.
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
+
The Shortcodes by Angie Makes plugin adds a family of easy to use shortcodes to your WordPress theme. These shortcodes work flawlessly with [Angie Makes WordPress themes](http://angiemakes.com/feminine-wordpress-blog-themes-women/). Here are the handy shortcodes included with this plugin:
|
16 |
+
|
17 |
+
Columns
|
18 |
+
|
19 |
+
* 1/2 + 1/2
|
20 |
+
* 1/3 + 1/3 + 1/3
|
21 |
+
* 1/3 + 2/3
|
22 |
+
* 2/3 + 1/3
|
23 |
+
* 1/4 + 1/4 + 1/4 + 1/4
|
24 |
+
* 1/4 + 1/2 + 1/4
|
25 |
+
* 1/2 + 1/4 + 1/4
|
26 |
+
* 1/4 + 1/4 + 1/2
|
27 |
+
* 1/4 + 3/4
|
28 |
+
* 3/4 + 1/4
|
29 |
+
|
30 |
+
Elements
|
31 |
+
|
32 |
+
* Button
|
33 |
+
* Font Awesome Icon
|
34 |
+
* Heading
|
35 |
+
* Highlight
|
36 |
+
* Spacing
|
37 |
+
* Clear Floats
|
38 |
+
* Inline Code
|
39 |
+
* Divider
|
40 |
+
|
41 |
+
Content
|
42 |
+
|
43 |
+
* Pricing Table
|
44 |
+
* Social Icon
|
45 |
+
* Share Buttons
|
46 |
+
* Testimonial
|
47 |
+
* Countdown
|
48 |
+
* Skillbar
|
49 |
+
* Image
|
50 |
+
* Box
|
51 |
+
* HTML
|
52 |
+
* Preformatted Text
|
53 |
+
|
54 |
+
Posts
|
55 |
+
|
56 |
+
* Masonry - Box
|
57 |
+
* Masonry - Borderless
|
58 |
+
* Grid - Box
|
59 |
+
* Grid - Borderless
|
60 |
+
* Post Slider 1
|
61 |
+
* Post Slider 2
|
62 |
+
|
63 |
+
Actions
|
64 |
|
65 |
* Accordion
|
66 |
+
* Accordion Section
|
67 |
* Tabs
|
68 |
+
* Tab Section
|
69 |
* Toggle
|
70 |
+
* Google Map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
* RSVP
|
|
|
|
|
|
|
|
|
72 |
|
73 |
+
Wrappers
|
74 |
|
75 |
+
* Center Content
|
76 |
+
* Full Width
|
77 |
|
78 |
+
= Demo =
|
79 |
|
80 |
+
See A DEMO of These Shortcodes Here:
|
81 |
|
82 |
+
[http://gentry.angiemakes.com/shortcodes/](http://gentry.angiemakes.com/shortcodes/)
|
83 |
|
84 |
+
= Professional Support =
|
85 |
|
86 |
+
We have tested this plugin to work with the latest version of WordPress, but do not offer individual troubleshooting support as this is a free plugin. If you need individual support, we're happy to assist you if you purchase our premium support by purchasing a premium, Angie Makes WordPress theme from [angiemakes.com](http://angiemakes.com).
|
87 |
|
88 |
== Installation ==
|
89 |
|
92 |
3. In your WordPress dashboard, head over to the *Plugins* section.
|
93 |
4. Activate *WP Canvas - Shortcodes*.
|
94 |
|
95 |
+
See our help article on [how to manually upload a plugin](http://knowledgebase.angiemakes.com/how-to-upload-and-install-a-custom-third-party-plugin/?cat=18).
|
96 |
+
|
97 |
== Frequently Asked Questions ==
|
98 |
|
99 |
= How do I use the shortcodes? =
|
wc-shortcodes.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Plugin Name:
|
4 |
-
Plugin URI: http://
|
5 |
-
Description: A family of shortcodes to
|
6 |
Author: Chris Baldelomar
|
7 |
-
Author URI: http://
|
8 |
-
Version: 3.
|
9 |
License: GPLv2 or later
|
10 |
*/
|
11 |
|
@@ -37,6 +37,10 @@ if ( WC_SHORTCODES_SLIDE_POST_TYPE_ENABLED ) {
|
|
37 |
|
38 |
require_once( plugin_dir_path( __FILE__ ) . 'public/class-ajax-front.php' );
|
39 |
|
|
|
|
|
|
|
|
|
40 |
foreach ( glob( plugin_dir_path( __FILE__ ) . 'public/widgets/widget-*.php' ) as $filename ) {
|
41 |
require_once( $filename );
|
42 |
}
|
1 |
<?php
|
2 |
/*
|
3 |
+
Plugin Name: Shortcodes by Angie Makes
|
4 |
+
Plugin URI: http://angiemakes.com/feminine-wordpress-blog-themes-women/
|
5 |
+
Description: A plugin that adds a useful family of shortcodes to your WordPress theme.
|
6 |
Author: Chris Baldelomar
|
7 |
+
Author URI: http://angiemakes.com/
|
8 |
+
Version: 3.9
|
9 |
License: GPLv2 or later
|
10 |
*/
|
11 |
|
37 |
|
38 |
require_once( plugin_dir_path( __FILE__ ) . 'public/class-ajax-front.php' );
|
39 |
|
40 |
+
require_once( plugin_dir_path( __FILE__ ) . 'public/class-widget-options.php' );
|
41 |
+
|
42 |
+
require_once( plugin_dir_path( __FILE__ ) . 'public/class-widget-base.php' );
|
43 |
+
|
44 |
foreach ( glob( plugin_dir_path( __FILE__ ) . 'public/widgets/widget-*.php' ) as $filename ) {
|
45 |
require_once( $filename );
|
46 |
}
|