Fruitful Shortcodes - Version 1.2.1

Version Description

Release Date: 19.09.2014

  • Bugfixes

    • Escape special characters - quotes from links
  • New features

    • New attribute for button shortcode target="_blank" for button
Download this release

Release Info

Developer fruitfulcode
Plugin Icon 128x128 Fruitful Shortcodes
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2 to 1.2.1

ff-shortcodes.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Fruitful Shortcodes
4
  Plugin URI: http://plugins.fruitfulcode.com/shortcodes/
5
  Description: Add additional content shortcodes: horizontal tabs, vertical tabs, accordion, promo text, columns, infobox, separator, alert, progress bar, button,
6
- Version: 1.2
7
  Author: fruitfulcode
8
  Author URI: http://fruitfulcode.com
9
  License: GPL2
3
  Plugin Name: Fruitful Shortcodes
4
  Plugin URI: http://plugins.fruitfulcode.com/shortcodes/
5
  Description: Add additional content shortcodes: horizontal tabs, vertical tabs, accordion, promo text, columns, infobox, separator, alert, progress bar, button,
6
+ Version: 1.2.1
7
  Author: fruitfulcode
8
  Author URI: http://fruitfulcode.com
9
  License: GPL2
includes/shortcodes/shortcodes.php CHANGED
@@ -121,7 +121,7 @@ function fruitful_info_box ($atts, $content = null) {
121
 
122
  $out .= '<div id="'.$id.'" class="'.$class.' '. $column .' ffs-info-box ' . $icon_position . ' ' . $last . '" >';
123
  if (($link != '') && ($link != '#')) {
124
- $out .= '<a href="'.esc_url($link).'">';
125
  }
126
  if (($image != '') || ($icon != '')) {
127
  $out .= '<div class="ffs-icon-box">';
@@ -321,7 +321,7 @@ add_shortcode( 'fruitful_bar', 'fruitful_bar_shortcode', 99 );
321
  */
322
 
323
  function fruitful_btn_shortcode ( $atts, $content = null ) {
324
- $out = $size = $color = $type = $state = $text_color = $icon = $icon_position = $link = $options = "";
325
  extract(shortcode_atts(array(
326
  'size' => 'small',
327
  'color' => 'primary',
@@ -330,7 +330,8 @@ function fruitful_btn_shortcode ( $atts, $content = null ) {
330
  'text_color' => '#fff',
331
  'icon' => '',
332
  'icon_position' => 'left',
333
- 'link' => '#'
 
334
 
335
  ), $atts));
336
 
@@ -344,7 +345,8 @@ function fruitful_btn_shortcode ( $atts, $content = null ) {
344
 
345
  if (!empty($icon)) { $icon = sanitize_html_class($icon); }
346
  if (!empty($icon_position)) { $icon_position = sanitize_html_class($icon_position); }
347
- if (!empty($link)) { $link = esc_url($link); }
 
348
 
349
  if (($size == 'mini') || ($size == 'small') || ($size == 'large')) {
350
  $options .= ' btn-' . $size;
@@ -366,8 +368,14 @@ function fruitful_btn_shortcode ( $atts, $content = null ) {
366
 
367
  $content = do_shortcode(fruitful_sh_esc_content_pbr($content));
368
 
 
 
 
 
 
 
369
  if ($type == 'link') {
370
- $out = '<a href="'.$link.'" class="btn'.$options.'" style="color:'.$text_color.';" target="_blank">';
371
  if ($icon != '') {
372
  if ($icon_position == 'right') { $out .= $content; }
373
  if ($icon != '') {
@@ -411,4 +419,9 @@ function fruitful_sh_esc_content_pbr($content = null) {
411
  $New = array( '','' );
412
  $content = str_replace( $Old, $New, $content );
413
  return $content;
 
 
 
 
 
414
  }
121
 
122
  $out .= '<div id="'.$id.'" class="'.$class.' '. $column .' ffs-info-box ' . $icon_position . ' ' . $last . '" >';
123
  if (($link != '') && ($link != '#')) {
124
+ $out .= '<a href="'.fruitful_sh_esc_link($link).'">';
125
  }
126
  if (($image != '') || ($icon != '')) {
127
  $out .= '<div class="ffs-icon-box">';
321
  */
322
 
323
  function fruitful_btn_shortcode ( $atts, $content = null ) {
324
+ $out = $size = $color = $type = $state = $text_color = $icon = $icon_position = $link = $options = $target = $target_output = "";
325
  extract(shortcode_atts(array(
326
  'size' => 'small',
327
  'color' => 'primary',
330
  'text_color' => '#fff',
331
  'icon' => '',
332
  'icon_position' => 'left',
333
+ 'link' => '#',
334
+ 'target' => ''
335
 
336
  ), $atts));
337
 
345
 
346
  if (!empty($icon)) { $icon = sanitize_html_class($icon); }
347
  if (!empty($icon_position)) { $icon_position = sanitize_html_class($icon_position); }
348
+ if (!empty($link)) { $link = fruitful_sh_esc_link($link); }
349
+ if (!empty($target)) { $target = sanitize_html_class($target); }
350
 
351
  if (($size == 'mini') || ($size == 'small') || ($size == 'large')) {
352
  $options .= ' btn-' . $size;
368
 
369
  $content = do_shortcode(fruitful_sh_esc_content_pbr($content));
370
 
371
+ if ($target == '_blank'){
372
+ $target_output = 'target="_blank"';
373
+ } else {
374
+ $target_output = '';
375
+ }
376
+
377
  if ($type == 'link') {
378
+ $out = '<a href="'.$link.'" class="btn'.$options.'" style="color:'.$text_color.';" '.$target_output.'>';
379
  if ($icon != '') {
380
  if ($icon_position == 'right') { $out .= $content; }
381
  if ($icon != '') {
419
  $New = array( '','' );
420
  $content = str_replace( $Old, $New, $content );
421
  return $content;
422
+ }
423
+
424
+ function fruitful_sh_esc_link($link){
425
+ $link = esc_url(str_replace('”','',str_replace('“','',$link)));
426
+ return $link;
427
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: fruitfulcode
3
  Donate link: http://fruitfulcode.com
4
  Tags: admin, fruitful, shortcode, shortcodes, short code, editor, content, bootstrap, post, page, tab, tabs, horizontal tabs, vertical tabs, accordion, promo text, columns, infobox, separator, alert, progress bar, button
5
  Requires at least: 3.4.1
6
- Tested up to: 3.9.1
7
- Stable tag: 1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -78,6 +78,16 @@ You can check <a href="http://support.fruitfulcode.com/hc/en-us/sections/2004063
78
 
79
  == Changelog ==
80
 
 
 
 
 
 
 
 
 
 
 
81
  = 1.2 =
82
  Release Date: 06.08.2014
83
 
@@ -89,7 +99,7 @@ Release Date: 06.08.2014
89
  * Bugfixes
90
  * Shortcode promo text: shawow type
91
  * Promo text size responsive
92
- * Removed styles for content paragraph
93
 
94
 
95
  = 1.1 =
3
  Donate link: http://fruitfulcode.com
4
  Tags: admin, fruitful, shortcode, shortcodes, short code, editor, content, bootstrap, post, page, tab, tabs, horizontal tabs, vertical tabs, accordion, promo text, columns, infobox, separator, alert, progress bar, button
5
  Requires at least: 3.4.1
6
+ Tested up to: 4.0
7
+ Stable tag: 1.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
78
 
79
  == Changelog ==
80
 
81
+ = 1.2.1 =
82
+ Release Date: 19.09.2014
83
+
84
+ * Bugfixes
85
+ * Escape special characters - quotes from links
86
+
87
+ * New features
88
+ * New attribute for button shortcode target="_blank" for button
89
+
90
+
91
  = 1.2 =
92
  Release Date: 06.08.2014
93
 
99
  * Bugfixes
100
  * Shortcode promo text: shawow type
101
  * Promo text size responsive
102
+ * Removed styles for content <p>
103
 
104
 
105
  = 1.1 =