Shortcodes by Angie Makes - Version 1.13

Version Description

Download this release

Release Info

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

Code changes from version 1.12 to 1.13

README.md CHANGED
@@ -44,6 +44,12 @@ Use the shortcode manager in the TinyMCE text editor
44
 
45
  ## Changelog ##
46
 
 
 
 
 
 
 
47
  ### Version 1.12
48
 
49
  * cleaned up some code
44
 
45
  ## Changelog ##
46
 
47
+ ### Version 1.13
48
+
49
+ * added rsvp shortcode
50
+ * removed focus css acting as hover
51
+ * minor css fix for countdown shortcode
52
+
53
  ### Version 1.12
54
 
55
  * cleaned up some code
includes/css/style.css CHANGED
@@ -369,8 +369,7 @@
369
  padding: 6px 20px;
370
  }
371
 
372
- .wc-shortcodes-button:hover,
373
- .wc-shortcodes-button:focus {
374
  color: #ffffff;
375
  background-color: #3276b1;
376
  border-color: #285e8e;
@@ -411,8 +410,7 @@
411
  border: 1px solid #cccccc;
412
  }
413
 
414
- .wc-shortcodes-button.wc-shortcodes-button-secondary:hover,
415
- .wc-shortcodes-button.wc-shortcodes-button-secondary:focus {
416
  color: #333333;
417
  background-color: #ebebeb;
418
  border-color: #adadad;
@@ -426,8 +424,7 @@
426
  border: 1px solid #428bca;
427
  }
428
 
429
- .wc-shortcodes-button.wc-shortcodes-button-inverse:hover,
430
- .wc-shortcodes-button.wc-shortcodes-button-inverse:focus {
431
  color: #ffffff;
432
  background-color: #428bca;
433
  border-color: #357ebd;
@@ -441,8 +438,7 @@
441
  border: 1px solid #4cae4c;
442
  }
443
 
444
- .wc-shortcodes-button.wc-shortcodes-button-success:hover,
445
- .wc-shortcodes-button.wc-shortcodes-button-success:focus {
446
  color: #ffffff;
447
  background-color: #47a447;
448
  border-color: #398439;
@@ -456,8 +452,7 @@
456
  border: 1px solid #eea236;
457
  }
458
 
459
- .wc-shortcodes-button.wc-shortcodes-button-warning:hover,
460
- .wc-shortcodes-button.wc-shortcodes-button-warning:focus {
461
  color: #ffffff;
462
  background-color: #ed9c28;
463
  border-color: #d58512;
@@ -471,8 +466,7 @@
471
  border: 1px solid #d43f3a;
472
  }
473
 
474
- .wc-shortcodes-button.wc-shortcodes-button-danger:hover,
475
- .wc-shortcodes-button.wc-shortcodes-button-danger:focus {
476
  color: #ffffff;
477
  background-color: #d2322d;
478
  border-color: #ac2925;
@@ -486,8 +480,7 @@
486
  border: 1px solid #46b8da;
487
  }
488
 
489
- .wc-shortcodes-button.wc-shortcodes-button-info:hover,
490
- .wc-shortcodes-button.wc-shortcodes-button-info:focus {
491
  color: #ffffff;
492
  background-color: #39b3d7;
493
  border-color: #269abc;
@@ -979,11 +972,13 @@ pre.pre-wrap {
979
  * jQuery Countdown styles 1.6.3.
980
  * ----------------------------------------------------------------------------
981
  */
982
- .wc-shortcodes-countdown.hasCountdown {
 
 
 
983
  border: 1px solid #ccc;
984
  background-color: #eee;
985
  text-align: center;
986
- margin-bottom: 20px;
987
  padding-top: 10px;
988
  padding-bottom: 10px;
989
  }
@@ -1025,11 +1020,10 @@ pre.pre-wrap {
1025
  font-size: 80%;
1026
  text-align: center;
1027
  border-right: 1px solid #cccccc;
1028
- border-left: 1px solid #eeeeee;
1029
  }
1030
  .wc-shortcodes-countdown .countdown_row *:last-child,
1031
- .wc-shortcodes-countdown .countdown_row .countdown_section:last-child {
1032
- border-right: 1px solid #eeeeee;
1033
  }
1034
  .wc-shortcodes-countdown .countdown_amount {
1035
  font-size: 200%;
@@ -1041,3 +1035,43 @@ pre.pre-wrap {
1041
  .wc-shortcodes-countdown .countdown_expired_message {
1042
  font-size: 200%;
1043
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369
  padding: 6px 20px;
370
  }
371
 
372
+ .wc-shortcodes-button:hover {
 
373
  color: #ffffff;
374
  background-color: #3276b1;
375
  border-color: #285e8e;
410
  border: 1px solid #cccccc;
411
  }
412
 
413
+ .wc-shortcodes-button.wc-shortcodes-button-secondary:hover {
 
414
  color: #333333;
415
  background-color: #ebebeb;
416
  border-color: #adadad;
424
  border: 1px solid #428bca;
425
  }
426
 
427
+ .wc-shortcodes-button.wc-shortcodes-button-inverse:hover {
 
428
  color: #ffffff;
429
  background-color: #428bca;
430
  border-color: #357ebd;
438
  border: 1px solid #4cae4c;
439
  }
440
 
441
+ .wc-shortcodes-button.wc-shortcodes-button-success:hover {
 
442
  color: #ffffff;
443
  background-color: #47a447;
444
  border-color: #398439;
452
  border: 1px solid #eea236;
453
  }
454
 
455
+ .wc-shortcodes-button.wc-shortcodes-button-warning:hover {
 
456
  color: #ffffff;
457
  background-color: #ed9c28;
458
  border-color: #d58512;
466
  border: 1px solid #d43f3a;
467
  }
468
 
469
+ .wc-shortcodes-button.wc-shortcodes-button-danger:hover {
 
470
  color: #ffffff;
471
  background-color: #d2322d;
472
  border-color: #ac2925;
480
  border: 1px solid #46b8da;
481
  }
482
 
483
+ .wc-shortcodes-button.wc-shortcodes-button-info:hover {
 
484
  color: #ffffff;
485
  background-color: #39b3d7;
486
  border-color: #269abc;
972
  * jQuery Countdown styles 1.6.3.
973
  * ----------------------------------------------------------------------------
974
  */
975
+ .wc-shortcodes-countdown-bg4 {
976
+ margin-bottom: 20px;
977
+ }
978
+ .wc-shortcodes-countdown {
979
  border: 1px solid #ccc;
980
  background-color: #eee;
981
  text-align: center;
 
982
  padding-top: 10px;
983
  padding-bottom: 10px;
984
  }
1020
  font-size: 80%;
1021
  text-align: center;
1022
  border-right: 1px solid #cccccc;
 
1023
  }
1024
  .wc-shortcodes-countdown .countdown_row *:last-child,
1025
+ .wc-shortcodes-countdown .countdown_row:last-child {
1026
+ border-width: 0;
1027
  }
1028
  .wc-shortcodes-countdown .countdown_amount {
1029
  font-size: 200%;
1035
  .wc-shortcodes-countdown .countdown_expired_message {
1036
  font-size: 200%;
1037
  }
1038
+
1039
+
1040
+ /**
1041
+ * [wc_rsvp]
1042
+ * ----------------------------------------------------------------------------
1043
+ */
1044
+ .wc-shortcodes-rsvp input[type="text"],
1045
+ .wc-shortcodes-rsvp textarea,
1046
+ .wc-shortcodes-rsvp select {
1047
+ width: 100%;
1048
+ }
1049
+ .wc-shortcodes-rsvp-align-center {
1050
+ text-align: center;
1051
+ }
1052
+ .wc-shortcodes-rsvp-align-right {
1053
+ text-align: right;
1054
+ }
1055
+ .rsvp-button-align-center .rsvp-button-wrapper {
1056
+ text-align: center;
1057
+ }
1058
+ .rsvp-button-align-center .wc-shortcodes-box {
1059
+ text-align: center;
1060
+ }
1061
+ .rsvp-button-align-right .rsvp-button-wrapper {
1062
+ text-align: right;
1063
+ }
1064
+ .rsvp-button-align-right .wc-shortcodes-box {
1065
+ text-align: right;
1066
+ }
1067
+ .rsvp-button-align-left .rsvp-button-wrapper {
1068
+ text-align: left;
1069
+ }
1070
+ .rsvp-button-align-left .wc-shortcodes-box {
1071
+ text-align: left;
1072
+ }
1073
+ .wc-shortcodes-rsvp .wc-shortcodes-box {
1074
+ padding-top: 5px;
1075
+ padding-bottom: 5px;
1076
+ display: none;
1077
+ }
includes/functions.php CHANGED
@@ -20,3 +20,113 @@ function wc_shortcodes_smart_social_link( $social_link, $name ) {
20
  return $social_link;
21
  }
22
  add_filter( 'wc_shortcodes_social_link' , 'wc_shortcodes_smart_social_link', 10, 2 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  return $social_link;
21
  }
22
  add_filter( 'wc_shortcodes_social_link' , 'wc_shortcodes_smart_social_link', 10, 2 );
23
+
24
+ /*
25
+ * On New Version
26
+ */
27
+ function wc_shortcodes_options_activation() {
28
+ global $wc_shortcodes_options;
29
+
30
+ $initialize = false;
31
+
32
+ if ( ! WC_SHORTCODES_CURRENT_VERSION ) {
33
+ $initialize = true;
34
+ }
35
+ else if ( version_compare( WC_SHORTCODES_VERSION, WC_SHORTCODES_CURRENT_VERSION ) > 0 ) {
36
+ $initialize = true;
37
+ }
38
+
39
+ if ( $initialize ) {
40
+ update_option( WC_SHORTCODES_PREFIX . 'current_version', WC_SHORTCODES_VERSION );
41
+ foreach ( $wc_shortcodes_options as $o ) {
42
+ foreach ( $o['sections'] as $oo ) {
43
+ foreach ( $oo['options'] as $ooo ) {
44
+ $option_name = WC_SHORTCODES_PREFIX . $ooo['id'];
45
+ add_option( $option_name, $ooo['default'] );
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ add_action( 'admin_init', 'wc_shortcodes_options_activation' );
52
+
53
+
54
+ /**
55
+ * webpm_send_email
56
+ *
57
+ * Ajax function to send email without
58
+ * reloading the page.
59
+ *
60
+ * @access public
61
+ * @return void
62
+ */
63
+ function wc_shortcodes_send_rsvp_email() {
64
+ // get the submitted parameters
65
+ $error = array();
66
+ $emailSent = false;
67
+ $message = array();
68
+
69
+ $email_to = get_option( WC_SHORTCODES_PREFIX . 'rsvp_email');
70
+ $email_title = trim( get_option( WC_SHORTCODES_PREFIX . 'rsvp_email_title') );
71
+ $email_success_message = trim( get_option( WC_SHORTCODES_PREFIX . 'rsvp_success_message') );
72
+ $email_success_message = empty( $email_success_message ) ? 'Message Sent' : $email_success_message;
73
+
74
+ $admin_email = get_option('admin_email');
75
+ if ( empty( $email_to ) ) {
76
+ $email_to = $admin_email;
77
+ }
78
+
79
+ $rsvp_name = trim( $_POST['rsvp_name'] );
80
+ if ( $rsvp_name === '') {
81
+ $error[] = 'Please enter your name.';
82
+ $hasError = true;
83
+ } else {
84
+ $message[] = 'Name: ' . esc_html( $rsvp_name );
85
+ }
86
+
87
+ $rsvp_number = trim( $_POST['rsvp_number'] );
88
+ if ( $rsvp_number === '') {
89
+ $error[] = 'Please select a number.';
90
+ $hasError = true;
91
+ } else {
92
+ $message[] = 'Number: ' . esc_html( $rsvp_number );
93
+ }
94
+
95
+ $rsvp_event = trim( $_POST['rsvp_event'] );
96
+ if ( $rsvp_event === '') {
97
+ $error[] = 'Please select event.';
98
+ $hasError = true;
99
+ } else {
100
+ $message[] = 'Event: ' . esc_html( $rsvp_event );
101
+ }
102
+
103
+ $status = trim(implode("<br />", $error));
104
+
105
+ if ( empty( $error ) ) {
106
+ $subject = $email_title;
107
+ $name = $rsvp_name;
108
+ $body = implode( "\n\n", $message );
109
+ $body .= "\n\n\n\nThis message was sent through the contact form via ".get_bloginfo('url');
110
+ $headers = "From: " . $admin_email . "\r\n";
111
+
112
+ wp_mail($email_to, $subject, $body, $headers);
113
+ $emailSent = true;
114
+ $status = $email_success_message;
115
+ }
116
+
117
+ // generate the response
118
+ $response = json_encode( array( 'success' => (int) $emailSent, 'message' => $status ) );
119
+
120
+ // response output
121
+ header( "Content-Type: application/json" );
122
+ echo $response;
123
+
124
+ // IMPORTANT: don't forget to "exit"
125
+ exit;
126
+ }
127
+ // send email when logged out
128
+ add_action( 'wp_ajax_nopriv_wc-send-rsvp-email', 'wc_shortcodes_send_rsvp_email' );
129
+ // send email when logged in
130
+ add_action( 'wp_ajax_wc-send-rsvp-email', 'wc_shortcodes_send_rsvp_email' );
131
+
132
+
includes/js/rsvp.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( $ ) {
2
+ "use strict";
3
+
4
+ $(document).ready(function() {
5
+
6
+ $('.wc-shortcodes-rsvp').each( function() {
7
+ var $this;
8
+
9
+ $this = $(this);
10
+
11
+ $this.find('.rsvp-button').click( function() {
12
+ var $button = $(this);
13
+ var data = $this.find('.rsvp-data').serialize();
14
+ var $message = $this.find('.rsvp-message');
15
+ var $messageParent = $message.parent();
16
+ $message.text("Sending...");
17
+ $messageParent.removeClass('wc-shortcodes-box-warning wc-shortcodes-box-success').addClass('wc-shortcodes-box-info').show();
18
+
19
+ $.post(
20
+ WCShortcodes.ajaxurl,
21
+ data,
22
+ function( response ) {
23
+ if (response.success) {
24
+ $message.text(response.message);
25
+ $messageParent.removeClass('wc-shortcodes-box-warning wc-shortcodes-box-info').addClass('wc-shortcodes-box-success').show();
26
+ $button.hide();
27
+ }
28
+ else {
29
+ $message.text(response.message);
30
+ $messageParent.removeClass('wc-shortcodes-box-success wc-shortcodes-box-info').addClass('wc-shortcodes-box-warning').show();
31
+ }
32
+ }
33
+ );
34
+ });
35
+ });
36
+
37
+ });
38
+ } )( jQuery );
includes/mce/js/shortcodes_tinymce.js CHANGED
@@ -50,6 +50,7 @@
50
  a.render( c, "Social Icon", "social" );
51
  a.render( c, "Testimonial", "testimonial" );
52
  a.render( c, "Countdown", "countdown" );
 
53
  a.render( c, "HTML", "html" );
54
 
55
  b.addSeparator();
@@ -325,6 +326,13 @@
325
 
326
 
327
 
 
 
 
 
 
 
 
328
  //Countdown
329
  if(id === "countdown") {
330
  var d = new Date();
@@ -333,7 +341,6 @@
333
  }
334
 
335
 
336
-
337
  //Toggle
338
  if(id === "toggle") {
339
  tinyMCE.activeEditor.selection.setContent('<p>[wc_toggle title="This Is Your Toggle Title" padding="" border_width=""]</p>' + wcParagraphContent + '<p>[/wc_toggle]</p>');
50
  a.render( c, "Social Icon", "social" );
51
  a.render( c, "Testimonial", "testimonial" );
52
  a.render( c, "Countdown", "countdown" );
53
+ a.render( c, "RSVP", "rsvp" );
54
  a.render( c, "HTML", "html" );
55
 
56
  b.addSeparator();
326
 
327
 
328
 
329
+ //RSVP
330
+ if(id === "rsvp") {
331
+ tinyMCE.activeEditor.selection.setContent('[wc_rsvp columns="3" align="left" button_align="center"]');
332
+ }
333
+
334
+
335
+
336
  //Countdown
337
  if(id === "countdown") {
338
  var d = new Date();
341
  }
342
 
343
 
 
344
  //Toggle
345
  if(id === "toggle") {
346
  tinyMCE.activeEditor.selection.setContent('<p>[wc_toggle title="This Is Your Toggle Title" padding="" border_width=""]</p>' + wcParagraphContent + '<p>[/wc_toggle]</p>');
includes/options.php CHANGED
@@ -1,305 +1,406 @@
1
  <?php
2
- $wc_shortcodes_options = array(
3
- 'social-media' => array(
4
- 'title' => 'Social Media',
5
- 'sections' => array(
6
- array(
7
- 'section' => 'wc-shortcodes-options-facebook-section',
8
- 'title' => 'Facebook',
9
- 'options' => array(
10
- array(
11
- 'id' => 'facebook_link',
12
- 'title' => 'Link',
13
- 'default' => '',
14
- 'description' => '',
15
- 'type' => 'input',
16
- ),
17
- array(
18
- 'id' => 'facebook_icon',
19
- 'title' => 'Icon',
20
- 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/facebook.png',
21
- 'description' => '',
22
- 'type' => 'image',
23
- ),
24
  ),
25
  ),
26
- array(
27
- 'section' => 'wc-shortcodes-options-twitter-section',
28
- 'title' => 'Twitter',
29
- 'options' => array(
30
- array(
31
- 'id' => 'twitter_link',
32
- 'title' => 'Link',
33
- 'default' => '',
34
- 'description' => '',
35
- 'type' => 'input',
36
- ),
37
- array(
38
- 'id' => 'twitter_icon',
39
- 'title' => 'Icon',
40
- 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/twitter.png',
41
- 'description' => '',
42
- 'type' => 'image',
43
- ),
44
  ),
45
  ),
46
- array(
47
- 'section' => 'wc-shortcodes-options-pinterest-section',
48
- 'title' => 'Pinterest',
49
- 'options' => array(
50
- array(
51
- 'id' => 'pinterest_link',
52
- 'title' => 'Link',
53
- 'default' => '',
54
- 'description' => '',
55
- 'type' => 'input',
56
- ),
57
- array(
58
- 'id' => 'pinterest_icon',
59
- 'title' => 'Icon',
60
- 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/pinterest.png',
61
- 'description' => '',
62
- 'type' => 'image',
63
- ),
64
  ),
65
  ),
66
- array(
67
- 'section' => 'wc-shortcodes-options-google-section',
68
- 'title' => 'Google',
69
- 'options' => array(
70
- array(
71
- 'id' => 'google_link',
72
- 'title' => 'Link',
73
- 'default' => '',
74
- 'description' => '',
75
- 'type' => 'input',
76
- ),
77
- array(
78
- 'id' => 'google_icon',
79
- 'title' => 'Icon',
80
- 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/google.png',
81
- 'description' => '',
82
- 'type' => 'image',
83
- ),
84
  ),
85
  ),
86
- array(
87
- 'section' => 'wc-shortcodes-options-bloglovin-section',
88
- 'title' => 'BlogLovin',
89
- 'options' => array(
90
- array(
91
- 'id' => 'bloglovin_link',
92
- 'title' => 'Link',
93
- 'default' => '',
94
- 'description' => '',
95
- 'type' => 'input',
96
- ),
97
- array(
98
- 'id' => 'bloglovin_icon',
99
- 'title' => 'Icon',
100
- 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/bloglovin.png',
101
- 'description' => '',
102
- 'type' => 'image',
103
- ),
104
  ),
105
  ),
106
- array(
107
- 'section' => 'wc-shortcodes-options-email-section',
108
- 'title' => 'Email',
109
- 'options' => array(
110
- array(
111
- 'id' => 'email_link',
112
- 'title' => 'Link',
113
- 'default' => '',
114
- 'description' => '',
115
- 'type' => 'input',
116
- ),
117
- array(
118
- 'id' => 'email_icon',
119
- 'title' => 'Icon',
120
- 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/email.png',
121
- 'description' => '',
122
- 'type' => 'image',
123
- ),
124
  ),
125
  ),
126
- array(
127
- 'section' => 'wc-shortcodes-options-flickr-section',
128
- 'title' => 'Flickr',
129
- 'options' => array(
130
- array(
131
- 'id' => 'flickr_link',
132
- 'title' => 'Link',
133
- 'default' => '',
134
- 'description' => '',
135
- 'type' => 'input',
136
- ),
137
- array(
138
- 'id' => 'flickr_icon',
139
- 'title' => 'Icon',
140
- 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/flickr.png',
141
- 'description' => '',
142
- 'type' => 'image',
143
- ),
144
  ),
145
  ),
146
- array(
147
- 'section' => 'wc-shortcodes-options-instagram-section',
148
- 'title' => 'Instagram',
149
- 'options' => array(
150
- array(
151
- 'id' => 'instagram_link',
152
- 'title' => 'Link',
153
- 'default' => '',
154
- 'description' => '',
155
- 'type' => 'input',
156
- ),
157
- array(
158
- 'id' => 'instagram_icon',
159
- 'title' => 'Icon',
160
- 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/instagram.png',
161
- 'description' => '',
162
- 'type' => 'image',
163
- ),
164
  ),
165
  ),
166
- array(
167
- 'section' => 'wc-shortcodes-options-rss-section',
168
- 'title' => 'Rss',
169
- 'options' => array(
170
- array(
171
- 'id' => 'rss_link',
172
- 'title' => 'Link',
173
- 'default' => '',
174
- 'description' => '',
175
- 'type' => 'input',
176
- ),
177
- array(
178
- 'id' => 'rss_icon',
179
- 'title' => 'Icon',
180
- 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/rss.png',
181
- 'description' => '',
182
- 'type' => 'image',
183
- ),
184
  ),
185
  ),
186
- array(
187
- 'section' => 'wc-shortcodes-options-custom1-section',
188
- 'title' => 'Custom 1',
189
- 'options' => array(
190
- array(
191
- 'id' => 'custom1_link',
192
- 'title' => 'Link',
193
- 'default' => '',
194
- 'description' => '',
195
- 'type' => 'input',
196
- ),
197
- array(
198
- 'id' => 'custom1_icon',
199
- 'title' => 'Icon',
200
- 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/picasa.png',
201
- 'description' => '',
202
- 'type' => 'image',
203
- ),
204
  ),
205
  ),
206
- array(
207
- 'section' => 'wc-shortcodes-options-custom2-section',
208
- 'title' => 'Custom 2',
209
- 'options' => array(
210
- array(
211
- 'id' => 'custom2_link',
212
- 'title' => 'Link',
213
- 'default' => '',
214
- 'description' => '',
215
- 'type' => 'input',
216
- ),
217
- array(
218
- 'id' => 'custom2_icon',
219
- 'title' => 'Icon',
220
- 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/shopping.png',
221
- 'description' => '',
222
- 'type' => 'image',
223
- ),
224
  ),
225
  ),
226
- array(
227
- 'section' => 'wc-shortcodes-options-custom3-section',
228
- 'title' => 'Custom 3',
229
- 'options' => array(
230
- array(
231
- 'id' => 'custom3_link',
232
- 'title' => 'Link',
233
- 'default' => '',
234
- 'description' => '',
235
- 'type' => 'input',
236
- ),
237
- array(
238
- 'id' => 'custom3_icon',
239
- 'title' => 'Icon',
240
- 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/youtube.png',
241
- 'description' => '',
242
- 'type' => 'image',
243
- ),
244
  ),
245
  ),
246
- array(
247
- 'section' => 'wc-shortcodes-options-custom4-section',
248
- 'title' => 'Custom 4',
249
- 'options' => array(
250
- array(
251
- 'id' => 'custom4_link',
252
- 'title' => 'Link',
253
- 'default' => '',
254
- 'description' => '',
255
- 'type' => 'input',
256
- ),
257
- array(
258
- 'id' => 'custom4_icon',
259
- 'title' => 'Icon',
260
- 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/etsy.png',
261
- 'description' => '',
262
- 'type' => 'image',
263
- ),
264
  ),
265
  ),
266
- array(
267
- 'section' => 'wc-shortcodes-options-custom5-section',
268
- 'title' => 'Custom 5',
269
- 'options' => array(
270
- array(
271
- 'id' => 'custom5_link',
272
- 'title' => 'Link',
273
- 'default' => '',
274
- 'description' => '',
275
- 'type' => 'input',
276
- ),
277
- array(
278
- 'id' => 'custom5_icon',
279
- 'title' => 'Icon',
280
- 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/tumblr.png',
281
- 'description' => '',
282
- 'type' => 'image',
283
- ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  ),
285
  ),
286
  ),
287
  ),
288
- 'misc' => array(
289
- 'title' => 'Misc',
290
- 'sections' => array(
291
- array(
292
- 'section' => 'wc-shortcodes-options-facebook-section',
293
- 'title' => 'Miscellaneous Options',
294
- 'options' => array(
295
- array(
296
- 'id' => 'enable_shortcode_css',
297
- 'title' => 'Shortcode CSS',
298
- 'default' => '1',
299
- 'description' => '',
300
- 'label' => 'Use shortcode CSS provided by plugin',
301
- 'type' => 'checkbox',
302
- ),
303
  ),
304
  ),
305
  ),
1
  <?php
2
+ $wc_shortcodes_options = array();
3
+ $wc_shortcodes_options['social-media'] = array(
4
+ 'title' => 'Social Media',
5
+ 'sections' => array(
6
+ array(
7
+ 'section' => 'wc-shortcodes-options-facebook-section',
8
+ 'title' => 'Facebook',
9
+ 'options' => array(
10
+ array(
11
+ 'id' => 'facebook_link',
12
+ 'title' => 'Link',
13
+ 'default' => '',
14
+ 'description' => '',
15
+ 'type' => 'input',
16
+ ),
17
+ array(
18
+ 'id' => 'facebook_icon',
19
+ 'title' => 'Icon',
20
+ 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/facebook.png',
21
+ 'description' => '',
22
+ 'type' => 'image',
 
23
  ),
24
  ),
25
+ ),
26
+ array(
27
+ 'section' => 'wc-shortcodes-options-twitter-section',
28
+ 'title' => 'Twitter',
29
+ 'options' => array(
30
+ array(
31
+ 'id' => 'twitter_link',
32
+ 'title' => 'Link',
33
+ 'default' => '',
34
+ 'description' => '',
35
+ 'type' => 'input',
36
+ ),
37
+ array(
38
+ 'id' => 'twitter_icon',
39
+ 'title' => 'Icon',
40
+ 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/twitter.png',
41
+ 'description' => '',
42
+ 'type' => 'image',
43
  ),
44
  ),
45
+ ),
46
+ array(
47
+ 'section' => 'wc-shortcodes-options-pinterest-section',
48
+ 'title' => 'Pinterest',
49
+ 'options' => array(
50
+ array(
51
+ 'id' => 'pinterest_link',
52
+ 'title' => 'Link',
53
+ 'default' => '',
54
+ 'description' => '',
55
+ 'type' => 'input',
56
+ ),
57
+ array(
58
+ 'id' => 'pinterest_icon',
59
+ 'title' => 'Icon',
60
+ 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/pinterest.png',
61
+ 'description' => '',
62
+ 'type' => 'image',
63
  ),
64
  ),
65
+ ),
66
+ array(
67
+ 'section' => 'wc-shortcodes-options-google-section',
68
+ 'title' => 'Google',
69
+ 'options' => array(
70
+ array(
71
+ 'id' => 'google_link',
72
+ 'title' => 'Link',
73
+ 'default' => '',
74
+ 'description' => '',
75
+ 'type' => 'input',
76
+ ),
77
+ array(
78
+ 'id' => 'google_icon',
79
+ 'title' => 'Icon',
80
+ 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/google.png',
81
+ 'description' => '',
82
+ 'type' => 'image',
83
  ),
84
  ),
85
+ ),
86
+ array(
87
+ 'section' => 'wc-shortcodes-options-bloglovin-section',
88
+ 'title' => 'BlogLovin',
89
+ 'options' => array(
90
+ array(
91
+ 'id' => 'bloglovin_link',
92
+ 'title' => 'Link',
93
+ 'default' => '',
94
+ 'description' => '',
95
+ 'type' => 'input',
96
+ ),
97
+ array(
98
+ 'id' => 'bloglovin_icon',
99
+ 'title' => 'Icon',
100
+ 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/bloglovin.png',
101
+ 'description' => '',
102
+ 'type' => 'image',
103
  ),
104
  ),
105
+ ),
106
+ array(
107
+ 'section' => 'wc-shortcodes-options-email-section',
108
+ 'title' => 'Email',
109
+ 'options' => array(
110
+ array(
111
+ 'id' => 'email_link',
112
+ 'title' => 'Link',
113
+ 'default' => '',
114
+ 'description' => '',
115
+ 'type' => 'input',
116
+ ),
117
+ array(
118
+ 'id' => 'email_icon',
119
+ 'title' => 'Icon',
120
+ 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/email.png',
121
+ 'description' => '',
122
+ 'type' => 'image',
123
  ),
124
  ),
125
+ ),
126
+ array(
127
+ 'section' => 'wc-shortcodes-options-flickr-section',
128
+ 'title' => 'Flickr',
129
+ 'options' => array(
130
+ array(
131
+ 'id' => 'flickr_link',
132
+ 'title' => 'Link',
133
+ 'default' => '',
134
+ 'description' => '',
135
+ 'type' => 'input',
136
+ ),
137
+ array(
138
+ 'id' => 'flickr_icon',
139
+ 'title' => 'Icon',
140
+ 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/flickr.png',
141
+ 'description' => '',
142
+ 'type' => 'image',
143
  ),
144
  ),
145
+ ),
146
+ array(
147
+ 'section' => 'wc-shortcodes-options-instagram-section',
148
+ 'title' => 'Instagram',
149
+ 'options' => array(
150
+ array(
151
+ 'id' => 'instagram_link',
152
+ 'title' => 'Link',
153
+ 'default' => '',
154
+ 'description' => '',
155
+ 'type' => 'input',
156
+ ),
157
+ array(
158
+ 'id' => 'instagram_icon',
159
+ 'title' => 'Icon',
160
+ 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/instagram.png',
161
+ 'description' => '',
162
+ 'type' => 'image',
163
  ),
164
  ),
165
+ ),
166
+ array(
167
+ 'section' => 'wc-shortcodes-options-rss-section',
168
+ 'title' => 'Rss',
169
+ 'options' => array(
170
+ array(
171
+ 'id' => 'rss_link',
172
+ 'title' => 'Link',
173
+ 'default' => '',
174
+ 'description' => '',
175
+ 'type' => 'input',
176
+ ),
177
+ array(
178
+ 'id' => 'rss_icon',
179
+ 'title' => 'Icon',
180
+ 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/rss.png',
181
+ 'description' => '',
182
+ 'type' => 'image',
183
  ),
184
  ),
185
+ ),
186
+ array(
187
+ 'section' => 'wc-shortcodes-options-custom1-section',
188
+ 'title' => 'Custom 1',
189
+ 'options' => array(
190
+ array(
191
+ 'id' => 'custom1_link',
192
+ 'title' => 'Link',
193
+ 'default' => '',
194
+ 'description' => '',
195
+ 'type' => 'input',
196
+ ),
197
+ array(
198
+ 'id' => 'custom1_icon',
199
+ 'title' => 'Icon',
200
+ 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/picasa.png',
201
+ 'description' => '',
202
+ 'type' => 'image',
203
  ),
204
  ),
205
+ ),
206
+ array(
207
+ 'section' => 'wc-shortcodes-options-custom2-section',
208
+ 'title' => 'Custom 2',
209
+ 'options' => array(
210
+ array(
211
+ 'id' => 'custom2_link',
212
+ 'title' => 'Link',
213
+ 'default' => '',
214
+ 'description' => '',
215
+ 'type' => 'input',
216
+ ),
217
+ array(
218
+ 'id' => 'custom2_icon',
219
+ 'title' => 'Icon',
220
+ 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/shopping.png',
221
+ 'description' => '',
222
+ 'type' => 'image',
223
  ),
224
  ),
225
+ ),
226
+ array(
227
+ 'section' => 'wc-shortcodes-options-custom3-section',
228
+ 'title' => 'Custom 3',
229
+ 'options' => array(
230
+ array(
231
+ 'id' => 'custom3_link',
232
+ 'title' => 'Link',
233
+ 'default' => '',
234
+ 'description' => '',
235
+ 'type' => 'input',
236
+ ),
237
+ array(
238
+ 'id' => 'custom3_icon',
239
+ 'title' => 'Icon',
240
+ 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/youtube.png',
241
+ 'description' => '',
242
+ 'type' => 'image',
243
  ),
244
  ),
245
+ ),
246
+ array(
247
+ 'section' => 'wc-shortcodes-options-custom4-section',
248
+ 'title' => 'Custom 4',
249
+ 'options' => array(
250
+ array(
251
+ 'id' => 'custom4_link',
252
+ 'title' => 'Link',
253
+ 'default' => '',
254
+ 'description' => '',
255
+ 'type' => 'input',
256
+ ),
257
+ array(
258
+ 'id' => 'custom4_icon',
259
+ 'title' => 'Icon',
260
+ 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/etsy.png',
261
+ 'description' => '',
262
+ 'type' => 'image',
263
  ),
264
  ),
265
+ ),
266
+ array(
267
+ 'section' => 'wc-shortcodes-options-custom5-section',
268
+ 'title' => 'Custom 5',
269
+ 'options' => array(
270
+ array(
271
+ 'id' => 'custom5_link',
272
+ 'title' => 'Link',
273
+ 'default' => '',
274
+ 'description' => '',
275
+ 'type' => 'input',
276
+ ),
277
+ array(
278
+ 'id' => 'custom5_icon',
279
+ 'title' => 'Icon',
280
+ 'default' => WC_SHORTCODES_PLUGIN_URL . 'includes/img/tumblr.png',
281
+ 'description' => '',
282
+ 'type' => 'image',
283
+ ),
284
+ ),
285
+ ),
286
+ ),
287
+ );
288
+ $number_options = "1\n2\n3\n4\n5";
289
+ $event_options = "All Events\nMain Ceremony\nWedding Party";
290
+ $admin_email = get_option( 'admin_email' );
291
+
292
+ $wc_shortcodes_options['rsvp'] = array(
293
+ 'title' => 'RSVP',
294
+ 'sections' => array(
295
+ array(
296
+ 'section' => 'wc-shortcodes-options-rsvp-section',
297
+ 'title' => 'RSVP',
298
+ 'options' => array(
299
+ array(
300
+ 'id' => 'rsvp_email',
301
+ 'title' => 'Email To',
302
+ 'default' => $admin_email,
303
+ 'description' => 'Send RSVP notification to the email address above. Separate multiple emails with a comma.',
304
+ 'type' => 'email',
305
+ ),
306
+ array(
307
+ 'id' => 'rsvp_email_title',
308
+ 'title' => 'Email Title',
309
+ 'default' => 'New RSVP - ' .get_bloginfo('title'),
310
+ 'description' => 'The subject tile of your email you will receive',
311
+ 'type' => 'input',
312
+ ),
313
+ array(
314
+ 'id' => 'rsvp_success_message',
315
+ 'title' => 'Success Message',
316
+ 'default' => 'Thanks for attending! We will see you at our wedding.',
317
+ 'description' => 'The message to display after a user successfully RSVP\'d',
318
+ 'type' => 'input',
319
+ ),
320
+ ),
321
+ ),
322
+ array(
323
+ 'section' => 'wc-shortcodes-options-rsvp-name-section',
324
+ 'title' => 'Name',
325
+ 'options' => array(
326
+ array(
327
+ 'id' => 'rsvp_name_title',
328
+ 'title' => 'Title',
329
+ 'default' => 'Your Name',
330
+ 'description' => '',
331
+ 'type' => 'input',
332
+ ),
333
+ ),
334
+ ),
335
+ array(
336
+ 'section' => 'wc-shortcodes-options-rsvp-number-section',
337
+ 'title' => 'Number',
338
+ 'options' => array(
339
+ array(
340
+ 'id' => 'rsvp_number_title',
341
+ 'title' => 'Title',
342
+ 'default' => 'Number of Guests',
343
+ 'description' => '',
344
+ 'type' => 'input',
345
+ ),
346
+ array(
347
+ 'id' => 'rsvp_number_options',
348
+ 'title' => 'Options',
349
+ 'default' => $number_options,
350
+ 'description' => '',
351
+ 'type' => 'textarea',
352
+ ),
353
+ ),
354
+ ),
355
+ array(
356
+ 'section' => 'wc-shortcodes-options-rsvp-event-section',
357
+ 'title' => 'Event',
358
+ 'options' => array(
359
+ array(
360
+ 'id' => 'rsvp_event_title',
361
+ 'title' => 'Title',
362
+ 'default' => 'You Will Attend...',
363
+ 'description' => '',
364
+ 'type' => 'input',
365
+ ),
366
+ array(
367
+ 'id' => 'rsvp_event_options',
368
+ 'title' => 'Options',
369
+ 'default' => $event_options,
370
+ 'description' => '',
371
+ 'type' => 'textarea',
372
+ ),
373
+ ),
374
+ ),
375
+ array(
376
+ 'section' => 'wc-shortcodes-options-rsvp-button-section',
377
+ 'title' => 'Button',
378
+ 'options' => array(
379
+ array(
380
+ 'id' => 'rsvp_button_title',
381
+ 'title' => 'Title',
382
+ 'default' => 'I Am Attending',
383
+ 'description' => '',
384
+ 'type' => 'input',
385
  ),
386
  ),
387
  ),
388
  ),
389
+ );
390
+ $wc_shortcodes_options['misc'] = array(
391
+ 'title' => 'Misc',
392
+ 'sections' => array(
393
+ array(
394
+ 'section' => 'wc-shortcodes-options-misc-section',
395
+ 'title' => 'Miscellaneous Options',
396
+ 'options' => array(
397
+ array(
398
+ 'id' => 'enable_shortcode_css',
399
+ 'title' => 'Shortcode CSS',
400
+ 'default' => '1',
401
+ 'description' => '',
402
+ 'label' => 'Use shortcode CSS provided by plugin',
403
+ 'type' => 'checkbox',
404
  ),
405
  ),
406
  ),
includes/scripts.php CHANGED
@@ -31,6 +31,16 @@ if( !function_exists ('wc_shortcodes_scripts') ) :
31
  // countdown
32
  wp_register_script( 'wc-shortcodes-jquery-countdown-js', plugin_dir_url( __FILE__ ) . 'js/jquery.countdown.js', array ( 'jquery' ), $ver, true );
33
  wp_register_script( 'wc-shortcodes-countdown', plugin_dir_url( __FILE__ ) . 'js/countdown.js', array ( 'wc-shortcodes-jquery-countdown-js' ), $ver, true );
 
 
 
 
 
 
 
 
 
 
34
  }
35
  add_action('wp_enqueue_scripts', 'wc_shortcodes_scripts');
36
  endif;
31
  // countdown
32
  wp_register_script( 'wc-shortcodes-jquery-countdown-js', plugin_dir_url( __FILE__ ) . 'js/jquery.countdown.js', array ( 'jquery' ), $ver, true );
33
  wp_register_script( 'wc-shortcodes-countdown', plugin_dir_url( __FILE__ ) . 'js/countdown.js', array ( 'wc-shortcodes-jquery-countdown-js' ), $ver, true );
34
+
35
+ // rsvp
36
+ wp_register_script( 'wc-shortcodes-rsvp', plugin_dir_url( __FILE__ ) . 'js/rsvp.js', array ( 'jquery' ), $ver, true );
37
+
38
+ $local = array(
39
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
40
+ );
41
+
42
+ wp_localize_script( 'wc-shortcodes-rsvp', 'WCShortcodes', $local );
43
+ wp_enqueue_script( 'wc-shortcodes-rsvp' );
44
  }
45
  add_action('wp_enqueue_scripts', 'wc_shortcodes_scripts');
46
  endif;
includes/settings.php CHANGED
@@ -111,6 +111,12 @@ function wc_shortcodes_options_display_setting( $args ) {
111
  case 'checkbox' :
112
  wc_shortcodes_options_display_checkbox_field( $args );
113
  break;
 
 
 
 
 
 
114
  default :
115
  wc_shortcodes_options_input_field( $args );
116
  break;
@@ -133,6 +139,22 @@ function wc_shortcodes_options_input_field( $args ) {
133
  <?php endif; ?>
134
  <?php
135
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  function wc_shortcodes_options_display_image_field( $args ) {
137
  extract( $args );
138
 
@@ -180,6 +202,23 @@ function wc_shortcodes_options_display_checkbox_field( $args ) {
180
  <?php
181
  }
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  /*
184
  * Sanitize Options
185
  */
@@ -191,6 +230,8 @@ function wc_shortcodes_options_find_sanitize_callback( $type ) {
191
  return 'esc_url_raw';
192
  case 'checkbox' :
193
  return 'wc_shortcodes_options_sanitize_checkbox';
 
 
194
  }
195
 
196
  return '';
@@ -213,6 +254,23 @@ function wc_shortcodes_options_sanitize_hex_color( $color ) {
213
  return null;
214
  }
215
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  /*
217
  * Misc
218
  */
@@ -226,19 +284,3 @@ function wc_shortcodes_remember_last_options_tab() {
226
  }
227
  }
228
  add_action( 'admin_init', 'wc_shortcodes_remember_last_options_tab' );
229
-
230
- /*
231
- * On Activation
232
- */
233
- function wc_shortcodes_options_activation_hook() {
234
- global $wc_shortcodes_options;
235
-
236
- foreach ( $wc_shortcodes_options as $o ) {
237
- foreach ( $o['sections'] as $oo ) {
238
- foreach ( $oo['options'] as $ooo ) {
239
- $option_name = WC_SHORTCODES_PREFIX . $ooo['id'];
240
- add_option( $option_name, $ooo['default'] );
241
- }
242
- }
243
- }
244
- }
111
  case 'checkbox' :
112
  wc_shortcodes_options_display_checkbox_field( $args );
113
  break;
114
+ case 'textarea' :
115
+ wc_shortcodes_options_display_textarea_field( $args );
116
+ break;
117
+ case 'email' :
118
+ wc_shortcodes_options_email_field( $args );
119
+ break;
120
  default :
121
  wc_shortcodes_options_input_field( $args );
122
  break;
139
  <?php endif; ?>
140
  <?php
141
  }
142
+ function wc_shortcodes_options_email_field( $args ) {
143
+ extract( $args );
144
+
145
+ $val = get_option( $option_name, $default );
146
+ ?>
147
+
148
+ <?php if ( isset( $label ) ) : ?>
149
+ <label for="<?php echo esc_attr($option_name); ?>"><?php echo $label; ?></label>&nbsp;
150
+ <?php endif; ?>
151
+
152
+ <input name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>" type="text" value="<?php echo esc_attr($val); ?>" class="regular-text" />
153
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
154
+ <p class="description"><?php echo $description; ?></p>
155
+ <?php endif; ?>
156
+ <?php
157
+ }
158
  function wc_shortcodes_options_display_image_field( $args ) {
159
  extract( $args );
160
 
202
  <?php
203
  }
204
 
205
+ function wc_shortcodes_options_display_textarea_field( $args ) {
206
+ extract( $args );
207
+
208
+ $val = get_option( $option_name, $default );
209
+ ?>
210
+
211
+ <?php if ( isset( $label ) ) : ?>
212
+ <label for="<?php echo esc_attr($option_name); ?>"><?php echo $label; ?></label>&nbsp;
213
+ <?php endif; ?>
214
+
215
+ <textarea name="<?php echo $option_name; ?>" class="wc-shortcodes-textarea" id="<?php echo $option_name; ?>"><?php echo esc_textarea($val); ?></textarea>
216
+ <?php if ( isset( $description ) && !empty( $description ) ) : ?>
217
+ <p class="description"><?php echo $description; ?></p>
218
+ <?php endif; ?>
219
+ <?php
220
+ }
221
+
222
  /*
223
  * Sanitize Options
224
  */
230
  return 'esc_url_raw';
231
  case 'checkbox' :
232
  return 'wc_shortcodes_options_sanitize_checkbox';
233
+ case 'email' :
234
+ return 'wc_shortcodes_options_sanitize_email';
235
  }
236
 
237
  return '';
254
  return null;
255
  }
256
 
257
+ function wc_shortcodes_options_sanitize_email( $email ) {
258
+ $valid = array();
259
+
260
+ $email = explode( ',', $email );
261
+
262
+ foreach ( $email as $e ) {
263
+ $e = trim( $e );
264
+ if ( is_email( $e ) )
265
+ $valid[] = $e;
266
+ }
267
+
268
+ if ( ! empty( $valid ) )
269
+ return implode( ',', $valid );
270
+
271
+ return null;
272
+ }
273
+
274
  /*
275
  * Misc
276
  */
284
  }
285
  }
286
  add_action( 'admin_init', 'wc_shortcodes_remember_last_options_tab' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/shortcode-functions.php CHANGED
@@ -894,3 +894,86 @@ if( !function_exists('wc_shortcodes_countdown') ) {
894
  }
895
  add_shortcode( 'wc_countdown', 'wc_shortcodes_countdown' );
896
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
894
  }
895
  add_shortcode( 'wc_countdown', 'wc_shortcodes_countdown' );
896
  }
897
+
898
+
899
+
900
+ if( !function_exists('wc_shortcodes_rsvp') ) {
901
+ function wc_shortcodes_rsvp( $atts ) {
902
+ extract( shortcode_atts( array(
903
+ 'columns' => '3',
904
+ 'align' => 'left',
905
+ 'button_align' => 'center',
906
+ ), $atts ) );
907
+
908
+ wp_enqueue_script('wc-shortcodes-rsvp');
909
+
910
+ $columns = (int) $columns;
911
+ $columns = 3 == $columns ? $columns : 1;
912
+
913
+ $html = '';
914
+
915
+ // RSVP Name
916
+ $name_title = get_option( WC_SHORTCODES_PREFIX . 'rsvp_name_title' );
917
+ $name_html = '<p class="rsvp-name-wrapper"><span>'.esc_html($name_title).'</span><br /><input name="rsvp_name" class="rsvp-name rsvp-data" type="text" value="" /></p>';
918
+
919
+ // RSVP Number
920
+ $number_title = get_option( WC_SHORTCODES_PREFIX . 'rsvp_number_title' );
921
+ $number_options = get_option( WC_SHORTCODES_PREFIX . 'rsvp_number_options' );
922
+ $number_options = explode( "\n", $number_options );
923
+ $options = '';
924
+ foreach ( $number_options as $o ) {
925
+ $o = trim( $o );
926
+ if ( empty( $o ) )
927
+ continue;
928
+
929
+ $options .= '<option value="'.esc_attr( $o ).'">'.esc_html( $o ).'</option>';
930
+ }
931
+ $options = '<select name="rsvp_number" class="rsvp-number rsvp-data">'.$options.'</select>';
932
+ $number_html = '<p class="rsvp-number-wrapper"><span>'.esc_html( $number_title ).'</span><br />'.$options.'</p>';
933
+
934
+ // RSVP Event
935
+ $event_title = get_option( WC_SHORTCODES_PREFIX . 'rsvp_event_title' );
936
+ $event_options = get_option( WC_SHORTCODES_PREFIX . 'rsvp_event_options' );
937
+ $event_options = explode( "\n", $event_options );
938
+ $options = '';
939
+ foreach ( $event_options as $o ) {
940
+ $o = trim( $o );
941
+ if ( empty( $o ) )
942
+ continue;
943
+
944
+ $options .= '<option value="'.esc_attr( $o ).'">'.esc_html( $o ).'</option>';
945
+ }
946
+ $options = '<select name="rsvp_event" class="rsvp-event rsvp-data">'.$options.'</select>';
947
+ $event_html = '<p class="rsvp-event-options"><span>'.esc_html( $event_title ).'</span><br />'.$options.'</p>';
948
+
949
+ // RSVP Button
950
+ $button_title = get_option( WC_SHORTCODES_PREFIX . 'rsvp_button_title' );
951
+ $button_html = '<p class="rsvp-button-wrapper"><input name="rsvp_button" class="rsvp-button" type="button" value="'.esc_attr( $button_title ).'" /></p>';
952
+
953
+ // RSVP Action
954
+ $action_html = '<input name="action" class="rsvp-action rsvp-data" type="hidden" value="wc-send-rsvp-email">';
955
+
956
+ // RSVP Message
957
+ $message_html = '<div class="wc-shortcodes-box wc-shortcodes-clearfix wc-shortcodes-box-info"><p class="rsvp-message">Hello</p></div>';
958
+
959
+ // Style
960
+
961
+ $html .= $action_html;
962
+
963
+ if ( 3 == $columns ) {
964
+ $html .= '<div class="wc-shortcodes-row wc-shortcodes-clearfix">';
965
+ $html .= ' <div class="wc-shortcodes-column wc-shortcodes-one-third wc-shortcodes-column-first ">'.$name_html.'</div>';
966
+ $html .= ' <div class="wc-shortcodes-column wc-shortcodes-one-third wc-shortcodes-column- ">'.$number_html.'</div>';
967
+ $html .= ' <div class="wc-shortcodes-column wc-shortcodes-one-third wc-shortcodes-column-last ">'.$event_html.'</div>';
968
+ $html .= '</div>';
969
+ $html .= $message_html;
970
+ $html .= $button_html;
971
+ }
972
+ else {
973
+ $html .= $name_html . $number_html . $event_html . $message_html . $button_html;
974
+ }
975
+
976
+ return '<div class="wc-shortcodes-rsvp wc-shortcodes-rsvp-columns-'.$columns.' wc-shortcodes-rsvp-align-'.esc_attr($align).' rsvp-button-align-'.esc_attr($button_align).'">' . do_shortcode( $html ) . '</div>';
977
+ }
978
+ add_shortcode( 'wc_rsvp', 'wc_shortcodes_rsvp' );
979
+ }
readme.txt CHANGED
@@ -44,6 +44,12 @@ Use the shortcode manager in the TinyMCE text editor
44
 
45
  == Changelog ==
46
 
 
 
 
 
 
 
47
  ### Version 1.12
48
 
49
  * cleaned up some code
44
 
45
  == Changelog ==
46
 
47
+ ### Version 1.13
48
+
49
+ * added rsvp shortcode
50
+ * removed focus css acting as hover
51
+ * minor css fix for countdown shortcode
52
+
53
  ### Version 1.12
54
 
55
  * cleaned up some code
wc-shortcodes.php CHANGED
@@ -5,23 +5,22 @@ Plugin URI: http://wordpresscanvas.com/features/shortcodes/
5
  Description: A family of shortcodes to enhance site functionality.
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
- Version: 1.12
9
  License: GPLv2 or later
10
  */
11
 
12
- define( 'WC_SHORTCODES_VERSION', '1.12' );
13
  define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
14
  define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
15
  define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
 
16
 
17
  global $wc_shortcodes_options;
18
 
19
- require_once( dirname(__FILE__) . '/includes/functions.php' ); // Adds basic filters and actions
20
  require_once( dirname(__FILE__) . '/includes/options.php' ); // define options array
 
21
  require_once( dirname(__FILE__) . '/includes/settings.php' ); // Adds settings
22
  require_once( dirname(__FILE__) . '/includes/scripts.php' ); // Adds plugin JS and CSS
23
  require_once( dirname(__FILE__) . '/includes/shortcode-functions.php'); // Main shortcode functions
24
  require_once( dirname(__FILE__) . '/includes/mce/shortcodes_tinymce.php'); // Add mce buttons to post editor
25
  require_once( dirname(__FILE__) . '/includes/widgets.php' ); // include any widgets
26
-
27
- register_activation_hook( __FILE__, 'wc_shortcodes_options_activation_hook' );
5
  Description: A family of shortcodes to enhance site functionality.
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
+ Version: 1.13
9
  License: GPLv2 or later
10
  */
11
 
12
+ define( 'WC_SHORTCODES_VERSION', '1.13' );
13
  define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
14
  define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
15
  define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
16
+ define( 'WC_SHORTCODES_CURRENT_VERSION', get_option( WC_SHORTCODES_PREFIX . 'current_version' ) );
17
 
18
  global $wc_shortcodes_options;
19
 
 
20
  require_once( dirname(__FILE__) . '/includes/options.php' ); // define options array
21
+ require_once( dirname(__FILE__) . '/includes/functions.php' ); // Adds basic filters and actions
22
  require_once( dirname(__FILE__) . '/includes/settings.php' ); // Adds settings
23
  require_once( dirname(__FILE__) . '/includes/scripts.php' ); // Adds plugin JS and CSS
24
  require_once( dirname(__FILE__) . '/includes/shortcode-functions.php'); // Main shortcode functions
25
  require_once( dirname(__FILE__) . '/includes/mce/shortcodes_tinymce.php'); // Add mce buttons to post editor
26
  require_once( dirname(__FILE__) . '/includes/widgets.php' ); // include any widgets