Bootstrap Shortcodes for WordPress - Version 3.3.8

Version Description

  • Tested to work with WordPress 4.5
  • Set a default "active" slide in carousel if none is specified
  • Add shortcode for responsive embeds
  • Correct some non-latin characters displaying incorrectly
  • Add filter to hook into tabs for things like tab history (thanks, Jason Maners!)
Download this release

Release Info

Developer FoolsRun
Plugin Icon Bootstrap Shortcodes for WordPress
Version 3.3.8
Comparing to
See all releases

Code changes from version 3.3.6 to 3.3.8

LICENSE.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Filip Stefansson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md CHANGED
@@ -6,7 +6,7 @@ WordPress plugin that provides shortcodes for easier use of the Bootstrap styles
6
  ## Requirements
7
  This plugin won't do anything if you don't have WordPress theme built with the [Bootstrap](http://getbootstrap.com/) framework. **This plugin does not include the Bootstrap framework**.
8
 
9
- The plugin is tested to work with ```Bootstrap 3.2``` and ```WordPress 4.0```.
10
 
11
  This plugin contains a ```composer.json``` file for those of you who manage your PHP dependencies with [Composer](https://getcomposer.org).
12
 
@@ -20,6 +20,7 @@ This plugin contains a ```composer.json``` file for those of you who manage your
20
  * [Tables](#tables)
21
  * [Buttons](#buttons)
22
  * [Images](#images)
 
23
  * [Responsive utilities](#responsive-utilities)
24
 
25
  ### Components
@@ -216,6 +217,21 @@ data | Data attribute and value pairs separated by a comma. Pairs separated by p
216
 
217
  * * *
218
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  ### Responsive Utilities
220
  [responsive block="lg md" hidden="sn xs"] ... [/responsive]
221
 
@@ -759,6 +775,13 @@ html | Insert HTML into the tooltip | optional | true, false | false
759
  * * *
760
 
761
  ### Collapse
 
 
 
 
 
 
 
762
  [collapsibles]
763
  [collapse title="Collapse 1" active="true"]
764
  ...
6
  ## Requirements
7
  This plugin won't do anything if you don't have WordPress theme built with the [Bootstrap](http://getbootstrap.com/) framework. **This plugin does not include the Bootstrap framework**.
8
 
9
+ The plugin is tested to work with ```Bootstrap 3``` and ```WordPress 4```.
10
 
11
  This plugin contains a ```composer.json``` file for those of you who manage your PHP dependencies with [Composer](https://getcomposer.org).
12
 
20
  * [Tables](#tables)
21
  * [Buttons](#buttons)
22
  * [Images](#images)
23
+ * [Responsive Embeds](#responsive-embeds)
24
  * [Responsive utilities](#responsive-utilities)
25
 
26
  ### Components
217
 
218
  * * *
219
 
220
+ ### Responsive Embeds
221
+ [embed-responsive ratio="16by9"] ... [/embed-responsive]
222
+
223
+ Wrap ```<iframe>```, ```<embed>```, ```<video>```, and ```<object>``` elements to make them responsive.
224
+ #### [responsive-embed] parameters
225
+ Parameter | Description | Required | Values | Default
226
+ --- | --- | --- | --- | ---
227
+ ratio | Maintain the aspect ratio of the embed | optional | 16by9, 4by3 | false
228
+ xclass | Any extra classes you want to add | optional | any text | none
229
+ data | Data attribute and value pairs separated by a comma. Pairs separated by pipe (see example at [Button Dropdowns](#button-dropdowns)). | optional | any text | none
230
+
231
+ [Bootstrap responsive embed documentation](http://getbootstrap.com/components/#responsive-embed)
232
+
233
+ * * *
234
+
235
  ### Responsive Utilities
236
  [responsive block="lg md" hidden="sn xs"] ... [/responsive]
237
 
775
  * * *
776
 
777
  ### Collapse
778
+
779
+ #### Single Collapse
780
+ [collapse title="Collapse 1" active="true"]
781
+ ...
782
+ [/collapse]
783
+
784
+ #### Set of Collapsibles
785
  [collapsibles]
786
  [collapse title="Collapse 1" active="true"]
787
  ...
bootstrap-shortcodes.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Bootstrap 3 Shortcodes
4
  Plugin URI: http://wp-snippets.com/freebies/bootstrap-shortcodes or https://github.com/filipstefansson/bootstrap-shortcodes
5
  Description: The plugin adds a shortcodes for all Bootstrap elements.
6
- Version: 3.3.6
7
  Author: Filip Stefansson, Simon Yeldon, and Michael W. Delaney
8
  Author URI:
9
  License: GPL2
@@ -90,6 +90,7 @@ class BoostrapShortcodes {
90
  'emphasis',
91
  'icon',
92
  'img',
 
93
  'jumbotron',
94
  'label',
95
  'lead',
@@ -473,7 +474,7 @@ class BoostrapShortcodes {
473
  #$pattern = ( $dropdown ) ? '<li%1$s><a href="%2$s"%3$s%4$s%5$s></a>%6$s</li>' : '<li%1$s><a href="%2$s"%3$s%4$s%5$s>%6$s</a></li>';
474
 
475
  //* If we have a dropdown shortcode inside the content we end the link before the dropdown shortcode, else all content goes inside the link
476
- $content = ( $dropdown ) ? str_replace( '[dropdown]', '</a>[dropdown]', $content ) : $content . '</a>';
477
 
478
  return sprintf(
479
  '<li%1$s><a href="%2$s"%3$s%4$s%5$s>%6$s</li>',
@@ -1151,10 +1152,13 @@ class BoostrapShortcodes {
1151
 
1152
  $GLOBALS['tabs_default_count'] = 0;
1153
 
 
 
1154
  $atts = shortcode_atts( array(
1155
- "type" => false,
1156
- "xclass" => false,
1157
- "data" => false
 
1158
  ), $atts );
1159
 
1160
  $ul_class = 'nav';
@@ -1162,9 +1166,15 @@ class BoostrapShortcodes {
1162
  $ul_class .= ( $atts['xclass'] ) ? ' ' . $atts['xclass'] : '';
1163
 
1164
  $div_class = 'tab-content';
1165
-
1166
- $id = 'custom-tabs-'. $GLOBALS['tabs_count'];
1167
-
 
 
 
 
 
 
1168
  $data_props = $this->parse_data_attributes( $atts['data'] );
1169
 
1170
  $atts_map = bs_attribute_map( $content );
@@ -1184,25 +1194,33 @@ class BoostrapShortcodes {
1184
  $class ='';
1185
  $class .= ( !empty($tab["tab"]["active"]) || ($GLOBALS['tabs_default_active'] && $i == 0) ) ? 'active' : '';
1186
  $class .= ( !empty($tab["tab"]["xclass"]) ) ? ' ' . $tab["tab"]["xclass"] : '';
1187
-
 
 
 
 
 
 
1188
  $tabs[] = sprintf(
1189
- '<li%s><a href="#%s" data-toggle="tab">%s</a></li>',
1190
- ( !empty($class) ) ? ' class="' . $class . '"' : '',
1191
- 'custom-tab-' . $GLOBALS['tabs_count'] . '-' . md5($tab["tab"]["title"]),
1192
  $tab["tab"]["title"]
1193
  );
1194
  $i++;
1195
  }
1196
  }
1197
- return sprintf(
1198
  '<ul class="%s" id="%s"%s>%s</ul><div class="%s">%s</div>',
1199
  esc_attr( $ul_class ),
1200
- esc_attr( $id ),
1201
  ( $data_props ) ? ' ' . $data_props : '',
1202
  ( $tabs ) ? implode( $tabs ) : '',
1203
- esc_attr( $div_class ),
1204
  do_shortcode( $content )
1205
  );
 
 
1206
  }
1207
 
1208
  /*--------------------------------------------------------------------------------------
@@ -1220,7 +1238,8 @@ class BoostrapShortcodes {
1220
  'active' => false,
1221
  'fade' => false,
1222
  'xclass' => false,
1223
- 'data' => false
 
1224
  ), $atts );
1225
 
1226
  if( $GLOBALS['tabs_default_active'] && $GLOBALS['tabs_default_count'] == 0 ) {
@@ -1235,13 +1254,16 @@ class BoostrapShortcodes {
1235
  $class .= ( $atts['xclass'] ) ? ' ' . $atts['xclass'] : '';
1236
 
1237
 
1238
- $id = 'custom-tab-'. $GLOBALS['tabs_count'] . '-'. md5( $atts['title'] );
1239
-
 
 
 
1240
  $data_props = $this->parse_data_attributes( $atts['data'] );
1241
 
1242
  return sprintf(
1243
  '<div id="%s" class="%s"%s>%s</div>',
1244
- esc_attr( $id ),
1245
  esc_attr( $class ),
1246
  ( $data_props ) ? ' ' . $data_props : '',
1247
  do_shortcode( $content )
@@ -1281,8 +1303,8 @@ class BoostrapShortcodes {
1281
 
1282
  return sprintf(
1283
  '<div class="%s" id="%s"%s>%s</div>',
1284
- esc_attr( $class ),
1285
- esc_attr( $id ),
1286
  ( $data_props ) ? ' ' . $data_props : '',
1287
  do_shortcode( $content )
1288
  );
@@ -1299,6 +1321,11 @@ class BoostrapShortcodes {
1299
  *
1300
  *-------------------------------------------------------------------------------------*/
1301
  function bs_collapse( $atts, $content = null ) {
 
 
 
 
 
1302
 
1303
  $atts = shortcode_atts( array(
1304
  "title" => false,
@@ -1318,8 +1345,8 @@ class BoostrapShortcodes {
1318
  $a_class = '';
1319
  $a_class .= ( $atts['active'] == 'true' ) ? '' : 'collapsed';
1320
 
1321
- $parent = 'custom-collapse-'. $GLOBALS['collapsibles_count'];
1322
- $current_collapse = $parent . '-'. md5( $atts['title'] );
1323
 
1324
  $data_props = $this->parse_data_attributes( $atts['data'] );
1325
 
@@ -1327,7 +1354,7 @@ class BoostrapShortcodes {
1327
  '<div class="%1$s"%2$s>
1328
  <div class="panel-heading">
1329
  <h4 class="panel-title">
1330
- <a class="%3$s" data-toggle="collapse" data-parent="#%4$s" href="#%5$s">%6$s</a>
1331
  </h4>
1332
  </div>
1333
  <div id="%5$s" class="%7$s">
@@ -1335,9 +1362,9 @@ class BoostrapShortcodes {
1335
  </div>
1336
  </div>',
1337
  esc_attr( $panel_class ),
1338
- ( $data_props ) ? ' ' . $data_props : '',
1339
  $a_class,
1340
- $parent,
1341
  $current_collapse,
1342
  $atts['title'],
1343
  esc_attr( $collapse_class ),
@@ -1436,7 +1463,7 @@ class BoostrapShortcodes {
1436
  ), $atts );
1437
 
1438
  if( $GLOBALS['carousel_default_active'] && $GLOBALS['carousel_default_count'] == 0 ) {
1439
- $active = true;
1440
  }
1441
  $GLOBALS['carousel_default_count']++;
1442
 
@@ -1446,7 +1473,11 @@ class BoostrapShortcodes {
1446
 
1447
  $data_props = $this->parse_data_attributes( $atts['data'] );
1448
 
1449
- $content = preg_replace('/class=".*?"/', '', $content);
 
 
 
 
1450
 
1451
  return sprintf(
1452
  '<div class="%s"%s>%s%s</div>',
@@ -1594,7 +1625,7 @@ function bs_popover( $atts, $content = null ) {
1594
  $h4_class = 'media-heading';
1595
  $h4_class .= ( $atts['xclass'] ) ? ' ' . $atts['xclass'] : '';
1596
 
1597
- $data_props = $this->parse_data_attributes( $data );
1598
 
1599
  return sprintf(
1600
  '<div class="%s"%s><h4 class="%s">%s</h4>%s</div>',
@@ -1731,6 +1762,7 @@ function bs_popover( $atts, $content = null ) {
1731
  "data" => false
1732
  ), $atts );
1733
 
 
1734
  $class .= ( $atts['type'] ) ? 'img-' . $atts['type'] . ' ' : '';
1735
  $class .= ( $atts['responsive'] == 'true' ) ? ' img-responsive' : '';
1736
  $class .= ( $atts['xclass'] ) ? ' ' . $atts['xclass'] : '';
@@ -1743,6 +1775,39 @@ function bs_popover( $atts, $content = null ) {
1743
 
1744
  }
1745
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1746
  /*--------------------------------------------------------------------------------------
1747
  *
1748
  * bs_thumbnail
@@ -1843,6 +1908,11 @@ function bs_popover( $atts, $content = null ) {
1843
  *
1844
  *-------------------------------------------------------------------------------------*/
1845
  function bs_modal( $atts, $content = null ) {
 
 
 
 
 
1846
 
1847
  $atts = shortcode_atts( array(
1848
  "text" => false,
@@ -1860,35 +1930,43 @@ function bs_popover( $atts, $content = null ) {
1860
 
1861
  $div_size = ( $atts['size'] ) ? ' modal-' . $atts['size'] : '';
1862
 
1863
- $id = 'custom-modal-' . md5( $atts['title'] );
1864
 
1865
  $data_props = $this->parse_data_attributes( $atts['data'] );
1866
 
1867
- return sprintf(
1868
- '<a data-toggle="modal" href="#%1$s" class="%2$s"%3$s>%4$s</a>
1869
- <div class="%5$s" id="%1$s" tabindex="-1" role="dialog" aria-hidden="true">
1870
- <div class="modal-dialog %6$s">
1871
  <div class="modal-content">
1872
  <div class="modal-header">
1873
  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
1874
- %7$s
1875
  </div>
1876
  <div class="modal-body">
1877
- %8$s
1878
  </div>
1879
  </div> <!-- /.modal-content -->
1880
  </div> <!-- /.modal-dialog -->
1881
- </div> <!-- /.modal -->
1882
- ',
1883
- esc_attr( $id ),
1884
- esc_attr( $a_class ),
1885
- ( $data_props ) ? ' ' . $data_props : '',
1886
- esc_html( $atts['text'] ),
1887
  esc_attr( $div_class ),
 
1888
  esc_attr( $div_size ),
1889
  ( $atts['title'] ) ? '<h4 class="modal-title">' . $atts['title'] . '</h4>' : '',
1890
  do_shortcode( $content )
1891
  );
 
 
 
 
 
 
 
 
 
 
 
 
1892
  }
1893
 
1894
  /*--------------------------------------------------------------------------------------
@@ -1912,7 +1990,7 @@ function bs_popover( $atts, $content = null ) {
1912
  $data_props = $this->parse_data_attributes( $atts['data'] );
1913
 
1914
  return sprintf(
1915
- '<div class="%s"%s>%s</div>',
1916
  esc_attr( $class ),
1917
  ( $data_props ) ? ' ' . $data_props : '',
1918
  do_shortcode( $content )
@@ -1966,16 +2044,16 @@ function bs_popover( $atts, $content = null ) {
1966
 
1967
  $dom->documentElement->setAttribute('class', $dom->documentElement->getAttribute('class') . ' ' . esc_attr( utf8_encode($class) ));
1968
  if( $title ) {
1969
- $dom->documentElement->setAttribute('title', utf8_encode($title) );
1970
  }
1971
  if( $data ) {
1972
  $data = explode( '|', $data );
1973
  foreach( $data as $d ):
1974
  $d = explode(',',$d);
1975
- $dom->documentElement->setAttribute('data-'.utf8_encode($d[0]),trim(utf8_encode($d[1])));
1976
  endforeach;
1977
  }
1978
- return $dom->saveXML($dom->documentElement);
1979
  }
1980
 
1981
  /*--------------------------------------------------------------------------------------
3
  Plugin Name: Bootstrap 3 Shortcodes
4
  Plugin URI: http://wp-snippets.com/freebies/bootstrap-shortcodes or https://github.com/filipstefansson/bootstrap-shortcodes
5
  Description: The plugin adds a shortcodes for all Bootstrap elements.
6
+ Version: 3.3.8
7
  Author: Filip Stefansson, Simon Yeldon, and Michael W. Delaney
8
  Author URI:
9
  License: GPL2
90
  'emphasis',
91
  'icon',
92
  'img',
93
+ 'embed-responsive',
94
  'jumbotron',
95
  'label',
96
  'lead',
474
  #$pattern = ( $dropdown ) ? '<li%1$s><a href="%2$s"%3$s%4$s%5$s></a>%6$s</li>' : '<li%1$s><a href="%2$s"%3$s%4$s%5$s>%6$s</a></li>';
475
 
476
  //* If we have a dropdown shortcode inside the content we end the link before the dropdown shortcode, else all content goes inside the link
477
+ $content = ( $atts['dropdown'] ) ? str_replace( '[dropdown]', '</a>[dropdown]', $content ) : $content . '</a>';
478
 
479
  return sprintf(
480
  '<li%1$s><a href="%2$s"%3$s%4$s%5$s>%6$s</li>',
1152
 
1153
  $GLOBALS['tabs_default_count'] = 0;
1154
 
1155
+ $atts = apply_filters('bs_tabs_atts',$atts);
1156
+
1157
  $atts = shortcode_atts( array(
1158
+ "type" => false,
1159
+ "xclass" => false,
1160
+ "data" => false,
1161
+ "name" => false,
1162
  ), $atts );
1163
 
1164
  $ul_class = 'nav';
1166
  $ul_class .= ( $atts['xclass'] ) ? ' ' . $atts['xclass'] : '';
1167
 
1168
  $div_class = 'tab-content';
1169
+
1170
+ // If user defines name of group, use that for ID for tab history purposes
1171
+ if(isset($atts['name'])) {
1172
+ $id = $atts['name'];
1173
+ } else {
1174
+ $id = 'custom-tabs-' . $GLOBALS['tabs_count'];
1175
+ }
1176
+
1177
+
1178
  $data_props = $this->parse_data_attributes( $atts['data'] );
1179
 
1180
  $atts_map = bs_attribute_map( $content );
1194
  $class ='';
1195
  $class .= ( !empty($tab["tab"]["active"]) || ($GLOBALS['tabs_default_active'] && $i == 0) ) ? 'active' : '';
1196
  $class .= ( !empty($tab["tab"]["xclass"]) ) ? ' ' . $tab["tab"]["xclass"] : '';
1197
+
1198
+ if(!isset($tab["tab"]["link"])) {
1199
+ $tab_id = 'custom-tab-' . $GLOBALS['tabs_count'] . '-' . md5( $tab["tab"]["title"] );
1200
+ } else {
1201
+ $tab_id = $tab["tab"]["link"];
1202
+ }
1203
+
1204
  $tabs[] = sprintf(
1205
+ '<li%s><a href="#%s" data-toggle="tab" >%s</a></li>',
1206
+ ( !empty($class) ) ? ' class="' . sanitize_html_class($class) . '"' : '',
1207
+ sanitize_html_class($tab_id),
1208
  $tab["tab"]["title"]
1209
  );
1210
  $i++;
1211
  }
1212
  }
1213
+ $output = sprintf(
1214
  '<ul class="%s" id="%s"%s>%s</ul><div class="%s">%s</div>',
1215
  esc_attr( $ul_class ),
1216
+ sanitize_html_class( $id ),
1217
  ( $data_props ) ? ' ' . $data_props : '',
1218
  ( $tabs ) ? implode( $tabs ) : '',
1219
+ sanitize_html_class( $div_class ),
1220
  do_shortcode( $content )
1221
  );
1222
+
1223
+ return apply_filters('bs_tabs', $output);
1224
  }
1225
 
1226
  /*--------------------------------------------------------------------------------------
1238
  'active' => false,
1239
  'fade' => false,
1240
  'xclass' => false,
1241
+ 'data' => false,
1242
+ 'link' => false
1243
  ), $atts );
1244
 
1245
  if( $GLOBALS['tabs_default_active'] && $GLOBALS['tabs_default_count'] == 0 ) {
1254
  $class .= ( $atts['xclass'] ) ? ' ' . $atts['xclass'] : '';
1255
 
1256
 
1257
+ if(!isset($atts['link']) || $atts['link'] == NULL) {
1258
+ $id = 'custom-tab-' . $GLOBALS['tabs_count'] . '-' . md5( $atts['title'] );
1259
+ } else {
1260
+ $id = $atts['link'];
1261
+ }
1262
  $data_props = $this->parse_data_attributes( $atts['data'] );
1263
 
1264
  return sprintf(
1265
  '<div id="%s" class="%s"%s>%s</div>',
1266
+ sanitize_html_class($id),
1267
  esc_attr( $class ),
1268
  ( $data_props ) ? ' ' . $data_props : '',
1269
  do_shortcode( $content )
1303
 
1304
  return sprintf(
1305
  '<div class="%s" id="%s"%s>%s</div>',
1306
+ esc_attr( $class ),
1307
+ esc_attr($id),
1308
  ( $data_props ) ? ' ' . $data_props : '',
1309
  do_shortcode( $content )
1310
  );
1321
  *
1322
  *-------------------------------------------------------------------------------------*/
1323
  function bs_collapse( $atts, $content = null ) {
1324
+
1325
+ if( isset($GLOBALS['single_collapse_count']) )
1326
+ $GLOBALS['single_collapse_count']++;
1327
+ else
1328
+ $GLOBALS['single_collapse_count'] = 0;
1329
 
1330
  $atts = shortcode_atts( array(
1331
  "title" => false,
1345
  $a_class = '';
1346
  $a_class .= ( $atts['active'] == 'true' ) ? '' : 'collapsed';
1347
 
1348
+ $parent = isset( $GLOBALS['collapsibles_count'] ) ? 'custom-collapse-' . $GLOBALS['collapsibles_count'] : 'single-collapse';
1349
+ $current_collapse = $parent . '-' . $GLOBALS['single_collapse_count'];
1350
 
1351
  $data_props = $this->parse_data_attributes( $atts['data'] );
1352
 
1354
  '<div class="%1$s"%2$s>
1355
  <div class="panel-heading">
1356
  <h4 class="panel-title">
1357
+ <a class="%3$s" data-toggle="collapse"%4$s href="#%5$s">%6$s</a>
1358
  </h4>
1359
  </div>
1360
  <div id="%5$s" class="%7$s">
1362
  </div>
1363
  </div>',
1364
  esc_attr( $panel_class ),
1365
+ ( $data_props ) ? ' ' . $data_props : '',
1366
  $a_class,
1367
+ ( $parent ) ? ' data-parent="#' . $parent . '""' : '',
1368
  $current_collapse,
1369
  $atts['title'],
1370
  esc_attr( $collapse_class ),
1463
  ), $atts );
1464
 
1465
  if( $GLOBALS['carousel_default_active'] && $GLOBALS['carousel_default_count'] == 0 ) {
1466
+ $atts['active'] = true;
1467
  }
1468
  $GLOBALS['carousel_default_count']++;
1469
 
1473
 
1474
  $data_props = $this->parse_data_attributes( $atts['data'] );
1475
 
1476
+ //$content = preg_replace('/class=".*?"/', '', $content);
1477
+ $content = preg_replace('/alignnone/', '', $content);
1478
+ $content = preg_replace('/alignright/', '', $content);
1479
+ $content = preg_replace('/alignleft/', '', $content);
1480
+ $content = preg_replace('/aligncenter/', '', $content);
1481
 
1482
  return sprintf(
1483
  '<div class="%s"%s>%s%s</div>',
1625
  $h4_class = 'media-heading';
1626
  $h4_class .= ( $atts['xclass'] ) ? ' ' . $atts['xclass'] : '';
1627
 
1628
+ $data_props = $this->parse_data_attributes( $atts['data'] );
1629
 
1630
  return sprintf(
1631
  '<div class="%s"%s><h4 class="%s">%s</h4>%s</div>',
1762
  "data" => false
1763
  ), $atts );
1764
 
1765
+ $class = '';
1766
  $class .= ( $atts['type'] ) ? 'img-' . $atts['type'] . ' ' : '';
1767
  $class .= ( $atts['responsive'] == 'true' ) ? ' img-responsive' : '';
1768
  $class .= ( $atts['xclass'] ) ? ' ' . $atts['xclass'] : '';
1775
 
1776
  }
1777
 
1778
+ /*--------------------------------------------------------------------------------------
1779
+ *
1780
+ * bs_embed_responsive
1781
+ *
1782
+ *
1783
+ *-------------------------------------------------------------------------------------*/
1784
+ function bs_embed_responsive( $atts, $content = null ) {
1785
+
1786
+ $atts = shortcode_atts( array(
1787
+ "ratio" => false,
1788
+ "xclass" => false,
1789
+ "data" => false
1790
+ ), $atts );
1791
+
1792
+ $class = 'embed-responsive ';
1793
+ $class .= ( $atts['ratio'] ) ? ' embed-responsive-' . $atts['ratio'] . ' ' : '';
1794
+ $class .= ( $atts['xclass'] ) ? ' ' . $atts['xclass'] : '';
1795
+
1796
+ $embed_class = 'embed-responsive-item';
1797
+
1798
+ $tag = array('iframe', 'embed', 'video', 'object');
1799
+ $content = do_shortcode($content);
1800
+ $data_props = $this->parse_data_attributes( $atts['data'] );
1801
+
1802
+ return sprintf(
1803
+ '<div class="%s"%s>%s</div>',
1804
+ esc_attr( $class ),
1805
+ ( $data_props ) ? ' ' . $data_props : '',
1806
+ $this->scrape_dom_element($tag, $content, $embed_class, '', '')
1807
+ );
1808
+
1809
+ }
1810
+
1811
  /*--------------------------------------------------------------------------------------
1812
  *
1813
  * bs_thumbnail
1908
  *
1909
  *-------------------------------------------------------------------------------------*/
1910
  function bs_modal( $atts, $content = null ) {
1911
+
1912
+ if( isset($GLOBALS['modal_count']) )
1913
+ $GLOBALS['modal_count']++;
1914
+ else
1915
+ $GLOBALS['modal_count'] = 0;
1916
 
1917
  $atts = shortcode_atts( array(
1918
  "text" => false,
1930
 
1931
  $div_size = ( $atts['size'] ) ? ' modal-' . $atts['size'] : '';
1932
 
1933
+ $id = 'custom-modal-' . $GLOBALS['modal_count'];
1934
 
1935
  $data_props = $this->parse_data_attributes( $atts['data'] );
1936
 
1937
+ $modal_output = sprintf(
1938
+ '<div class="%1$s" id="%2$s" tabindex="-1" role="dialog" aria-hidden="true">
1939
+ <div class="modal-dialog %3$s">
 
1940
  <div class="modal-content">
1941
  <div class="modal-header">
1942
  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
1943
+ %4$s
1944
  </div>
1945
  <div class="modal-body">
1946
+ %5$s
1947
  </div>
1948
  </div> <!-- /.modal-content -->
1949
  </div> <!-- /.modal-dialog -->
1950
+ </div> <!-- /.modal -->
1951
+ ',
 
 
 
 
1952
  esc_attr( $div_class ),
1953
+ esc_attr( $id ),
1954
  esc_attr( $div_size ),
1955
  ( $atts['title'] ) ? '<h4 class="modal-title">' . $atts['title'] . '</h4>' : '',
1956
  do_shortcode( $content )
1957
  );
1958
+
1959
+ add_action('wp_footer', function() use ($modal_output) {
1960
+ echo $modal_output;
1961
+ }, 100,0);
1962
+
1963
+ return sprintf(
1964
+ '<a data-toggle="modal" href="#%1$s" class="%2$s"%3$s>%4$s</a>',
1965
+ esc_attr( $id ),
1966
+ esc_attr( $a_class ),
1967
+ ( $data_props ) ? ' ' . $data_props : '',
1968
+ esc_html( $atts['text'] )
1969
+ );
1970
  }
1971
 
1972
  /*--------------------------------------------------------------------------------------
1990
  $data_props = $this->parse_data_attributes( $atts['data'] );
1991
 
1992
  return sprintf(
1993
+ '</div><div class="%s"%s>%s',
1994
  esc_attr( $class ),
1995
  ( $data_props ) ? ' ' . $data_props : '',
1996
  do_shortcode( $content )
2044
 
2045
  $dom->documentElement->setAttribute('class', $dom->documentElement->getAttribute('class') . ' ' . esc_attr( utf8_encode($class) ));
2046
  if( $title ) {
2047
+ $dom->documentElement->setAttribute('title', $title );
2048
  }
2049
  if( $data ) {
2050
  $data = explode( '|', $data );
2051
  foreach( $data as $d ):
2052
  $d = explode(',',$d);
2053
+ $dom->documentElement->setAttribute('data-'.$d[0],trim($d[1]));
2054
  endforeach;
2055
  }
2056
+ return utf8_decode( $dom->saveXML($dom->documentElement) );
2057
  }
2058
 
2059
  /*--------------------------------------------------------------------------------------
composer.json CHANGED
@@ -1,6 +1,5 @@
1
  {
2
  "name": "filipstefansson/bootstrap-3-shortcodes",
3
- "version": "3.2.3",
4
  "description": "WordPress shortcodes for easier use of Bootstrap elements in your content.",
5
  "keywords": [
6
  "bootstrap",
1
  {
2
  "name": "filipstefansson/bootstrap-3-shortcodes",
 
3
  "description": "WordPress shortcodes for easier use of Bootstrap elements in your content.",
4
  "keywords": [
5
  "bootstrap",
includes/actions-filters.php CHANGED
@@ -53,12 +53,12 @@ function add_bootstrap_button() {
53
  // Create a Media Button for the help file
54
  //add a button to the content editor, next to the media button
55
  //this button will show a popup that contains inline content
56
- if(in_array(basename($_SERVER['PHP_SELF']), array('post.php', 'page.php', 'page-new.php', 'post-new.php', 'widgets.php'))) {
57
  add_action('media_buttons', 'add_bootstrap_button', 11);
58
  add_action( 'media_buttons', 'bootstrap_shortcodes_help_styles' );
59
  }
60
  function boostrap_shortcodes_help() {
61
- include('bootstrap-shortcodes-help.php');
62
  }
63
  add_action( 'admin_footer', 'boostrap_shortcodes_help' );
64
 
53
  // Create a Media Button for the help file
54
  //add a button to the content editor, next to the media button
55
  //this button will show a popup that contains inline content
56
+ if(in_array(basename($_SERVER['PHP_SELF']), array('post.php', 'page.php', 'page-new.php', 'post-new.php', 'widgets.php', 'admin-ajax.php'))) {
57
  add_action('media_buttons', 'add_bootstrap_button', 11);
58
  add_action( 'media_buttons', 'bootstrap_shortcodes_help_styles' );
59
  }
60
  function boostrap_shortcodes_help() {
61
+ include( BS_SHORTCODES_DIR . 'bootstrap-shortcodes-help.php');
62
  }
63
  add_action( 'admin_footer', 'boostrap_shortcodes_help' );
64
 
includes/help/README.html CHANGED
@@ -2,7 +2,7 @@
2
  <p>WordPress plugin that provides shortcodes for easier use of the Bootstrap styles and components in your content.</p>
3
  <h2 id="requirements">Requirements</h2>
4
  <p>This plugin won&#39;t do anything if you don&#39;t have WordPress theme built with the <a href="http://getbootstrap.com/">Bootstrap</a> framework. <strong>This plugin does not include the Bootstrap framework</strong>.</p>
5
- <p>The plugin is tested to work with <code>Bootstrap 3.2</code> and <code>WordPress 4.0</code>.</p>
6
  <p>This plugin contains a <code>composer.json</code> file for those of you who manage your PHP dependencies with <a href="https://getcomposer.org">Composer</a>.</p>
7
  <h2 id="shortcode-reference">Shortcode Reference</h2>
8
  <h3 id="css">CSS</h3>
@@ -14,6 +14,7 @@
14
  <li><a href="#tables">Tables</a></li>
15
  <li><a href="#buttons">Buttons</a></li>
16
  <li><a href="#images">Images</a></li>
 
17
  <li><a href="#responsive-utilities">Responsive utilities</a></li>
18
  </ul>
19
  <h3 id="components">Components</h3>
@@ -54,8 +55,8 @@
54
  [column md=&quot;6&quot;]
55
  ...
56
  [/column]
57
- [/row]</code></pre>
58
- <p>The container component is also supported in case your theme doesn&#39;t incude a container.</p>
59
  <pre><code>[container]
60
  [row]
61
  [column md=&quot;6&quot;]
@@ -65,8 +66,8 @@
65
  ...
66
  [/column]
67
  [/row]
68
- [/container]</code></pre>
69
- <h4 id="-container-parameters">[container] parameters</h4>
70
  <table>
71
  <thead>
72
  <tr>
@@ -272,8 +273,8 @@
272
  <p><a href="http://getbootstrap.com/css/#grid">Bootstrap grid documentation</a>.</p>
273
  <hr>
274
  <h3 id="lead-body-copy">Lead body copy</h3>
275
- <pre><code>[lead] ... [/lead]</code></pre>
276
- <h4 id="-lead-parameters">[lead] parameters</h4>
277
  <table>
278
  <thead>
279
  <tr>
@@ -304,8 +305,8 @@
304
  <p><a href="http://getbootstrap.com/css/#type-body-copy">Bootstrap body copy documentation</a></p>
305
  <hr>
306
  <h3 id="emphasis-classes">Emphasis classes</h3>
307
- <pre><code>[emphasis type=&quot;success&quot;] ... [/emphasis]</code></pre>
308
- <h4 id="-emphasis-parameters">[emphasis] parameters</h4>
309
  <table>
310
  <thead>
311
  <tr>
@@ -343,8 +344,8 @@
343
  <p><a href="http://getbootstrap.com/css/#type-emphasis">Bootstrap emphasis classes documentation</a></p>
344
  <hr>
345
  <h3 id="code">Code</h3>
346
- <pre><code>[code] ... [/code]</code></pre>
347
- <h4 id="-code-parameters">[code] parameters</h4>
348
  <table>
349
  <thead>
350
  <tr>
@@ -393,8 +394,8 @@
393
 
394
  Standard HTML table code goes here.
395
 
396
- [/table-wrap]</code></pre>
397
- <h4 id="-table-wrap-parameters">[table-wrap] parameters</h4>
398
  <table>
399
  <thead>
400
  <tr>
@@ -436,7 +437,7 @@
436
  </tr>
437
  <tr>
438
  <td>responsive</td>
439
- <td>Wrap the table in a div with the class &quot;table-responsive&quot; (see Bootstrap documentation)</td>
440
  <td>optional</td>
441
  <td>true, false</td>
442
  <td>false</td>
@@ -460,8 +461,8 @@
460
  <p><a href="http://getbootstrap.com/css/#tables">Bootstrap table documentation</a></p>
461
  <hr>
462
  <h3 id="buttons">Buttons</h3>
463
- <pre><code>[button type=&quot;success&quot; size=&quot;lg&quot; link=&quot;#&quot;] ... [/button]</code></pre>
464
- <h4 id="-button-parameters">[button] parameters</h4>
465
  <table>
466
  <thead>
467
  <tr>
@@ -548,8 +549,8 @@
548
  <p><a href="http://getbootstrap.com/css/#buttons">Bootstrap button documentation</a></p>
549
  <hr>
550
  <h3 id="images">Images</h3>
551
- <pre><code>[img type=&quot;circle&quot; responsive=&quot;true&quot;] ... [/img]</code></pre>
552
- <p>Wrap any number of HTML image tags or images inserted via the WordPress media manager.</p>
553
  <h4 id="-img-parameters">[img] parameters</h4>
554
  <table>
555
  <thead>
@@ -594,9 +595,49 @@
594
  </table>
595
  <p><a href="http://getbootstrap.com/css/#images">Bootstrap images documentation</a></p>
596
  <hr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
597
  <h3 id="responsive-utilities">Responsive Utilities</h3>
598
- <pre><code>[responsive block=&quot;lg md&quot; hidden=&quot;sn xs&quot;] ... [/responsive]</code></pre>
599
- <h4 id="-reponsive-parameters">[reponsive] parameters</h4>
600
  <table>
601
  <thead>
602
  <tr>
@@ -663,8 +704,8 @@
663
  <hr>
664
  <h3 id="components">Components</h3>
665
  <h3 id="icons">Icons</h3>
666
- <pre><code>[icon type=&quot;arrow-right&quot;]</code></pre>
667
- <h4 id="-icon-parameters">[icon] parameters</h4>
668
  <table>
669
  <thead>
670
  <tr>
@@ -707,8 +748,8 @@
707
  [button link=&quot;#&quot;] ... [/button]
708
  [button link=&quot;#&quot;] ... [/button]
709
  [button link=&quot;#&quot;] ... [/button]
710
- [/button-group]</code></pre>
711
- <h4 id="button-toolbar">Button toolbar</h4>
712
  <pre><code>[button-toolbar]
713
  [button-group]
714
  [button link=&quot;#&quot;] ... [/button]
@@ -723,8 +764,8 @@
723
  [button-group]
724
  [button link=&quot;#&quot;] ... [/button]
725
  [/button-group]
726
- [/button-toolbar]</code></pre>
727
- <h4 id="-button-group-parameters">[button-group] parameters</h4>
728
  <table>
729
  <thead>
730
  <tr>
@@ -823,8 +864,8 @@
823
  [divider]
824
  [dropdown-item link=&quot;#&quot;] ... [/dropdown-item]
825
  [/dropdown]
826
- [/button-group]</code></pre>
827
- <h4 id="split-button-dropdowns">Split button dropdowns</h4>
828
  <pre><code>[button-group]
829
  [button link=&quot;#&quot;] ... [/button]
830
  [button dropdown=&quot;true&quot; data=&quot;toggle,dropdown&quot;][caret][/button]
@@ -833,8 +874,8 @@
833
  [divider]
834
  [dropdown-item link=&quot;#&quot;] ... [/dropdown-item]
835
  [/dropdown]
836
- [/button-group]</code></pre>
837
- <h4 id="dropup-variation">Dropup variation</h4>
838
  <pre><code>[button-group dropup=&quot;true&quot;]
839
  [button link=&quot;#&quot;] ... [/button]
840
  [button dropdown=&quot;true&quot; data=&quot;toggle,dropdown&quot;][caret][/button]
@@ -843,8 +884,8 @@
843
  [divider]
844
  [dropdown-item link=&quot;#&quot;] ... [/dropdown-item]
845
  [/dropdown]
846
- [/button-group] </code></pre>
847
- <h4 id="-dropdown-parameters">[dropdown] parameters</h4>
848
  <table>
849
  <thead>
850
  <tr>
@@ -1005,8 +1046,8 @@
1005
  [nav-item link=&quot;#&quot;] ... [/nav-item]
1006
  [nav-item link=&quot;#&quot;] ... [/nav-item]
1007
  [nav-item link=&quot;#&quot;] ... [/nav-item]
1008
- [/nav]</code></pre>
1009
- <h4 id="nav-with-dropdowns">Nav with dropdowns</h4>
1010
  <pre><code>[nav type=&quot;pills&quot;]
1011
  [nav-item link=&quot;#&quot; active=&quot;true&quot;] ... [/nav-item]
1012
  [nav-item dropdown=&quot;true&quot; link=&quot;#&quot;] ... [caret]
@@ -1015,8 +1056,8 @@
1015
  [dropdown-item link=&quot;#&quot;] ... [/dropdown-item]
1016
  [/dropdown]
1017
  [/nav-item]
1018
- [/nav]</code></pre>
1019
- <h4 id="-nav-parameters">[nav] parameters</h4>
1020
  <table>
1021
  <thead>
1022
  <tr>
@@ -1121,8 +1162,8 @@
1121
  [breadcrumb-item link=&quot;#&quot;] ... [/breadcrumb-item]
1122
  [breadcrumb-item link=&quot;#&quot;] ... [/breadcrumb-item]
1123
  [breadcrumb-item link=&quot;#&quot;] ... [/breadcrumb-item]
1124
- [/breadcrumb]</code></pre>
1125
- <h4 id="-breadcrumb-parameters">[breadcrumb] parameters</h4>
1126
  <table>
1127
  <thead>
1128
  <tr>
@@ -1188,8 +1229,8 @@
1188
  <p><a href="http://getbootstrap.com/components/#breadcrumbs">Bootstrap breadcrumbs documentation</a></p>
1189
  <hr>
1190
  <h3 id="labels">Labels</h3>
1191
- <pre><code>[label type=&quot;success&quot;] ... [/label]</code></pre>
1192
- <h4 id="-label-parameters">[label] parameters</h4>
1193
  <table>
1194
  <thead>
1195
  <tr>
@@ -1227,8 +1268,8 @@
1227
  <p><a href="http://getbootstrap.com/components/#labels">Bootstrap label documentation</a></p>
1228
  <hr>
1229
  <h3 id="badges">Badges</h3>
1230
- <pre><code>[badge right=&quot;true&quot;] ... [/badge]</code></pre>
1231
- <h4 id="-badge-parameters">[badge] parameters</h4>
1232
  <table>
1233
  <thead>
1234
  <tr>
@@ -1266,8 +1307,8 @@
1266
  <p><a href="http://getbootstrap.com/components/#badges">Bootstrap badges documentation</a></p>
1267
  <hr>
1268
  <h3 id="jumbotron">Jumbotron</h3>
1269
- <pre><code>[jumbotron title=&quot;My Jumbotron&quot;] ... [/jumbotron]</code></pre>
1270
- <h4 id="-jumbotron-parameters">[jumbotron] parameters</h4>
1271
  <table>
1272
  <thead>
1273
  <tr>
@@ -1305,8 +1346,8 @@
1305
  <p><a href="http://getbootstrap.com/components/#jumbotron">Bootstrap jumbotron documentation</a></p>
1306
  <hr>
1307
  <h3 id="page-header">Page Header</h3>
1308
- <pre><code>[page-header] ... [/page-header]</code></pre>
1309
- <p>Automatically inserts H1 tag if not present</p>
1310
  <h4 id="-page-header-parameters">[page-header] parameters</h4>
1311
  <table>
1312
  <thead>
@@ -1340,8 +1381,8 @@
1340
  <h3 id="thumbnails">Thumbnails</h3>
1341
  <pre><code>[thumbnail] ... [/thumbnail]
1342
  [thumbnail] ... [/thumbnail]
1343
- [thumbnail] ... [/thumbnail]</code></pre>
1344
- <h4 id="-thumbnail-parameters">[thumbnail] parameters</h4>
1345
  <table>
1346
  <thead>
1347
  <tr>
@@ -1379,8 +1420,8 @@
1379
  <p><a href="http://getbootstrap.com/components/#thumbnails">Bootstrap thumbnails documentation</a></p>
1380
  <hr>
1381
  <h3 id="alerts">Alerts</h3>
1382
- <pre><code>[alert type=&quot;success&quot;] ... [/alert]</code></pre>
1383
- <h4 id="-alert-parameters">[alert] parameters</h4>
1384
  <table>
1385
  <thead>
1386
  <tr>
@@ -1428,8 +1469,8 @@
1428
  <pre><code>[progress striped=&quot;true&quot;]
1429
  [progress-bar percent=&quot;50&quot;]
1430
  [progress-bar percent=&quot;25&quot; type=&quot;success&quot;]
1431
- [/progress]</code></pre>
1432
- <h4 id="-progress-parameters">[progress] parameters</h4>
1433
  <table>
1434
  <thead>
1435
  <tr>
@@ -1530,8 +1571,8 @@
1530
  [media-body title=&quot;Testing&quot;]
1531
  ...
1532
  [/media-body]
1533
- [/media]</code></pre>
1534
- <h4 id="-media-parameters">[media] parameters</h4>
1535
  <table>
1536
  <thead>
1537
  <tr>
@@ -1651,8 +1692,8 @@
1651
  [list-group-item]
1652
  ...
1653
  [/list-group-item]
1654
- [/list-group]</code></pre>
1655
- <h4 id="linked-items">Linked Items</h4>
1656
  <pre><code>[list-group linked=&quot;true&quot;]
1657
  [list-group-item link=&quot;#&quot; active=&quot;true&quot;]
1658
  ...
@@ -1663,8 +1704,8 @@
1663
  [list-group-item link=&quot;#&quot;]
1664
  ...
1665
  [/list-group-item]
1666
- [/list-group]</code></pre>
1667
- <h4 id="custom-content">Custom Content</h4>
1668
  <pre><code>[list-group linked=&quot;true&quot;]
1669
  [list-group-item link=&quot;#&quot; active=&quot;true&quot;]
1670
  [list-group-item-heading]...[/list-group-item-heading]
@@ -1678,8 +1719,8 @@
1678
  [list-group-item-heading]...[/list-group-item-heading]
1679
  [list-group-item-text]...[/list-group-item-text]
1680
  [/list-group-item]
1681
- [/list-group]</code></pre>
1682
- <h4 id="-list-group-parameters">[list-group] parameters</h4>
1683
  <table>
1684
  <thead>
1685
  <tr>
@@ -1829,8 +1870,8 @@
1829
  <p><a href="http://getbootstrap.com/components/#list-group">Bootstrap list groups documentation</a></p>
1830
  <hr>
1831
  <h3 id="panels">Panels</h3>
1832
- <pre><code>[panel type=&quot;info&quot; heading=&quot;Panel Title&quot; footer=&quot;Footer text&quot;] ... [/panel]</code></pre>
1833
- <h4 id="-panel-parameters">[panel] parameters</h4>
1834
  <table>
1835
  <thead>
1836
  <tr>
@@ -1889,8 +1930,8 @@
1889
  <p><a href="http://getbootstrap.com/components/#panels">Bootstrap panels documentation</a></p>
1890
  <hr>
1891
  <h3 id="wells">Wells</h3>
1892
- <pre><code>[well size=&quot;sm&quot;] ... [/well]</code></pre>
1893
- <h4 id="-well-parameters">[well] parameters</h4>
1894
  <table>
1895
  <thead>
1896
  <tr>
@@ -1939,8 +1980,8 @@
1939
  [tab title=&quot;Messages&quot;]
1940
  ...
1941
  [/tab]
1942
- [/tabs]</code></pre>
1943
- <h4 id="-tabs-parameters">[tabs] parameters</h4>
1944
  <table>
1945
  <thead>
1946
  <tr>
@@ -2027,8 +2068,8 @@
2027
  <p><a href="http://getbootstrap.com/javascript/#tabs">Bootstrap tabs documentation</a></p>
2028
  <hr>
2029
  <h3 id="tooltip">Tooltip</h3>
2030
- <pre><code>[tooltip title=&quot;I&#39;m the title&quot; placement=&quot;right&quot;] ... [/tooltip]</code></pre>
2031
- <h4 id="-tooltip-parameters">[tooltip] parameters</h4>
2032
  <table>
2033
  <thead>
2034
  <tr>
@@ -2073,8 +2114,8 @@
2073
  <p><a href="http://getbootstrap.com/javascript/#tooltips">Bootstrap tooltip documentation</a></p>
2074
  <hr>
2075
  <h3 id="popover">Popover</h3>
2076
- <pre><code>[popover title=&quot;I&#39;m the title&quot; text=&quot;And here&#39;s some amazing content. It&#39;s very engaging. right?&quot; placement=&quot;right&quot;] ... [/popover]</code></pre>
2077
- <h4 id="-popover-parameters">[popover] parameters</h4>
2078
  <table>
2079
  <thead>
2080
  <tr>
@@ -2126,6 +2167,11 @@
2126
  <p><a href="http://getbootstrap.com/javascript/#popovers">Bootstrap popover documentation</a></p>
2127
  <hr>
2128
  <h3 id="collapse">Collapse</h3>
 
 
 
 
 
2129
  <pre><code>[collapsibles]
2130
  [collapse title=&quot;Collapse 1&quot; active=&quot;true&quot;]
2131
  ...
@@ -2136,8 +2182,8 @@
2136
  [collapse title=&quot;Collapse 3&quot;]
2137
  ...
2138
  [/collapse]
2139
- [/collapsibles]</code></pre>
2140
- <h4 id="-collapsibles-parameters">[collapsibles] parameters</h4>
2141
  <table>
2142
  <thead>
2143
  <tr>
@@ -2221,8 +2267,8 @@
2221
  [carousel-item active=&quot;true&quot;] ... [/carousel-item]
2222
  [carousel-item] ... [/carousel-item]
2223
  [carousel-item] ... [/carousel-item]
2224
- [/carousel]</code></pre>
2225
- <p>[carousel-item] wraps an HTML image tag or image inserted via the WordPress editor.</p>
2226
  <h4 id="-carousel-parameters">[carousel] parameters</h4>
2227
  <table>
2228
  <thead>
@@ -2315,8 +2361,8 @@
2315
  [modal-footer]
2316
  [button type=&quot;primary&quot; link=&quot;#&quot; data=&quot;dismiss,modal&quot;]Dismiss[/button]
2317
  [/modal-footer]
2318
- [/modal]</code></pre>
2319
- <h4 id="-modal-parameters">[modal] parameters</h4>
2320
  <table>
2321
  <thead>
2322
  <tr>
2
  <p>WordPress plugin that provides shortcodes for easier use of the Bootstrap styles and components in your content.</p>
3
  <h2 id="requirements">Requirements</h2>
4
  <p>This plugin won&#39;t do anything if you don&#39;t have WordPress theme built with the <a href="http://getbootstrap.com/">Bootstrap</a> framework. <strong>This plugin does not include the Bootstrap framework</strong>.</p>
5
+ <p>The plugin is tested to work with <code>Bootstrap 3</code> and <code>WordPress 4</code>.</p>
6
  <p>This plugin contains a <code>composer.json</code> file for those of you who manage your PHP dependencies with <a href="https://getcomposer.org">Composer</a>.</p>
7
  <h2 id="shortcode-reference">Shortcode Reference</h2>
8
  <h3 id="css">CSS</h3>
14
  <li><a href="#tables">Tables</a></li>
15
  <li><a href="#buttons">Buttons</a></li>
16
  <li><a href="#images">Images</a></li>
17
+ <li><a href="#responsive-embeds">Responsive Embeds</a></li>
18
  <li><a href="#responsive-utilities">Responsive utilities</a></li>
19
  </ul>
20
  <h3 id="components">Components</h3>
55
  [column md=&quot;6&quot;]
56
  ...
57
  [/column]
58
+ [/row]
59
+ </code></pre><p>The container component is also supported in case your theme doesn&#39;t incude a container.</p>
60
  <pre><code>[container]
61
  [row]
62
  [column md=&quot;6&quot;]
66
  ...
67
  [/column]
68
  [/row]
69
+ [/container]
70
+ </code></pre><h4 id="-container-parameters">[container] parameters</h4>
71
  <table>
72
  <thead>
73
  <tr>
273
  <p><a href="http://getbootstrap.com/css/#grid">Bootstrap grid documentation</a>.</p>
274
  <hr>
275
  <h3 id="lead-body-copy">Lead body copy</h3>
276
+ <pre><code>[lead] ... [/lead]
277
+ </code></pre><h4 id="-lead-parameters">[lead] parameters</h4>
278
  <table>
279
  <thead>
280
  <tr>
305
  <p><a href="http://getbootstrap.com/css/#type-body-copy">Bootstrap body copy documentation</a></p>
306
  <hr>
307
  <h3 id="emphasis-classes">Emphasis classes</h3>
308
+ <pre><code>[emphasis type=&quot;success&quot;] ... [/emphasis]
309
+ </code></pre><h4 id="-emphasis-parameters">[emphasis] parameters</h4>
310
  <table>
311
  <thead>
312
  <tr>
344
  <p><a href="http://getbootstrap.com/css/#type-emphasis">Bootstrap emphasis classes documentation</a></p>
345
  <hr>
346
  <h3 id="code">Code</h3>
347
+ <pre><code>[code] ... [/code]
348
+ </code></pre><h4 id="-code-parameters">[code] parameters</h4>
349
  <table>
350
  <thead>
351
  <tr>
394
 
395
  Standard HTML table code goes here.
396
 
397
+ [/table-wrap]
398
+ </code></pre><h4 id="-table-wrap-parameters">[table-wrap] parameters</h4>
399
  <table>
400
  <thead>
401
  <tr>
437
  </tr>
438
  <tr>
439
  <td>responsive</td>
440
+ <td>Wrap the table in a div with the class &quot;table-respsonve&quot; (see Bootstrap documentation)</td>
441
  <td>optional</td>
442
  <td>true, false</td>
443
  <td>false</td>
461
  <p><a href="http://getbootstrap.com/css/#tables">Bootstrap table documentation</a></p>
462
  <hr>
463
  <h3 id="buttons">Buttons</h3>
464
+ <pre><code>[button type=&quot;success&quot; size=&quot;lg&quot; link=&quot;#&quot;] ... [/button]
465
+ </code></pre><h4 id="-button-parameters">[button] parameters</h4>
466
  <table>
467
  <thead>
468
  <tr>
549
  <p><a href="http://getbootstrap.com/css/#buttons">Bootstrap button documentation</a></p>
550
  <hr>
551
  <h3 id="images">Images</h3>
552
+ <pre><code>[img type=&quot;circle&quot; responsive=&quot;true&quot;] ... [/img]
553
+ </code></pre><p>Wrap any number of HTML image tags or images inserted via the WordPress media manager.</p>
554
  <h4 id="-img-parameters">[img] parameters</h4>
555
  <table>
556
  <thead>
595
  </table>
596
  <p><a href="http://getbootstrap.com/css/#images">Bootstrap images documentation</a></p>
597
  <hr>
598
+ <h3 id="responsive-embeds">Responsive Embeds</h3>
599
+ <pre><code>[embed-responsive ratio=&quot;16by9&quot;] ... [/embed-responsive]
600
+ </code></pre><p>Wrap <code>&lt;iframe&gt;</code>, <code>&lt;embed&gt;</code>, <code>&lt;video&gt;</code>, and <code>&lt;object&gt;</code> elements to make them responsive.</p>
601
+ <h4 id="-responsive-embed-parameters">[responsive-embed] parameters</h4>
602
+ <table>
603
+ <thead>
604
+ <tr>
605
+ <th>Parameter</th>
606
+ <th>Description</th>
607
+ <th>Required</th>
608
+ <th>Values</th>
609
+ <th>Default</th>
610
+ </tr>
611
+ </thead>
612
+ <tbody>
613
+ <tr>
614
+ <td>ratio</td>
615
+ <td>Maintain the aspect ratio of the embed</td>
616
+ <td>optional</td>
617
+ <td>16by9, 4by3</td>
618
+ <td>false</td>
619
+ </tr>
620
+ <tr>
621
+ <td>xclass</td>
622
+ <td>Any extra classes you want to add</td>
623
+ <td>optional</td>
624
+ <td>any text</td>
625
+ <td>none</td>
626
+ </tr>
627
+ <tr>
628
+ <td>data</td>
629
+ <td>Data attribute and value pairs separated by a comma. Pairs separated by pipe (see example at <a href="#button-dropdowns">Button Dropdowns</a>).</td>
630
+ <td>optional</td>
631
+ <td>any text</td>
632
+ <td>none</td>
633
+ </tr>
634
+ </tbody>
635
+ </table>
636
+ <p><a href="http://getbootstrap.com/components/#responsive-embed">Bootstrap responsive embed documentation</a></p>
637
+ <hr>
638
  <h3 id="responsive-utilities">Responsive Utilities</h3>
639
+ <pre><code>[responsive block=&quot;lg md&quot; hidden=&quot;sn xs&quot;] ... [/responsive]
640
+ </code></pre><h4 id="-reponsive-parameters">[reponsive] parameters</h4>
641
  <table>
642
  <thead>
643
  <tr>
704
  <hr>
705
  <h3 id="components">Components</h3>
706
  <h3 id="icons">Icons</h3>
707
+ <pre><code>[icon type=&quot;arrow-right&quot;]
708
+ </code></pre><h4 id="-icon-parameters">[icon] parameters</h4>
709
  <table>
710
  <thead>
711
  <tr>
748
  [button link=&quot;#&quot;] ... [/button]
749
  [button link=&quot;#&quot;] ... [/button]
750
  [button link=&quot;#&quot;] ... [/button]
751
+ [/button-group]
752
+ </code></pre><h4 id="button-toolbar">Button toolbar</h4>
753
  <pre><code>[button-toolbar]
754
  [button-group]
755
  [button link=&quot;#&quot;] ... [/button]
764
  [button-group]
765
  [button link=&quot;#&quot;] ... [/button]
766
  [/button-group]
767
+ [/button-toolbar]
768
+ </code></pre><h4 id="-button-group-parameters">[button-group] parameters</h4>
769
  <table>
770
  <thead>
771
  <tr>
864
  [divider]
865
  [dropdown-item link=&quot;#&quot;] ... [/dropdown-item]
866
  [/dropdown]
867
+ [/button-group]
868
+ </code></pre><h4 id="split-button-dropdowns">Split button dropdowns</h4>
869
  <pre><code>[button-group]
870
  [button link=&quot;#&quot;] ... [/button]
871
  [button dropdown=&quot;true&quot; data=&quot;toggle,dropdown&quot;][caret][/button]
874
  [divider]
875
  [dropdown-item link=&quot;#&quot;] ... [/dropdown-item]
876
  [/dropdown]
877
+ [/button-group]
878
+ </code></pre><h4 id="dropup-variation">Dropup variation</h4>
879
  <pre><code>[button-group dropup=&quot;true&quot;]
880
  [button link=&quot;#&quot;] ... [/button]
881
  [button dropdown=&quot;true&quot; data=&quot;toggle,dropdown&quot;][caret][/button]
884
  [divider]
885
  [dropdown-item link=&quot;#&quot;] ... [/dropdown-item]
886
  [/dropdown]
887
+ [/button-group]
888
+ </code></pre><h4 id="-dropdown-parameters">[dropdown] parameters</h4>
889
  <table>
890
  <thead>
891
  <tr>
1046
  [nav-item link=&quot;#&quot;] ... [/nav-item]
1047
  [nav-item link=&quot;#&quot;] ... [/nav-item]
1048
  [nav-item link=&quot;#&quot;] ... [/nav-item]
1049
+ [/nav]
1050
+ </code></pre><h4 id="nav-with-dropdowns">Nav with dropdowns</h4>
1051
  <pre><code>[nav type=&quot;pills&quot;]
1052
  [nav-item link=&quot;#&quot; active=&quot;true&quot;] ... [/nav-item]
1053
  [nav-item dropdown=&quot;true&quot; link=&quot;#&quot;] ... [caret]
1056
  [dropdown-item link=&quot;#&quot;] ... [/dropdown-item]
1057
  [/dropdown]
1058
  [/nav-item]
1059
+ [/nav]
1060
+ </code></pre><h4 id="-nav-parameters">[nav] parameters</h4>
1061
  <table>
1062
  <thead>
1063
  <tr>
1162
  [breadcrumb-item link=&quot;#&quot;] ... [/breadcrumb-item]
1163
  [breadcrumb-item link=&quot;#&quot;] ... [/breadcrumb-item]
1164
  [breadcrumb-item link=&quot;#&quot;] ... [/breadcrumb-item]
1165
+ [/breadcrumb]
1166
+ </code></pre><h4 id="-breadcrumb-parameters">[breadcrumb] parameters</h4>
1167
  <table>
1168
  <thead>
1169
  <tr>
1229
  <p><a href="http://getbootstrap.com/components/#breadcrumbs">Bootstrap breadcrumbs documentation</a></p>
1230
  <hr>
1231
  <h3 id="labels">Labels</h3>
1232
+ <pre><code>[label type=&quot;success&quot;] ... [/label]
1233
+ </code></pre><h4 id="-label-parameters">[label] parameters</h4>
1234
  <table>
1235
  <thead>
1236
  <tr>
1268
  <p><a href="http://getbootstrap.com/components/#labels">Bootstrap label documentation</a></p>
1269
  <hr>
1270
  <h3 id="badges">Badges</h3>
1271
+ <pre><code>[badge right=&quot;true&quot;] ... [/badge]
1272
+ </code></pre><h4 id="-badge-parameters">[badge] parameters</h4>
1273
  <table>
1274
  <thead>
1275
  <tr>
1307
  <p><a href="http://getbootstrap.com/components/#badges">Bootstrap badges documentation</a></p>
1308
  <hr>
1309
  <h3 id="jumbotron">Jumbotron</h3>
1310
+ <pre><code>[jumbotron title=&quot;My Jumbotron&quot;] ... [/jumbotron]
1311
+ </code></pre><h4 id="-jumbotron-parameters">[jumbotron] parameters</h4>
1312
  <table>
1313
  <thead>
1314
  <tr>
1346
  <p><a href="http://getbootstrap.com/components/#jumbotron">Bootstrap jumbotron documentation</a></p>
1347
  <hr>
1348
  <h3 id="page-header">Page Header</h3>
1349
+ <pre><code>[page-header] ... [/page-header]
1350
+ </code></pre><p>Automatically inserts H1 tag if not present</p>
1351
  <h4 id="-page-header-parameters">[page-header] parameters</h4>
1352
  <table>
1353
  <thead>
1381
  <h3 id="thumbnails">Thumbnails</h3>
1382
  <pre><code>[thumbnail] ... [/thumbnail]
1383
  [thumbnail] ... [/thumbnail]
1384
+ [thumbnail] ... [/thumbnail]
1385
+ </code></pre><h4 id="-thumbnail-parameters">[thumbnail] parameters</h4>
1386
  <table>
1387
  <thead>
1388
  <tr>
1420
  <p><a href="http://getbootstrap.com/components/#thumbnails">Bootstrap thumbnails documentation</a></p>
1421
  <hr>
1422
  <h3 id="alerts">Alerts</h3>
1423
+ <pre><code>[alert type=&quot;success&quot;] ... [/alert]
1424
+ </code></pre><h4 id="-alert-parameters">[alert] parameters</h4>
1425
  <table>
1426
  <thead>
1427
  <tr>
1469
  <pre><code>[progress striped=&quot;true&quot;]
1470
  [progress-bar percent=&quot;50&quot;]
1471
  [progress-bar percent=&quot;25&quot; type=&quot;success&quot;]
1472
+ [/progress]
1473
+ </code></pre><h4 id="-progress-parameters">[progress] parameters</h4>
1474
  <table>
1475
  <thead>
1476
  <tr>
1571
  [media-body title=&quot;Testing&quot;]
1572
  ...
1573
  [/media-body]
1574
+ [/media]
1575
+ </code></pre><h4 id="-media-parameters">[media] parameters</h4>
1576
  <table>
1577
  <thead>
1578
  <tr>
1692
  [list-group-item]
1693
  ...
1694
  [/list-group-item]
1695
+ [/list-group]
1696
+ </code></pre><h4 id="linked-items">Linked Items</h4>
1697
  <pre><code>[list-group linked=&quot;true&quot;]
1698
  [list-group-item link=&quot;#&quot; active=&quot;true&quot;]
1699
  ...
1704
  [list-group-item link=&quot;#&quot;]
1705
  ...
1706
  [/list-group-item]
1707
+ [/list-group]
1708
+ </code></pre><h4 id="custom-content">Custom Content</h4>
1709
  <pre><code>[list-group linked=&quot;true&quot;]
1710
  [list-group-item link=&quot;#&quot; active=&quot;true&quot;]
1711
  [list-group-item-heading]...[/list-group-item-heading]
1719
  [list-group-item-heading]...[/list-group-item-heading]
1720
  [list-group-item-text]...[/list-group-item-text]
1721
  [/list-group-item]
1722
+ [/list-group]
1723
+ </code></pre><h4 id="-list-group-parameters">[list-group] parameters</h4>
1724
  <table>
1725
  <thead>
1726
  <tr>
1870
  <p><a href="http://getbootstrap.com/components/#list-group">Bootstrap list groups documentation</a></p>
1871
  <hr>
1872
  <h3 id="panels">Panels</h3>
1873
+ <pre><code>[panel type=&quot;info&quot; heading=&quot;Panel Title&quot; footer=&quot;Footer text&quot;] ... [/panel]
1874
+ </code></pre><h4 id="-panel-parameters">[panel] parameters</h4>
1875
  <table>
1876
  <thead>
1877
  <tr>
1930
  <p><a href="http://getbootstrap.com/components/#panels">Bootstrap panels documentation</a></p>
1931
  <hr>
1932
  <h3 id="wells">Wells</h3>
1933
+ <pre><code>[well size=&quot;sm&quot;] ... [/well]
1934
+ </code></pre><h4 id="-well-parameters">[well] parameters</h4>
1935
  <table>
1936
  <thead>
1937
  <tr>
1980
  [tab title=&quot;Messages&quot;]
1981
  ...
1982
  [/tab]
1983
+ [/tabs]
1984
+ </code></pre><h4 id="-tabs-parameters">[tabs] parameters</h4>
1985
  <table>
1986
  <thead>
1987
  <tr>
2068
  <p><a href="http://getbootstrap.com/javascript/#tabs">Bootstrap tabs documentation</a></p>
2069
  <hr>
2070
  <h3 id="tooltip">Tooltip</h3>
2071
+ <pre><code>[tooltip title=&quot;I&#39;m the title&quot; placement=&quot;right&quot;] ... [/tooltip]
2072
+ </code></pre><h4 id="-tooltip-parameters">[tooltip] parameters</h4>
2073
  <table>
2074
  <thead>
2075
  <tr>
2114
  <p><a href="http://getbootstrap.com/javascript/#tooltips">Bootstrap tooltip documentation</a></p>
2115
  <hr>
2116
  <h3 id="popover">Popover</h3>
2117
+ <pre><code>[popover title=&quot;I&#39;m the title&quot; text=&quot;And here&#39;s some amazing content. It&#39;s very engaging. right?&quot; placement=&quot;right&quot;] ... [/popover]
2118
+ </code></pre><h4 id="-popover-parameters">[popover] parameters</h4>
2119
  <table>
2120
  <thead>
2121
  <tr>
2167
  <p><a href="http://getbootstrap.com/javascript/#popovers">Bootstrap popover documentation</a></p>
2168
  <hr>
2169
  <h3 id="collapse">Collapse</h3>
2170
+ <h4 id="single-collapse">Single Collapse</h4>
2171
+ <pre><code> [collapse title=&quot;Collapse 1&quot; active=&quot;true&quot;]
2172
+ ...
2173
+ [/collapse]
2174
+ </code></pre><h4 id="set-of-collapsibles">Set of Collapsibles</h4>
2175
  <pre><code>[collapsibles]
2176
  [collapse title=&quot;Collapse 1&quot; active=&quot;true&quot;]
2177
  ...
2182
  [collapse title=&quot;Collapse 3&quot;]
2183
  ...
2184
  [/collapse]
2185
+ [/collapsibles]
2186
+ </code></pre><h4 id="-collapsibles-parameters">[collapsibles] parameters</h4>
2187
  <table>
2188
  <thead>
2189
  <tr>
2267
  [carousel-item active=&quot;true&quot;] ... [/carousel-item]
2268
  [carousel-item] ... [/carousel-item]
2269
  [carousel-item] ... [/carousel-item]
2270
+ [/carousel]
2271
+ </code></pre><p>[carousel-item] wraps an HTML image tag or image inserted via the WordPress editor.</p>
2272
  <h4 id="-carousel-parameters">[carousel] parameters</h4>
2273
  <table>
2274
  <thead>
2361
  [modal-footer]
2362
  [button type=&quot;primary&quot; link=&quot;#&quot; data=&quot;dismiss,modal&quot;]Dismiss[/button]
2363
  [/modal-footer]
2364
+ [/modal]
2365
+ </code></pre><h4 id="-modal-parameters">[modal] parameters</h4>
2366
  <table>
2367
  <thead>
2368
  <tr>
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: filipstefansson, nodley, FoolsRun
3
  Tags: bootstrap, shortcode, shortcodes, responsive, grid
4
  Requires at least: 3.8
5
- Tested up to: 4.2.2
6
- Stable tag: 3.3.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -32,6 +32,7 @@ If you like this plugin, check out our companion plugin for Font Awesome, [Font
32
  * Tables
33
  * Buttons
34
  * Images
 
35
  * Responsive utilities
36
  ####Components
37
  * Button Groups
@@ -71,6 +72,13 @@ No, we assume you are already working with a WordPress theme that includes the B
71
 
72
  == Changelog ==
73
 
 
 
 
 
 
 
 
74
  = 3.3.6 =
75
  * Allow for xclass property on individual [tab]s
76
  * Prevent Bootstrap help popup button from appearing on unintended pages
2
  Contributors: filipstefansson, nodley, FoolsRun
3
  Tags: bootstrap, shortcode, shortcodes, responsive, grid
4
  Requires at least: 3.8
5
+ Tested up to: 4.5
6
+ Stable tag: 3.3.8
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
32
  * Tables
33
  * Buttons
34
  * Images
35
+ * Responsive embeds
36
  * Responsive utilities
37
  ####Components
38
  * Button Groups
72
 
73
  == Changelog ==
74
 
75
+ = 3.3.8 =
76
+ * Tested to work with WordPress 4.5
77
+ * Set a default "active" slide in carousel if none is specified
78
+ * Add shortcode for responsive embeds
79
+ * Correct some non-latin characters displaying incorrectly
80
+ * Add filter to hook into tabs for things like tab history (thanks, Jason Maners!)
81
+
82
  = 3.3.6 =
83
  * Allow for xclass property on individual [tab]s
84
  * Prevent Bootstrap help popup button from appearing on unintended pages