Shortcodes Ultimate - Version 4.0.8

Version Description

  • Added backward compatibility for [media]. Shortcode has basic support for youtube and vimeo videos
  • Fixed bug with hidden single [tab]
  • Added attribute "active" for tabs container. This option allows you to select tab number that will be open by default
  • Fixd button style 3D
Download this release

Release Info

Developer gn_themes
Plugin Icon 128x128 Shortcodes Ultimate
Version 4.0.8
Comparing to
See all releases

Code changes from version 4.0.7 to 4.0.8

assets/js/other-shortcodes.js CHANGED
@@ -1,6 +1,6 @@
1
- jQuery(document).ready(function ($) {
2
  // Spoiler
3
- $('.su-spoiler-title').click(function (e) {
4
  var // Spoiler elements
5
  $title = $(this),
6
  $spoiler = $title.parent();
@@ -11,22 +11,35 @@ jQuery(document).ready(function ($) {
11
  e.preventDefault();
12
  });
13
  // Accordion
14
- $('.su-accordion .su-spoiler-title').click(function (e) {
15
  if ($(this).hasClass('su-spoiler-closed')) $(this).parent().siblings().addClass('su-spoiler-closed');
16
  e.preventDefault();
17
  });
18
  // Tabs
19
- $('.su-tabs-nav').delegate('span:not(.su-tabs-current)', 'click', function () {
20
- var index = $(this).index();
21
- $(this).addClass('su-tabs-current').siblings().removeClass('su-tabs-current').parents('.su-tabs').find('.su-tabs-pane').hide().eq($(this).index()).show();
22
- su_set_tabs_height();
23
- $(this).parents('.su-tabs').find('.su-tabs-pane').eq(index).find('.su-gmap iframe:not(.su-gmap-reloaded)').each(function() {
24
- $(this).attr('src', $(this).attr('src')).addClass('su-gmap-reloaded');
 
 
 
 
 
 
 
 
25
  });
 
 
 
 
 
 
 
 
26
  });
27
- $('.su-tabs-pane').hide();
28
- $('.su-tabs-nav span:first-child').click();
29
- su_set_tabs_height();
30
 
31
  function su_set_tabs_height() {
32
  $('.su-tabs-vertical').each(function () {
@@ -39,8 +52,8 @@ jQuery(document).ready(function ($) {
39
  // Tables
40
  $('.su-table tr:even').addClass('su-even');
41
  // Magnific popup
42
- $('.su-lightbox').each(function () {
43
- $(this).click(function (e) {
44
  e.preventDefault();
45
  e.stopPropagation();
46
  if ($(this).parent().attr('id') === 'su-generator-preview') $(this).html(su_other_shortcodes.no_preview);
1
+ jQuery(document).ready(function($) {
2
  // Spoiler
3
+ $('.su-spoiler-title').click(function(e) {
4
  var // Spoiler elements
5
  $title = $(this),
6
  $spoiler = $title.parent();
11
  e.preventDefault();
12
  });
13
  // Accordion
14
+ $('.su-accordion .su-spoiler-title').click(function(e) {
15
  if ($(this).hasClass('su-spoiler-closed')) $(this).parent().siblings().addClass('su-spoiler-closed');
16
  e.preventDefault();
17
  });
18
  // Tabs
19
+ $('.su-tabs-nav span').click(function(e) {
20
+ var index = $(this).index(),
21
+ $tabs = $(this).parent('.su-tabs-nav').children('span'),
22
+ $panes = $(this).parents('.su-tabs').find('.su-tabs-pane'),
23
+ $gmaps = $panes.eq(index).find('.su-gmap:not(.su-gmap-reloaded)');
24
+ // Hide all panes, show selected pane
25
+ $panes.hide().eq(index).show();
26
+ // Disable all tabs, enable selected tab
27
+ $tabs.removeClass('su-tabs-current').eq(index).addClass('su-tabs-current');
28
+ // Reload gmaps
29
+ if ($gmaps.length > 0) $gmaps.each(function() {
30
+ var $iframe = $(this).find('iframe:first');
31
+ $(this).addClass('su-gmap-reloaded');
32
+ $iframe.attr('src', $iframe.attr('src'));
33
  });
34
+ // Set height for vertical tabs
35
+ su_set_tabs_height();
36
+ e.preventDefault();
37
+ });
38
+ $('.su-tabs').each(function() {
39
+ var active = parseInt($(this).data('active')) - 1;
40
+ $(this).children('.su-tabs-nav').children('span').eq(active).trigger('click');
41
+ su_set_tabs_height();
42
  });
 
 
 
43
 
44
  function su_set_tabs_height() {
45
  $('.su-tabs-vertical').each(function () {
52
  // Tables
53
  $('.su-table tr:even').addClass('su-even');
54
  // Magnific popup
55
+ $('.su-lightbox').each(function() {
56
+ $(this).click(function(e) {
57
  e.preventDefault();
58
  e.stopPropagation();
59
  if ($(this).parent().attr('id') === 'su-generator-preview') $(this).html(su_other_shortcodes.no_preview);
inc/core/class.data.php CHANGED
@@ -22,6 +22,8 @@ class Shortcodes_Ultimate_Data {
22
  // Register shortcode
23
  add_shortcode( su_compatibility_mode_prefix() . $shortcode, $function );
24
  }
 
 
25
  }
26
 
27
  /**
@@ -82,6 +84,15 @@ class Shortcodes_Ultimate_Data {
82
  'type' => 'wrap',
83
  'group' => 'box',
84
  'atts' => array(
 
 
 
 
 
 
 
 
 
85
  'vertical' => array(
86
  'type' => 'switch',
87
  'default' => 'no',
22
  // Register shortcode
23
  add_shortcode( su_compatibility_mode_prefix() . $shortcode, $function );
24
  }
25
+ // Register [media] manually
26
+ add_shortcode( su_compatibility_mode_prefix() . 'media', 'su_media_shortcode' );
27
  }
28
 
29
  /**
84
  'type' => 'wrap',
85
  'group' => 'box',
86
  'atts' => array(
87
+ 'active' => array(
88
+ 'type' => 'number',
89
+ 'min' => 1,
90
+ 'max' => 100,
91
+ 'step' => 1,
92
+ 'default' => 1,
93
+ 'name' => __( 'Active tab', 'su' ),
94
+ 'desc' => __( 'Select which tab is open by default', 'su' )
95
+ ),
96
  'vertical' => array(
97
  'type' => 'switch',
98
  'default' => 'no',
inc/core/shortcodes.php CHANGED
@@ -9,11 +9,14 @@
9
  * @return string Output html
10
  */
11
  function su_heading_shortcode( $atts, $content = null ) {
12
- $atts = shortcode_atts( array( 'size' => 3, 'align' => 'center', 'class' => '' ), $atts );
 
 
 
 
13
  su_query_asset( 'css', 'su-content-shortcodes' );
14
  $size = round( ( $atts['size'] + 7 ) * 1.3 );
15
- return '<div class="su-heading su-heading-align-' . $atts['align'] . su_ecssc( $atts ) . '" style="font-size:' .
16
- $size . 'px"><div class="su-heading-inner">' . $content . '</div></div>';
17
  }
18
 
19
  /**
@@ -26,6 +29,7 @@ function su_heading_shortcode( $atts, $content = null ) {
26
  */
27
  function su_tabs_shortcode( $atts, $content ) {
28
  $atts = shortcode_atts( array(
 
29
  'vertical' => 'no',
30
  'style' => null, // 3.x
31
  'class' => ''
@@ -36,14 +40,13 @@ function su_tabs_shortcode( $atts, $content ) {
36
  $return = '';
37
  $tabs = $panes = array();
38
  if ( is_array( $GLOBALS['tabs'] ) ) {
 
39
  foreach ( $GLOBALS['tabs'] as $tab ) {
40
  $tabs[] = '<span class="' . su_ecssc( $tab ) . '">' . $tab['title'] . '</span>';
41
  $panes[] = '<div class="su-tabs-pane' . su_ecssc( $tab ) . '">' . $tab['content'] . '</div>';
42
  }
43
  $vertical = ( $atts['vertical'] === 'yes' ) ? ' su-tabs-vertical' : '';
44
- $return = '<div class="su-tabs' . $vertical . su_ecssc( $atts ) . '"><div class="su-tabs-nav">' .
45
- implode( '', $tabs ) . '</div><div class="su-tabs-panes">' .
46
- implode( "\n", $panes ) . '</div><div style="clear:both;height:0"></div></div>';
47
  }
48
  // Unset globals
49
  unset( $GLOBALS['tabs'], $GLOBALS['tab_count'] );
@@ -328,7 +331,7 @@ function su_button_shortcode( $atts, $content = null ) {
328
  $atts['background'] = $atts['color'];
329
  $atts['color'] = ( $atts['dark'] ) ? '#000' : '#fff';
330
  }
331
- $atts['style'] = str_replace( array( '1', '2', '3', '4', '5' ), array( 'default', 'glass', 'bubbles', 'noise', 'stroked' ), $atts['style'] ); // 3.x
332
 
333
  // Prepare vars
334
  $a_css = array();
@@ -553,6 +556,25 @@ function su_private_shortcode( $atts = null, $content = null ) {
553
  do_shortcode( $content ) . '</div></div>' : '';
554
  }
555
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
556
  /**
557
  * Shortcode: youtube
558
  *
9
  * @return string Output html
10
  */
11
  function su_heading_shortcode( $atts, $content = null ) {
12
+ $atts = shortcode_atts( array(
13
+ 'size' => 3,
14
+ 'align' => 'center',
15
+ 'class' => ''
16
+ ), $atts );
17
  su_query_asset( 'css', 'su-content-shortcodes' );
18
  $size = round( ( $atts['size'] + 7 ) * 1.3 );
19
+ return '<div class="su-heading su-heading-align-' . $atts['align'] . su_ecssc( $atts ) . '" style="font-size:' . $size . 'px"><div class="su-heading-inner">' . $content . '</div></div>';
 
20
  }
21
 
22
  /**
29
  */
30
  function su_tabs_shortcode( $atts, $content ) {
31
  $atts = shortcode_atts( array(
32
+ 'active' => 1,
33
  'vertical' => 'no',
34
  'style' => null, // 3.x
35
  'class' => ''
40
  $return = '';
41
  $tabs = $panes = array();
42
  if ( is_array( $GLOBALS['tabs'] ) ) {
43
+ if ( $GLOBALS['tab_count'] < $atts['active'] ) $atts['active'] = $GLOBALS['tab_count'];
44
  foreach ( $GLOBALS['tabs'] as $tab ) {
45
  $tabs[] = '<span class="' . su_ecssc( $tab ) . '">' . $tab['title'] . '</span>';
46
  $panes[] = '<div class="su-tabs-pane' . su_ecssc( $tab ) . '">' . $tab['content'] . '</div>';
47
  }
48
  $vertical = ( $atts['vertical'] === 'yes' ) ? ' su-tabs-vertical' : '';
49
+ $return = '<div class="su-tabs' . $vertical . su_ecssc( $atts ) . '" data-active="' . (string) $atts['active'] . '"><div class="su-tabs-nav">' . implode( '', $tabs ) . '</div><div class="su-tabs-panes">' . implode( "\n", $panes ) . '</div><div style="clear:both;height:0"></div></div>';
 
 
50
  }
51
  // Unset globals
52
  unset( $GLOBALS['tabs'], $GLOBALS['tab_count'] );
331
  $atts['background'] = $atts['color'];
332
  $atts['color'] = ( $atts['dark'] ) ? '#000' : '#fff';
333
  }
334
+ if ( is_numeric( $atts['style'] ) ) $atts['style'] = str_replace( array( '1', '2', '3', '4', '5' ), array( 'default', 'glass', 'bubbles', 'noise', 'stroked' ), $atts['style'] ); // 3.x
335
 
336
  // Prepare vars
337
  $a_css = array();
556
  do_shortcode( $content ) . '</div></div>' : '';
557
  }
558
 
559
+ /**
560
+ * Shortcode: media
561
+ *
562
+ * This is shortcode from version 3.x and it not visible in generator
563
+ *
564
+ * @param array $atts Shortcode attributes
565
+ * @param string $content
566
+ *
567
+ * @return string Output html
568
+ */
569
+ function su_media_shortcode( $atts, $content = null ) {
570
+ // Check YouTube video
571
+ if ( strpos( $atts['url'], 'youtu' ) !== false ) return su_youtube_shortcode( $atts );
572
+ // Check Vimeo video
573
+ elseif ( strpos( $atts['url'], 'vimeo' ) !== false ) return su_vimeo_shortcode( $atts );
574
+ // Image
575
+ else return '<img src="' . $atts['url'] . '" width="' . $atts['width'] . '" height="' . $atts['height'] . '" style="max-width:100%" />';
576
+ }
577
+
578
  /**
579
  * Shortcode: youtube
580
  *
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
5
  Tags: shortcode, shortcodes, short code, video, responsive, responsive video, youtube, vimeo, audio, mp3, tab, tabs, button, buttons, jquery, box, boxes, toggle, spoiler, column, columns, services, service, pullquote, list, lists, images, image, links, fancy, fancy link, fancy links, fancy buttons, jquery tabs, accordion, slider, plugin, admin, gallery, bloginfo, list pages, sub pages, navigation, siblings pages, children pages, permalink, permalinks, feed, document, member, members, guests, membership, documents, carousel, rss, touch, icon, icons
6
  Requires at least: 3.4
7
  Tested up to: 4.0
8
- Stable tag: 4.0.7
9
 
10
  Supercharge your WordPress theme with mega pack of shortcodes
11
 
@@ -86,6 +86,12 @@ Upgrade normally via your Wordpress admin -> Plugins panel.
86
 
87
  == Changelog ==
88
 
 
 
 
 
 
 
89
  = 4.0.7 =
90
  * Added backward compatibility for [frame]
91
 
5
  Tags: shortcode, shortcodes, short code, video, responsive, responsive video, youtube, vimeo, audio, mp3, tab, tabs, button, buttons, jquery, box, boxes, toggle, spoiler, column, columns, services, service, pullquote, list, lists, images, image, links, fancy, fancy link, fancy links, fancy buttons, jquery tabs, accordion, slider, plugin, admin, gallery, bloginfo, list pages, sub pages, navigation, siblings pages, children pages, permalink, permalinks, feed, document, member, members, guests, membership, documents, carousel, rss, touch, icon, icons
6
  Requires at least: 3.4
7
  Tested up to: 4.0
8
+ Stable tag: 4.0.8
9
 
10
  Supercharge your WordPress theme with mega pack of shortcodes
11
 
86
 
87
  == Changelog ==
88
 
89
+ = 4.0.8 =
90
+ * Added backward compatibility for [media]. Shortcode has basic support for youtube and vimeo videos
91
+ * Fixed bug with hidden single [tab]
92
+ * Added attribute "active" for tabs container. This option allows you to select tab number that will be open by default
93
+ * Fixd button style 3D
94
+
95
  = 4.0.7 =
96
  * Added backward compatibility for [frame]
97
 
shortcodes-ultimate.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Shortcodes Ultimate
4
  Plugin URI: http://gndev.info/shortcodes-ultimate/
5
- Version: 4.0.7
6
  Author: Vladimir Anokhin
7
  Author URI: http://gndev.info/
8
  Description: Supercharge your WordPress theme with mega pack of shortcodes
2
  /*
3
  Plugin Name: Shortcodes Ultimate
4
  Plugin URI: http://gndev.info/shortcodes-ultimate/
5
+ Version: 4.0.8
6
  Author: Vladimir Anokhin
7
  Author URI: http://gndev.info/
8
  Description: Supercharge your WordPress theme with mega pack of shortcodes