Version Description
Download this release
Release Info
| Developer | cbaldelomar |
| Plugin | |
| Version | 1.14 |
| Comparing to | |
| See all releases | |
Code changes from version 1.13 to 1.14
- README.md +6 -0
- includes/css/style.css +14 -0
- includes/functions.php +0 -2
- includes/img/dash-border.png +0 -0
- includes/img/rustic-border.png +0 -0
- includes/js/admin.js +3 -0
- includes/mce/js/shortcodes_tinymce.js +9 -1
- includes/options.php +1 -1
- includes/settings.php +203 -8
- includes/shortcode-functions.php +33 -25
- readme.txt +6 -0
- wc-shortcodes.php +2 -2
README.md
CHANGED
|
@@ -44,6 +44,12 @@ Use the shortcode manager in the TinyMCE text editor
|
|
| 44 |
|
| 45 |
## Changelog ##
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
### Version 1.13
|
| 48 |
|
| 49 |
* added rsvp shortcode
|
| 44 |
|
| 45 |
## Changelog ##
|
| 46 |
|
| 47 |
+
### Version 1.14
|
| 48 |
+
|
| 49 |
+
* Cleaned up code
|
| 50 |
+
* Added 2 more image dividers
|
| 51 |
+
* more support for different theme options
|
| 52 |
+
|
| 53 |
### Version 1.13
|
| 54 |
|
| 55 |
* added rsvp shortcode
|
includes/css/style.css
CHANGED
|
@@ -282,6 +282,20 @@
|
|
| 282 |
background: url("../img/circle-border.png") repeat-x center left scroll;
|
| 283 |
}
|
| 284 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 285 |
/* Single Solid Line */
|
| 286 |
.wc-shortcodes-divider.wc-shortcodes-divider-style-solid {
|
| 287 |
border: 0;
|
| 282 |
background: url("../img/circle-border.png") repeat-x center left scroll;
|
| 283 |
}
|
| 284 |
|
| 285 |
+
/* Image Line 2 */
|
| 286 |
+
.wc-shortcodes-divider.wc-shortcodes-divider-style-image2 {
|
| 287 |
+
border: 0;
|
| 288 |
+
height: 10px;
|
| 289 |
+
background: url("../img/dash-border.png") repeat-x center left scroll;
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
/* Image Line 3 */
|
| 293 |
+
.wc-shortcodes-divider.wc-shortcodes-divider-style-image3 {
|
| 294 |
+
border: 0;
|
| 295 |
+
height: 10px;
|
| 296 |
+
background: url("../img/rustic-border.png") repeat-x center left scroll;
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
/* Single Solid Line */
|
| 300 |
.wc-shortcodes-divider.wc-shortcodes-divider-style-solid {
|
| 301 |
border: 0;
|
includes/functions.php
CHANGED
|
@@ -128,5 +128,3 @@ function wc_shortcodes_send_rsvp_email() {
|
|
| 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 |
-
|
| 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' );
|
|
|
|
|
|
includes/img/dash-border.png
ADDED
|
Binary file
|
includes/img/rustic-border.png
ADDED
|
Binary file
|
includes/js/admin.js
CHANGED
|
@@ -170,6 +170,9 @@
|
|
| 170 |
if ( preview.length && options.restore.length ) {
|
| 171 |
$(preview).html('<img src="'+options.restore+'" />').show();
|
| 172 |
}
|
|
|
|
|
|
|
|
|
|
| 173 |
})
|
| 174 |
.on('click', '.wc-shortcodes-delete-image', function( e ) {
|
| 175 |
e.preventDefault();
|
| 170 |
if ( preview.length && options.restore.length ) {
|
| 171 |
$(preview).html('<img src="'+options.restore+'" />').show();
|
| 172 |
}
|
| 173 |
+
else {
|
| 174 |
+
$(preview).html("").hide();
|
| 175 |
+
}
|
| 176 |
})
|
| 177 |
.on('click', '.wc-shortcodes-delete-image', function( e ) {
|
| 178 |
e.preventDefault();
|
includes/mce/js/shortcodes_tinymce.js
CHANGED
|
@@ -88,7 +88,9 @@
|
|
| 88 |
a.render( c, "Dotted", "dottedDivider" );
|
| 89 |
a.render( c, "Double", "doubleDivider" );
|
| 90 |
a.render( c, "Triple", "tripleDivider" );
|
| 91 |
-
a.render( c, "
|
|
|
|
|
|
|
| 92 |
|
| 93 |
b.addSeparator();
|
| 94 |
|
|
@@ -241,6 +243,12 @@
|
|
| 241 |
if(id === "imageDivider") {
|
| 242 |
tinyMCE.activeEditor.selection.setContent('[wc_divider style="image" margin_top="" margin_bottom=""]');
|
| 243 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
|
| 245 |
|
| 246 |
|
| 88 |
a.render( c, "Dotted", "dottedDivider" );
|
| 89 |
a.render( c, "Double", "doubleDivider" );
|
| 90 |
a.render( c, "Triple", "tripleDivider" );
|
| 91 |
+
a.render( c, "Image1", "imageDivider" );
|
| 92 |
+
a.render( c, "Image2", "imageDivider2" );
|
| 93 |
+
a.render( c, "Image3", "imageDivider3" );
|
| 94 |
|
| 95 |
b.addSeparator();
|
| 96 |
|
| 243 |
if(id === "imageDivider") {
|
| 244 |
tinyMCE.activeEditor.selection.setContent('[wc_divider style="image" margin_top="" margin_bottom=""]');
|
| 245 |
}
|
| 246 |
+
if(id === "imageDivider2") {
|
| 247 |
+
tinyMCE.activeEditor.selection.setContent('[wc_divider style="image2" margin_top="" margin_bottom=""]');
|
| 248 |
+
}
|
| 249 |
+
if(id === "imageDivider3") {
|
| 250 |
+
tinyMCE.activeEditor.selection.setContent('[wc_divider style="image3" margin_top="" margin_bottom=""]');
|
| 251 |
+
}
|
| 252 |
|
| 253 |
|
| 254 |
|
includes/options.php
CHANGED
|
@@ -301,7 +301,7 @@ $wc_shortcodes_options['rsvp'] = array(
|
|
| 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' => '
|
| 305 |
),
|
| 306 |
array(
|
| 307 |
'id' => 'rsvp_email_title',
|
| 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' => 'emails',
|
| 305 |
),
|
| 306 |
array(
|
| 307 |
'id' => 'rsvp_email_title',
|
includes/settings.php
CHANGED
|
@@ -108,15 +108,22 @@ function wc_shortcodes_options_display_setting( $args ) {
|
|
| 108 |
case 'image' :
|
| 109 |
wc_shortcodes_options_display_image_field( $args );
|
| 110 |
break;
|
|
|
|
|
|
|
|
|
|
| 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 '
|
| 118 |
-
|
|
|
|
|
|
|
|
|
|
| 119 |
break;
|
|
|
|
| 120 |
default :
|
| 121 |
wc_shortcodes_options_input_field( $args );
|
| 122 |
break;
|
|
@@ -139,20 +146,105 @@ function wc_shortcodes_options_input_field( $args ) {
|
|
| 139 |
<?php endif; ?>
|
| 140 |
<?php
|
| 141 |
}
|
| 142 |
-
function
|
| 143 |
extract( $args );
|
| 144 |
|
| 145 |
$val = get_option( $option_name, $default );
|
|
|
|
| 146 |
?>
|
| 147 |
|
| 148 |
<?php if ( isset( $label ) ) : ?>
|
| 149 |
-
<label for="<?php echo
|
| 150 |
<?php endif; ?>
|
| 151 |
|
| 152 |
-
<input name="<?php echo $option_name; ?>" id="<?php echo $option_name; ?>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 ) {
|
|
@@ -230,10 +322,113 @@ function wc_shortcodes_options_find_sanitize_callback( $type ) {
|
|
| 230 |
return 'esc_url_raw';
|
| 231 |
case 'checkbox' :
|
| 232 |
return 'wc_shortcodes_options_sanitize_checkbox';
|
| 233 |
-
case '
|
| 234 |
-
return '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
}
|
| 236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
return '';
|
| 238 |
}
|
| 239 |
|
|
@@ -254,7 +449,7 @@ function wc_shortcodes_options_sanitize_hex_color( $color ) {
|
|
| 254 |
return null;
|
| 255 |
}
|
| 256 |
|
| 257 |
-
function
|
| 258 |
$valid = array();
|
| 259 |
|
| 260 |
$email = explode( ',', $email );
|
| 108 |
case 'image' :
|
| 109 |
wc_shortcodes_options_display_image_field( $args );
|
| 110 |
break;
|
| 111 |
+
case 'background' :
|
| 112 |
+
wc_shortcodes_options_display_background_fields( $args );
|
| 113 |
+
break;
|
| 114 |
case 'checkbox' :
|
| 115 |
wc_shortcodes_options_display_checkbox_field( $args );
|
| 116 |
break;
|
| 117 |
case 'textarea' :
|
| 118 |
wc_shortcodes_options_display_textarea_field( $args );
|
| 119 |
break;
|
| 120 |
+
case 'positive_pixel' :
|
| 121 |
+
wc_shortcodes_options_display_positive_pixel_input_field( $args );
|
| 122 |
+
break;
|
| 123 |
+
case 'pixel' :
|
| 124 |
+
wc_shortcodes_options_display_pixel_input_field( $args );
|
| 125 |
break;
|
| 126 |
+
case 'emails' :
|
| 127 |
default :
|
| 128 |
wc_shortcodes_options_input_field( $args );
|
| 129 |
break;
|
| 146 |
<?php endif; ?>
|
| 147 |
<?php
|
| 148 |
}
|
| 149 |
+
function wc_shortcodes_options_display_positive_pixel_input_field( $args ) {
|
| 150 |
extract( $args );
|
| 151 |
|
| 152 |
$val = get_option( $option_name, $default );
|
| 153 |
+
$val = preg_replace("/[^0-9]/", "",$val);
|
| 154 |
?>
|
| 155 |
|
| 156 |
<?php if ( isset( $label ) ) : ?>
|
| 157 |
+
<label for="<?php echo $option_name; ?>"><?php echo $label; ?></label>
|
| 158 |
<?php endif; ?>
|
| 159 |
|
| 160 |
+
<input type="number" min="0" class="small-text" name="<?php echo esc_attr($option_name); ?>" id="<?php echo $option_name; ?>" value="<?php echo esc_attr($val); ?>" />
|
| 161 |
+
|
| 162 |
+
<?php if ( isset( $description ) && !empty( $description ) ) : ?>
|
| 163 |
+
<p class="description"><?php echo $description; ?></p>
|
| 164 |
+
<?php endif; ?>
|
| 165 |
+
|
| 166 |
+
<?php
|
| 167 |
+
}
|
| 168 |
+
function wc_shortcodes_options_display_pixel_input_field( $args ) {
|
| 169 |
+
extract( $args );
|
| 170 |
+
|
| 171 |
+
$val = get_option( $option_name, $default );
|
| 172 |
+
$val = preg_replace("/[^0-9\-]/", "",$val);
|
| 173 |
+
?>
|
| 174 |
+
|
| 175 |
+
<?php if ( isset( $label ) ) : ?>
|
| 176 |
+
<label for="<?php echo $option_name; ?>"><?php echo $label; ?></label>
|
| 177 |
+
<?php endif; ?>
|
| 178 |
+
|
| 179 |
+
<input type="number" class="small-text" name="<?php echo esc_attr($option_name); ?>" id="<?php echo $option_name; ?>" value="<?php echo esc_attr($val); ?>" />
|
| 180 |
+
|
| 181 |
<?php if ( isset( $description ) && !empty( $description ) ) : ?>
|
| 182 |
<p class="description"><?php echo $description; ?></p>
|
| 183 |
<?php endif; ?>
|
| 184 |
+
|
| 185 |
+
<?php
|
| 186 |
+
}
|
| 187 |
+
function wc_shortcodes_options_display_background_fields( $args ) {
|
| 188 |
+
extract( $args );
|
| 189 |
+
|
| 190 |
+
$val = get_option( $option_name, $default );
|
| 191 |
+
|
| 192 |
+
// preview image default style
|
| 193 |
+
$style = '';
|
| 194 |
+
if ( empty( $val['image'] ) )
|
| 195 |
+
$style = ' style="display:none"';
|
| 196 |
+
?>
|
| 197 |
+
|
| 198 |
+
<div class="wc-shortcodes-background-options">
|
| 199 |
+
<?php // Background Image ?>
|
| 200 |
+
<input name="<?php echo $option_name; ?>[image]" id="<?php echo $option_name; ?>" class="regular-text ltr upload-input" type="text" value="<?php echo esc_attr( $val['image'] ); ?>" />
|
| 201 |
+
<br />
|
| 202 |
+
<a class="button wc-shortcodes-image-upload" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image" data-frame="select" data-state="wc_shortcodes_insert_single" data-fetch="url" data-title="Insert Image" data-button="Insert" data-class="media-frame wc-shortcodes-custom-uploader" title="Add Media"><span class="wp-media-buttons-icon"></span> Add Media</a>
|
| 203 |
+
<a class="button wc-shortcodes-restore-image" data-restore="<?php echo esc_attr( $default['image'] ); ?>" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image">Default</a>
|
| 204 |
+
<a class="button wc-shortcodes-delete-image" data-target="#<?php echo $option_name; ?>" data-preview=".wc-shortcodes-preview-image">Delete</a>
|
| 205 |
+
<br />
|
| 206 |
+
<p class="wc-shortcodes-preview-image"<?php echo $style; ?>><img src="<?php echo esc_attr( $val['image'] ); ?>" /></p>
|
| 207 |
+
|
| 208 |
+
<?php // Background Repeat ?>
|
| 209 |
+
<select name="<?php echo $option_name; ?>[repeat]" >
|
| 210 |
+
<option value="repeat" <?php selected( $val['repeat'], 'repeat'); ?>>Repeat</option>
|
| 211 |
+
<option value="repeat-x" <?php echo selected( $val['repeat'], 'repeat-x', false ); ?>>Repeat Horizontal</option>
|
| 212 |
+
<option value="repeat-y" <?php echo selected( $val['repeat'], 'repeat-y', false ); ?>>Repeat Vertical</option>
|
| 213 |
+
<option value="no-repeat" <?php echo selected( $val['repeat'], 'no-repeat', false ); ?>>No Repeat</option>
|
| 214 |
+
<option value="" <?php selected( $val['repeat'], ''); ?>>Inherit</option>
|
| 215 |
+
</select>
|
| 216 |
+
|
| 217 |
+
<?php // Background position ?>
|
| 218 |
+
<select name="<?php echo $option_name; ?>[position]" >
|
| 219 |
+
<option value="left top" <?php selected( $val['position'], 'left top'); ?>>Left Top</option>
|
| 220 |
+
<option value="left center" <?php selected( $val['position'], 'left center'); ?>>Left Center</option>
|
| 221 |
+
<option value="left bottom" <?php selected( $val['position'], 'left bottom'); ?>>Left Bottom</option>
|
| 222 |
+
<option value="right top" <?php selected( $val['position'], 'right top'); ?>>Right Top</option>
|
| 223 |
+
<option value="right center" <?php selected( $val['position'], 'right center'); ?>>Right Center</option>
|
| 224 |
+
<option value="right bottom" <?php selected( $val['position'], 'right bottom'); ?>>Right Bottom</option>
|
| 225 |
+
<option value="center top" <?php selected( $val['position'], 'center top'); ?>>Center Top</option>
|
| 226 |
+
<option value="center center" <?php selected( $val['position'], 'center center'); ?>>Center Center</option>
|
| 227 |
+
<option value="center bottom" <?php selected( $val['position'], 'center bottom'); ?>>Center Bottom</option>
|
| 228 |
+
<option value="" <?php selected( $val['position'], ''); ?>>Inherit</option>
|
| 229 |
+
</select>
|
| 230 |
+
|
| 231 |
+
<?php // Background Attachment ?>
|
| 232 |
+
<select name="<?php echo $option_name; ?>[attachment]" >
|
| 233 |
+
<option value="scroll" <?php selected( $val['attachment'], 'scroll'); ?>>Scroll</option>
|
| 234 |
+
<option value="fixed" <?php selected( $val['attachment'], 'fixed'); ?>>Fixed</option>
|
| 235 |
+
<option value="" <?php selected( $val['attachment'], ''); ?>>Inherit</option>
|
| 236 |
+
</select>
|
| 237 |
+
<br />
|
| 238 |
+
|
| 239 |
+
<?php // Background Color ?>
|
| 240 |
+
<input name="<?php echo $option_name; ?>[color]" type="text" value="<?php echo $val['color']; ?>" class="wc-shortcodes-color-field" data-default-color="<?php echo $default['color']; ?>" />
|
| 241 |
+
|
| 242 |
+
<?php // Description ?>
|
| 243 |
+
<?php if ( isset( $description ) && !empty( $description ) ) : ?>
|
| 244 |
+
<p class="description"><?php echo $description; ?></p>
|
| 245 |
+
<?php endif; ?>
|
| 246 |
+
</div>
|
| 247 |
+
|
| 248 |
<?php
|
| 249 |
}
|
| 250 |
function wc_shortcodes_options_display_image_field( $args ) {
|
| 322 |
return 'esc_url_raw';
|
| 323 |
case 'checkbox' :
|
| 324 |
return 'wc_shortcodes_options_sanitize_checkbox';
|
| 325 |
+
case 'emails' :
|
| 326 |
+
return 'wc_shortcodes_options_sanitize_emails';
|
| 327 |
+
case 'background' :
|
| 328 |
+
return 'wc_shortcodes_options_sanitize_background_css';
|
| 329 |
+
case 'positive_pixel' :
|
| 330 |
+
return 'wc_shortcodes_options_sanitize_positive_pixel';
|
| 331 |
+
case 'pixel' :
|
| 332 |
+
return 'wc_shortcodes_options_sanitize_pixel';
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
return '';
|
| 336 |
+
}
|
| 337 |
+
|
| 338 |
+
function wc_shortcodes_options_sanitize_positive_pixel( $value ) {
|
| 339 |
+
$value = preg_replace("/[^0-9]/", "",$value);
|
| 340 |
+
$value = intval( $value );
|
| 341 |
+
|
| 342 |
+
if ( empty( $value ) )
|
| 343 |
+
$value = '0';
|
| 344 |
+
|
| 345 |
+
return $value."px";
|
| 346 |
+
}
|
| 347 |
+
|
| 348 |
+
function wc_shortcodes_options_sanitize_pixel( $value ) {
|
| 349 |
+
$value = preg_replace("/[^0-9\-]/", "",$value);
|
| 350 |
+
$value = intval( $value );
|
| 351 |
+
|
| 352 |
+
if ( empty( $value ) )
|
| 353 |
+
$value = '0';
|
| 354 |
+
|
| 355 |
+
return $value."px";
|
| 356 |
+
}
|
| 357 |
+
|
| 358 |
+
function wc_shortcodes_options_sanitize_background_css( $value ) {
|
| 359 |
+
$background = array(
|
| 360 |
+
'color' => '',
|
| 361 |
+
'image' => '',
|
| 362 |
+
'repeat' => '',
|
| 363 |
+
'position' => '',
|
| 364 |
+
'attachment' => '',
|
| 365 |
+
);
|
| 366 |
+
|
| 367 |
+
if ( !is_array( $value ) )
|
| 368 |
+
return $background;
|
| 369 |
+
|
| 370 |
+
foreach ( $value as $k => $v ) {
|
| 371 |
+
switch ( $k ) {
|
| 372 |
+
case 'color' :
|
| 373 |
+
$v = wc_shortcodes_options_sanitize_hex_color( $v );
|
| 374 |
+
$background['color'] = $v;
|
| 375 |
+
break;
|
| 376 |
+
case 'image' :
|
| 377 |
+
$v = esc_url_raw( $v );
|
| 378 |
+
$background['image'] = $v;
|
| 379 |
+
break;
|
| 380 |
+
case 'repeat' :
|
| 381 |
+
$v = wc_shortcodes_options_sanitize_background_repeat( $v );
|
| 382 |
+
$background['repeat'] = $v;
|
| 383 |
+
break;
|
| 384 |
+
case 'position' :
|
| 385 |
+
$v = wc_shortcodes_options_sanitize_background_position( $v );
|
| 386 |
+
$background['position'] = $v;
|
| 387 |
+
break;
|
| 388 |
+
case 'attachment' :
|
| 389 |
+
$v = wc_shortcodes_options_sanitize_background_attachment( $v );
|
| 390 |
+
$background['attachment'] = $v;
|
| 391 |
+
break;
|
| 392 |
+
}
|
| 393 |
}
|
| 394 |
|
| 395 |
+
return $background;
|
| 396 |
+
}
|
| 397 |
+
|
| 398 |
+
function wc_shortcodes_options_sanitize_background_repeat( $value ) {
|
| 399 |
+
$whitelist = array( 'repeat', 'no-repeat', 'repeat-x', 'repeat-y' );
|
| 400 |
+
|
| 401 |
+
if ( in_array( $value, $whitelist ) )
|
| 402 |
+
return $value;
|
| 403 |
+
|
| 404 |
+
return '';
|
| 405 |
+
}
|
| 406 |
+
|
| 407 |
+
function wc_shortcodes_options_sanitize_background_position( $value ) {
|
| 408 |
+
$whitelist = array(
|
| 409 |
+
'left top',
|
| 410 |
+
'left center',
|
| 411 |
+
'left bottom',
|
| 412 |
+
'right top',
|
| 413 |
+
'right center',
|
| 414 |
+
'right bottom',
|
| 415 |
+
'center top',
|
| 416 |
+
'center center',
|
| 417 |
+
'center bottom',
|
| 418 |
+
);
|
| 419 |
+
|
| 420 |
+
if ( in_array( $value, $whitelist ) )
|
| 421 |
+
return $value;
|
| 422 |
+
|
| 423 |
+
return '';
|
| 424 |
+
}
|
| 425 |
+
|
| 426 |
+
function wc_shortcodes_options_sanitize_background_attachment( $value ) {
|
| 427 |
+
$whitelist = array( 'fixed', 'scroll' );
|
| 428 |
+
|
| 429 |
+
if ( in_array( $value, $whitelist ) )
|
| 430 |
+
return $value;
|
| 431 |
+
|
| 432 |
return '';
|
| 433 |
}
|
| 434 |
|
| 449 |
return null;
|
| 450 |
}
|
| 451 |
|
| 452 |
+
function wc_shortcodes_options_sanitize_emails( $email ) {
|
| 453 |
$valid = array();
|
| 454 |
|
| 455 |
$email = explode( ',', $email );
|
includes/shortcode-functions.php
CHANGED
|
@@ -451,20 +451,21 @@ if( !function_exists('wc_shortcodes_box') ) {
|
|
| 451 |
'margin_top' => '',
|
| 452 |
'margin_bottom' => '',
|
| 453 |
'class' => '',
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
|
|
|
| 468 |
}
|
| 469 |
}
|
| 470 |
|
|
@@ -759,10 +760,10 @@ if( !function_exists('wc_shortcodes_heading') ) {
|
|
| 759 |
'class' => '',
|
| 760 |
'icon_left' => '',
|
| 761 |
'icon_right' => ''
|
| 762 |
-
|
| 763 |
-
|
| 764 |
-
|
| 765 |
$style_attr = '';
|
|
|
|
| 766 |
if ( $font_size ) {
|
| 767 |
$style_attr .= 'font-size: '. $font_size .';';
|
| 768 |
}
|
|
@@ -848,18 +849,25 @@ if( !function_exists('wc_shortcodes_divider') ) {
|
|
| 848 |
'margin_top' => '',
|
| 849 |
'margin_bottom' => '',
|
| 850 |
'class' => '',
|
| 851 |
-
|
| 852 |
-
|
| 853 |
-
$style_attr =
|
|
|
|
| 854 |
if ( $margin_top && $margin_bottom ) {
|
| 855 |
-
$style_attr = '
|
| 856 |
} elseif( $margin_bottom ) {
|
| 857 |
-
$style_attr = '
|
| 858 |
} elseif ( $margin_top ) {
|
| 859 |
-
$style_attr = '
|
| 860 |
-
}
|
| 861 |
-
|
|
|
|
|
|
|
| 862 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 863 |
return '<hr class="wc-shortcodes-divider wc-shortcodes-divider-line-'.$line.' wc-shortcodes-divider-style-'. $style .' '. $class .'" '.$style_attr.' />';
|
| 864 |
}
|
| 865 |
add_shortcode( 'wc_divider', 'wc_shortcodes_divider' );
|
| 451 |
'margin_top' => '',
|
| 452 |
'margin_bottom' => '',
|
| 453 |
'class' => '',
|
| 454 |
+
), $atts ) );
|
| 455 |
+
|
| 456 |
+
$style_attr = '';
|
| 457 |
+
|
| 458 |
+
if( $margin_bottom ) {
|
| 459 |
+
$style_attr .= 'margin-bottom: '. $margin_bottom .';';
|
| 460 |
+
}
|
| 461 |
+
if ( $margin_top ) {
|
| 462 |
+
$style_attr .= 'margin-top: '. $margin_top .';';
|
| 463 |
+
}
|
| 464 |
+
|
| 465 |
+
$alert_content = '';
|
| 466 |
+
$alert_content .= '<div class="wc-shortcodes-box wc-shortcodes-clearfix wc-shortcodes-box-' . $color . ' '. $class .'" style="text-align:'. $text_align .';'. $style_attr .'">';
|
| 467 |
+
$alert_content .= ' '. do_shortcode($content) .'</div>';
|
| 468 |
+
return $alert_content;
|
| 469 |
}
|
| 470 |
}
|
| 471 |
|
| 760 |
'class' => '',
|
| 761 |
'icon_left' => '',
|
| 762 |
'icon_right' => ''
|
| 763 |
+
), $atts ) );
|
| 764 |
+
|
|
|
|
| 765 |
$style_attr = '';
|
| 766 |
+
|
| 767 |
if ( $font_size ) {
|
| 768 |
$style_attr .= 'font-size: '. $font_size .';';
|
| 769 |
}
|
| 849 |
'margin_top' => '',
|
| 850 |
'margin_bottom' => '',
|
| 851 |
'class' => '',
|
| 852 |
+
), $atts ) );
|
| 853 |
+
|
| 854 |
+
$style_attr = array();
|
| 855 |
+
|
| 856 |
if ( $margin_top && $margin_bottom ) {
|
| 857 |
+
$style_attr[] = 'margin-top: '. $margin_top .';margin-bottom: '. $margin_bottom .';';
|
| 858 |
} elseif( $margin_bottom ) {
|
| 859 |
+
$style_attr[] = 'margin-bottom: '. $margin_bottom .';';
|
| 860 |
} elseif ( $margin_top ) {
|
| 861 |
+
$style_attr[] = 'margin-top: '. $margin_top .';';
|
| 862 |
+
}
|
| 863 |
+
|
| 864 |
+
if ( ! empty ( $style_attr ) ) {
|
| 865 |
+
$style_attr = 'style="' . implode( '', $style_attr ) . '"';
|
| 866 |
}
|
| 867 |
+
else {
|
| 868 |
+
$style_attr = '';
|
| 869 |
+
}
|
| 870 |
+
|
| 871 |
return '<hr class="wc-shortcodes-divider wc-shortcodes-divider-line-'.$line.' wc-shortcodes-divider-style-'. $style .' '. $class .'" '.$style_attr.' />';
|
| 872 |
}
|
| 873 |
add_shortcode( 'wc_divider', 'wc_shortcodes_divider' );
|
readme.txt
CHANGED
|
@@ -44,6 +44,12 @@ Use the shortcode manager in the TinyMCE text editor
|
|
| 44 |
|
| 45 |
== Changelog ==
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
### Version 1.13
|
| 48 |
|
| 49 |
* added rsvp shortcode
|
| 44 |
|
| 45 |
== Changelog ==
|
| 46 |
|
| 47 |
+
### Version 1.14
|
| 48 |
+
|
| 49 |
+
* Cleaned up code
|
| 50 |
+
* Added 2 more image dividers
|
| 51 |
+
* more support for different theme options
|
| 52 |
+
|
| 53 |
### Version 1.13
|
| 54 |
|
| 55 |
* added rsvp shortcode
|
wc-shortcodes.php
CHANGED
|
@@ -5,11 +5,11 @@ 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.
|
| 9 |
License: GPLv2 or later
|
| 10 |
*/
|
| 11 |
|
| 12 |
-
define( 'WC_SHORTCODES_VERSION', '1.
|
| 13 |
define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
|
| 14 |
define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
|
| 15 |
define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
| 5 |
Description: A family of shortcodes to enhance site functionality.
|
| 6 |
Author: Chris Baldelomar
|
| 7 |
Author URI: http://webplantmedia.com/
|
| 8 |
+
Version: 1.14
|
| 9 |
License: GPLv2 or later
|
| 10 |
*/
|
| 11 |
|
| 12 |
+
define( 'WC_SHORTCODES_VERSION', '1.14' );
|
| 13 |
define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
|
| 14 |
define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
|
| 15 |
define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
