Bootstrap Shortcodes for WordPress - Version 3.0.3

Version Description

  • Initial WordPress.org release
Download this release

Release Info

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

Code changes from version 3.0.3.2 to 3.0.3

README.md CHANGED
@@ -17,22 +17,16 @@ The plugin is tested to work with ```Bootstrap 3``` and ```WordPress 3.8```.
17
  * [Code](#code)
18
  * [Tables](#tables)
19
  * [Buttons](#buttons)
20
- * [Images](#images)
21
  * [Responsive utilities](#responsive-utilities)
22
 
23
  ### Components
24
  * [Icons](#icons)
25
  * [Button Groups](#button-groups)
26
- * [Button Dropdowns](#button-dropdowns)
27
- * [Navs](#navs)
28
- * [Breadcrumbs](#breadcrumbs)
29
  * [Labels](#labels)
30
  * [Badges](#badges)
31
  * [Jumbotron](#jumbotron)
32
- * [Page Header](#page-header)
33
  * [Thumbnails](#thumbnails)
34
  * [Alerts](#alerts)
35
- * [Progress Bars](#progress-bars)
36
  * [Media Objects](#media-objects)
37
  * [List Groups](#list-groups)
38
  * [Panels](#panels)
@@ -83,7 +77,6 @@ push_xs | Push on extra small screens | optional | 1-12 | false
83
  push_sm | Push on small screens | optional | 1-12 | false
84
  push_md | Push on column on medium screens | optional | 1-12 | false
85
  push_lg | Push on column on large screens | optional | 1-12 | false
86
- xclass | Any extra classes you want to add | optional | any text | none
87
 
88
  [Bootstrap grid documentation](http://getbootstrap.com/css/#grid).
89
 
@@ -142,7 +135,6 @@ Parameter | Description | Required | Values | Default
142
  type | The type of the button | optional | default, primary, success, info, warning, danger, link | default
143
  size | The size of the button | optional | xs, sm, lg | none
144
  block | Whether the button should be a block-level button | optional | true, false | false
145
- dropdown | Whether the button triggers a dropdown menu (see [dropdowns](#dropdowns)) | optional | true, false | false
146
  xclass | Any extra classes you want to add | optional | any text | none
147
  link | The url you want the button to link to | optional | any valid link | none
148
  target | Target for the link | optional | any valid target | none
@@ -150,18 +142,6 @@ data | Data attribute and value pairs separated by a comma. Pairs separated by p
150
 
151
  [Bootstrap button documentation](http://getbootstrap.com/css/#buttons)
152
 
153
- ### Images
154
- [img type="circle" responsive="true"] … [/img]
155
-
156
- Wrap any number of HTML image tags or images inserted via the WordPress media manager.
157
- #### [img] parameters
158
- Parameter | Description | Required | Values | Default
159
- --- | --- | --- | --- | ---
160
- type | The effect to apply to wrapped images | optional | rounded, circle, thumbnail | false
161
- responsive | Make the wrapped images responsive | optional | true, false | false
162
-
163
- [Bootstrap images documentation](http://getbootstrap.com/css/#images)
164
-
165
  ### Responsive Utilities
166
  [responsive visible="sm xs" hidden="lg"] … [/responsive]
167
 
@@ -186,29 +166,11 @@ type | The type of icon you want to display | required | See Bootstrap docs | no
186
  [Bootstrap Glyphicons documentation](http://getbootstrap.com/components/#glyphicons)
187
 
188
  ### Button Groups
189
- #### Basic example
190
  [button-group size="lg" justified="" vertical=""]
191
  [button link="#"] … [/button]
192
  [button link="#"] … [/button]
193
  [button link="#"] … [/button]
194
  [/button-group]
195
-
196
- #### Button toolbar
197
- [button-toolbar]
198
- [button-group]
199
- [button link="#"] … [/button]
200
- [button link="#"] … [/button]
201
- [button link="#"] … [/button]
202
- [/button-group]
203
- [button-group]
204
- [button link="#"] … [/button]
205
- [button link="#"] … [/button]
206
- [button link="#"] … [/button]
207
- [/button-group]
208
- [button-group]
209
- [button link="#"] … [/button]
210
- [/button-group]
211
- [/button-toolbar]
212
 
213
  #### [button-group] parameters
214
  Parameter | Description | Required | Values | Default
@@ -216,116 +178,9 @@ Parameter | Description | Required | Values | Default
216
  size | The size of the button group | optional | xs, sm, lg | none
217
  justified | Whether button group is justified | optional | true, false | false
218
  vertical | Whether button group is vertical | optional | true, false | false
219
- dropup | **Must correspond with the use of [dropdown]** | optional | true, false | false
220
-
221
- #### [button-toolbar] parameters
222
- None
223
 
224
  [Bootstrap button groups documentation](http://getbootstrap.com/css/#btn-groups)
225
 
226
- ### Button Dropdowns
227
- Button Dropdowns can be accomplished by combining the [button-group] shortcode, the "data" parameters of the [button] shortcode, and [dropdown] shortcode as follows.
228
-
229
- #### Single button dropdowns
230
- [button-group]
231
- [button link="#" dropdown="true" data="toggle,dropdown"] … [caret][/button]
232
- [dropdown]
233
- [dropdown-item link="#"] … [/dropdown-item]
234
- [divider]
235
- [dropdown-item link="#"] … [/dropdown-item]
236
- [/dropdown]
237
- [/button-group]
238
-
239
- #### Split button dropdowns
240
- [button-group]
241
- [button link="#"] … [/button]
242
- [button dropdown="true" data="toggle,dropdown"][caret][/button]
243
- [dropdown]
244
- [dropdown-item link="#"] … [/dropdown-item]
245
- [divider]
246
- [dropdown-item link="#"] … [/dropdown-item]
247
- [/dropdown]
248
- [/button-group]
249
-
250
- #### Dropup variation
251
- [button-group dropup="true"]
252
- [button link="#"] … [/button]
253
- [button dropdown="true" data="toggle,dropdown"][caret][/button]
254
- [dropdown]
255
- [dropdown-item link="#"] … [/dropdown-item]
256
- [divider]
257
- [dropdown-item link="#"] … [/dropdown-item]
258
- [/dropdown]
259
- [/button-group]
260
-
261
- #### [dropdown] parameters
262
- None
263
-
264
- #### [dropdown-item] parameters
265
- Parameter | Description | Required | Values | Default
266
- --- | --- | --- | --- | ---
267
- link | The url you want the dropdown-item to link to | optional | any valid link | none
268
-
269
- #### [caret] parameters
270
- None
271
-
272
- #### [divider] parameters
273
- None
274
-
275
- [Bootstrap button dropdowns documentation](http://getbootstrap.com/components/#btn-dropdowns)
276
-
277
- ### Navs
278
- [nav type="pills"]
279
- [nav-item link="#"] … [/nav-item]
280
- [nav-item link="#"] … [/nav-item]
281
- [nav-item link="#"] … [/nav-item]
282
- [/nav]
283
-
284
- #### Nav with dropdowns
285
- [nav type="pills"]
286
- [nav-item link="#" active="true"] … [/nav-item]
287
- [nav-item dropdown="true" link="#"] … [caret]
288
- [dropdown]
289
- [dropdown-item link="#"] … [/dropdown-item]
290
- [dropdown-item link="#"] … [/dropdown-item]
291
- [/dropdown]
292
- [/nav-item]
293
- [/nav]
294
-
295
- #### [nav] parameters
296
- Parameter | Description | Required | Values | Default
297
- --- | --- | --- | --- | ---
298
- type | The type of nav | required | tabs, pills | tabs
299
- stacked | Whether the nav is stacked (should be used with "pills" type | optional | true, false | false
300
- justified | Whether the nav is justified | optional | true, false | false
301
-
302
- #### [nav-item] parameters
303
- Parameter | Description | Required | Values | Default
304
- --- | --- | --- | --- | ---
305
- link | The url you want the dropdown-item to link to | optional | any valid link | none
306
- active | Whether the item has the "active" style applied | optional | true, false | false
307
- disabled | Whether the item is disabled | optional | true, false | false
308
-
309
- [Bootstrap button navs documentation](http://getbootstrap.com/components/#nav)
310
-
311
-
312
- ### Breadcrumbs
313
- [breadcrumb]
314
- [breadcrumb-item link="#"] … [/breadcrumb-item]
315
- [breadcrumb-item link="#"] … [/breadcrumb-item]
316
- [breadcrumb-item link="#"] … [/breadcrumb-item]
317
- [/breadcrumb]
318
-
319
- #### [breadcrumb] parameters
320
- None
321
-
322
- #### [breadcrumb-item] parameters
323
- Parameter | Description | Required | Values | Default
324
- --- | --- | --- | --- | ---
325
- link | The url you want the breadcrumb-item to link to | optional | any valid link | none
326
-
327
- [Bootstrap breadcrumbs documentation](http://getbootstrap.com/components/#breadcrumbs)
328
-
329
  ### Labels
330
  [label type="success"] … [/label]
331
 
@@ -356,15 +211,6 @@ title | The jumbotron title | optional | Any text | none
356
 
357
  [Bootstrap jumbotron documentation](http://getbootstrap.com/components/#jumbotron)
358
 
359
- ### Page Header
360
- [page-header] … [/page-header]
361
-
362
- Automatically inserts H1 tag if not present
363
- #### [page-header] parameters
364
- None
365
-
366
- [Bootstrap page-header documentation](http://getbootstrap.com/components/#page-header)
367
-
368
  ### Thumbnails
369
  [thumbnail] … [/thumbnail]
370
  [thumbnail] … [/thumbnail]
@@ -383,30 +229,10 @@ Parameter | Description | Required | Values | Default
383
  --- | --- | --- | --- | ---
384
  type | The type of the alert | required | success, info, warning, danger | success
385
  dismissable | If the alert should be dismissable | optional | true, false | false
 
386
 
387
  [Bootstrap alert documentation](http://getbootstrap.com/components/#alerts)
388
 
389
- ### Progress Bars
390
- [progress striped="true"]
391
- [progress-bar percent="50"]
392
- [progress-bar percent="25" type="success"]
393
- [/progress]
394
-
395
- #### [progress] parameters
396
- Parameter | Description | Required | Values | Default
397
- --- | --- | --- | --- | ---
398
- striped | Whether enclosed progress bars will be striped | optional | true, false | false
399
- animated | Whether enclosed progress bars will be animated | optional | true, false | false
400
-
401
- #### [progress-bar] parameters
402
- Parameter | Description | Required | Values | Default
403
- --- | --- | --- | --- | ---
404
- percent | The percentage amount to show in the progress bar | required | any number between 0 and 100 | false
405
- type | The type of the progress bar | optional | default, primary, success, info, warning, danger | default
406
-
407
- [Bootstrap progress bars documentation](http://getbootstrap.com/components/#progress)
408
-
409
-
410
  ### Media Objects
411
  [media]
412
  [media-object pull="right"]
@@ -435,8 +261,6 @@ __NOTE: media-object should contain an image, or linked image, inserted using th
435
  [Bootstrap media objects documentation](http://getbootstrap.com/components/#media)
436
 
437
  ### List Groups
438
-
439
- #### Basic Example
440
  [list-group]
441
  [list-group-item]
442
 
@@ -449,50 +273,7 @@ __NOTE: media-object should contain an image, or linked image, inserted using th
449
  [/list-group-item]
450
  [/list-group]
451
 
452
- #### Linked Items
453
- [list-group linked="true"]
454
- [list-group-item link="#" active="true"]
455
-
456
- [/list-group-item]
457
- [list-group-item link="#"]
458
-
459
- [/list-group-item]
460
- [list-group-item link="#"]
461
-
462
- [/list-group-item]
463
- [/list-group]
464
-
465
- #### Custom Content
466
- [list-group linked="true"]
467
- [list-group-item link="#" active="true"]
468
- [list-group-item-heading]…[/list-group-item-heading]
469
- [list-group-item-text]…[/list-group-item-text]
470
- [/list-group-item]
471
- [list-group-item link="#"]
472
- [list-group-item-heading]…[/list-group-item-heading]
473
- [list-group-item-text]…[/list-group-item-text]
474
- [/list-group-item]
475
- [list-group-item link="#"]
476
- [list-group-item-heading]…[/list-group-item-heading]
477
- [list-group-item-text]…[/list-group-item-text]
478
- [/list-group-item]
479
- [/list-group]
480
-
481
  #### [list-group] parameters
482
- Parameter | Description | Required | Values | Default
483
- --- | --- | --- | --- | ---
484
- linked | Whether this is a linked list group, or a standard one | optional | true, false | false
485
-
486
- #### [list-group-item] parameters
487
- Parameter | Description | Required | Values | Default
488
- --- | --- | --- | --- | ---
489
- link | The url you want the list item to link to **Must correspond with the "linked" parameter in [list-group]** | optional | any text | false
490
- active | Whether the item has the "active" style applied | optional | true, false | false
491
-
492
- #### [list-group-item-heading] parameters
493
- None
494
-
495
- #### [list-group-item-text] parameters
496
  None
497
 
498
  [Bootstrap list groups documentation](http://getbootstrap.com/components/#list-group)
@@ -592,7 +373,7 @@ Parameter | Description | Required | Values | Default
592
  --- | --- | --- | --- | ---
593
  title | The title of the collapsible, visible when collapsed | required | any text | false
594
  type | The type of the panel | optional | default, primary, success, info, warning, danger, link | default
595
- active | Whether the tab is expanded at load time | optional | true, false | false
596
 
597
  [Bootstrap collapse documentation](http://getbootstrap.com/javascript/#collapse)
598
 
17
  * [Code](#code)
18
  * [Tables](#tables)
19
  * [Buttons](#buttons)
 
20
  * [Responsive utilities](#responsive-utilities)
21
 
22
  ### Components
23
  * [Icons](#icons)
24
  * [Button Groups](#button-groups)
 
 
 
25
  * [Labels](#labels)
26
  * [Badges](#badges)
27
  * [Jumbotron](#jumbotron)
 
28
  * [Thumbnails](#thumbnails)
29
  * [Alerts](#alerts)
 
30
  * [Media Objects](#media-objects)
31
  * [List Groups](#list-groups)
32
  * [Panels](#panels)
77
  push_sm | Push on small screens | optional | 1-12 | false
78
  push_md | Push on column on medium screens | optional | 1-12 | false
79
  push_lg | Push on column on large screens | optional | 1-12 | false
 
80
 
81
  [Bootstrap grid documentation](http://getbootstrap.com/css/#grid).
82
 
135
  type | The type of the button | optional | default, primary, success, info, warning, danger, link | default
136
  size | The size of the button | optional | xs, sm, lg | none
137
  block | Whether the button should be a block-level button | optional | true, false | false
 
138
  xclass | Any extra classes you want to add | optional | any text | none
139
  link | The url you want the button to link to | optional | any valid link | none
140
  target | Target for the link | optional | any valid target | none
142
 
143
  [Bootstrap button documentation](http://getbootstrap.com/css/#buttons)
144
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  ### Responsive Utilities
146
  [responsive visible="sm xs" hidden="lg"] … [/responsive]
147
 
166
  [Bootstrap Glyphicons documentation](http://getbootstrap.com/components/#glyphicons)
167
 
168
  ### Button Groups
 
169
  [button-group size="lg" justified="" vertical=""]
170
  [button link="#"] … [/button]
171
  [button link="#"] … [/button]
172
  [button link="#"] … [/button]
173
  [/button-group]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
 
175
  #### [button-group] parameters
176
  Parameter | Description | Required | Values | Default
178
  size | The size of the button group | optional | xs, sm, lg | none
179
  justified | Whether button group is justified | optional | true, false | false
180
  vertical | Whether button group is vertical | optional | true, false | false
 
 
 
 
181
 
182
  [Bootstrap button groups documentation](http://getbootstrap.com/css/#btn-groups)
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  ### Labels
185
  [label type="success"] … [/label]
186
 
211
 
212
  [Bootstrap jumbotron documentation](http://getbootstrap.com/components/#jumbotron)
213
 
 
 
 
 
 
 
 
 
 
214
  ### Thumbnails
215
  [thumbnail] … [/thumbnail]
216
  [thumbnail] … [/thumbnail]
229
  --- | --- | --- | --- | ---
230
  type | The type of the alert | required | success, info, warning, danger | success
231
  dismissable | If the alert should be dismissable | optional | true, false | false
232
+ strong | Text to display in bold at the beginning | optional | any text | false
233
 
234
  [Bootstrap alert documentation](http://getbootstrap.com/components/#alerts)
235
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  ### Media Objects
237
  [media]
238
  [media-object pull="right"]
261
  [Bootstrap media objects documentation](http://getbootstrap.com/components/#media)
262
 
263
  ### List Groups
 
 
264
  [list-group]
265
  [list-group-item]
266
 
273
  [/list-group-item]
274
  [/list-group]
275
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
  #### [list-group] parameters
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  None
278
 
279
  [Bootstrap list groups documentation](http://getbootstrap.com/components/#list-group)
373
  --- | --- | --- | --- | ---
374
  title | The title of the collapsible, visible when collapsed | required | any text | false
375
  type | The type of the panel | optional | default, primary, success, info, warning, danger, link | default
376
+ state | Whether the tab is expanded at load time | optional | active | false
377
 
378
  [Bootstrap collapse documentation](http://getbootstrap.com/javascript/#collapse)
379
 
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.0.3.2
7
  Author: Filip Stefansson, Simon Yeldon, and Michael W. Delaney
8
  Author URI:
9
  License: GPL2
@@ -62,27 +62,14 @@ class BoostrapShortcodes {
62
 
63
  add_shortcode('button', array( $this, 'bs_button' ));
64
  add_shortcode('button-group', array( $this, 'bs_button_group' ));
65
- add_shortcode('button-toolbar', array( $this, 'bs_button_toolbar' ));
66
- add_shortcode('caret', array( $this, 'bs_caret' ));
67
- add_shortcode('dropdown', array( $this, 'bs_dropdown' ));
68
- add_shortcode('dropdown-item', array( $this, 'bs_dropdown_item' ));
69
- add_shortcode('nav', array( $this, 'bs_nav' ));
70
- add_shortcode('nav-item', array( $this, 'bs_nav_item' ));
71
- add_shortcode('divider', array( $this, 'bs_dropdown_divider' ));
72
  add_shortcode('alert', array( $this, 'bs_alert' ));
73
- add_shortcode('progress', array( $this, 'bs_progress' ));
74
- add_shortcode('progress-bar', array( $this, 'bs_progress_bar' ));
75
  add_shortcode('code', array( $this, 'bs_code' ));
76
  add_shortcode('span', array( $this, 'bs_span' ));
77
  add_shortcode('row', array( $this, 'bs_row' ));
78
  add_shortcode('column', array( $this, 'bs_column' ));
79
- add_shortcode('breadcrumb', array( $this, 'bs_breadcrumb' ));
80
- add_shortcode('breadcrumb-item', array( $this, 'bs_breadcrumb_item' ));
81
  add_shortcode('label', array( $this, 'bs_label' ));
82
  add_shortcode('list-group', array( $this, 'bs_list_group' ));
83
  add_shortcode('list-group-item', array( $this, 'bs_list_group_item' ));
84
- add_shortcode('list-group-item-heading', array( $this, 'bs_list_group_item_heading' ));
85
- add_shortcode('list-group-item-text', array( $this, 'bs_list_group_item_text' ));
86
  add_shortcode('badge', array( $this, 'bs_badge' ));
87
  add_shortcode('icon', array( $this, 'bs_icon' ));
88
  add_shortcode('icon_white', array( $this, 'bs_icon_white' ));
@@ -100,10 +87,8 @@ class BoostrapShortcodes {
100
  add_shortcode('media-object', array( $this, 'bs_media_object' ));
101
  add_shortcode('media-body', array( $this, 'bs_media_body' ));
102
  add_shortcode('jumbotron', array( $this, 'bs_jumbotron' ));
103
- add_shortcode('page-header', array( $this, 'bs_page_header' ));
104
  add_shortcode('lead', array( $this, 'bs_lead' ));
105
  add_shortcode('emphasis', array( $this, 'bs_emphasis' ));
106
- add_shortcode('img', array( $this, 'bs_img' ));
107
  add_shortcode('thumbnail', array( $this, 'bs_thumbnail' ));
108
  add_shortcode('responsive', array( $this, 'bs_responsive' ));
109
  add_shortcode('modal', array( $this, 'bs_modal' ));
@@ -126,7 +111,6 @@ class BoostrapShortcodes {
126
  "type" => false,
127
  "size" => false,
128
  "block" => false,
129
- "dropdown" => false,
130
  "link" => '',
131
  "target" => false,
132
  "xclass" => false,
@@ -137,14 +121,13 @@ class BoostrapShortcodes {
137
  $data = explode('|',$data);
138
  foreach($data as $d):
139
  $d = explode(',',$d);
140
- $data_props .= 'data-'.$d[0]. '="'.trim($d[1]).'" ';
141
  endforeach;
142
  } else { $data_props = false; }
143
  $return = '<a href="' . $link . '" class="btn';
144
  $return .= ($type) ? ' btn-' . $type : ' btn-default';
145
  $return .= ($size) ? ' btn-' . $size : '';
146
  $return .= ($block) ? ' btn-block' : '';
147
- $return .= ($dropdown) ? ' dropdown-toggle' : '';
148
  $return .= ($xclass) ? ' ' . $xclass : '';
149
  $return .= '"';
150
  $return .= ($target) ? ' target="' . $target . '"' : '';
@@ -166,123 +149,21 @@ class BoostrapShortcodes {
166
  extract(shortcode_atts(array(
167
  "size" => false,
168
  "vertical" => false,
169
- "justified" => false,
170
- "dropup" => false
171
  ), $atts));
172
- $classes .= ($size) ? ' btn-group-' . $size : '';
173
- $classes .= ($vertical) ? ' btn-group-vertical' : '';
174
- $classes .= ($justified) ? ' btn-group-justified' : '';
175
- $classes .= ($dropup) ? ' dropup' : '';
176
- $return = '<div class="btn-group '.$classes.'">' . do_shortcode( $content ) . '</div>';
177
- return $return;
178
- }
 
 
 
179
 
180
- /*--------------------------------------------------------------------------------------
181
- *
182
- * bs_button_toolbar
183
- *
184
- *
185
- *-------------------------------------------------------------------------------------*/
186
- function bs_button_toolbar( $atts, $content = null ) {
187
- $return = '<div class="btn-toolbar" role="toolbar">' . do_shortcode( $content ) . '</div>';
188
- return $return;
189
- }
190
-
191
- /*--------------------------------------------------------------------------------------
192
- *
193
- * bs_caret
194
- *
195
- * @author Filip Stefansson
196
- * @since 1.0
197
- *
198
- *-------------------------------------------------------------------------------------*/
199
- function bs_caret( $atts, $content = null ) {
200
- $return = '<span class="caret"></span>';
201
- return $return;
202
- }
203
-
204
- /*--------------------------------------------------------------------------------------
205
- *
206
- * bs_dropdown
207
- *
208
- * @author M. W. Delaney
209
- *
210
- *-------------------------------------------------------------------------------------*/
211
- function bs_dropdown( $atts, $content = null ) {
212
- $return = '<ul class="dropdown-menu" role="menu">' . do_shortcode( $content ) . '</ul>';
213
- return $return;
214
- }
215
-
216
- /*--------------------------------------------------------------------------------------
217
- *
218
- * bs_dropdown_item
219
- *
220
- * @author M. W. Delaney
221
- *
222
- *-------------------------------------------------------------------------------------*/
223
- function bs_dropdown_item( $atts, $content = null ) {
224
- extract(shortcode_atts(array(
225
- "link" => false,
226
- ), $atts));
227
- $return = '<li><a href="'. $link .'">' . do_shortcode( $content ) . '</a></li>';
228
- return $return;
229
- }
230
-
231
- /*--------------------------------------------------------------------------------------
232
- *
233
- * bs_dropdown_divider
234
- *
235
- * @author M. W. Delaney
236
- *
237
- *-------------------------------------------------------------------------------------*/
238
- function bs_dropdown_divider( $atts, $content = null ) {
239
- $return = '<li class="divider">' . do_shortcode( $content ) . '</li>';
240
- return $return;
241
- }
242
-
243
- /*--------------------------------------------------------------------------------------
244
- *
245
- * bs_nav
246
- *
247
- *
248
- *-------------------------------------------------------------------------------------*/
249
- function bs_nav( $atts, $content = null ) {
250
- extract(shortcode_atts(array(
251
- "type" => 'tabs',
252
- "stacked" => false,
253
- "justified" => false,
254
- ), $atts));
255
- $classes = 'nav nav-' . $type;
256
- $classes .= ($stacked) ? ' nav-stacked' : '';
257
- $classes .= ($justified) ? ' nav-justified' : '';
258
- $return = '<ul class="'.$classes.'">' . do_shortcode( $content ) . '</ul>';
259
- return $return;
260
- }
261
-
262
- /*--------------------------------------------------------------------------------------
263
- *
264
- * bs_nav_item
265
- *
266
- *
267
- *-------------------------------------------------------------------------------------*/
268
- function bs_nav_item( $atts, $content = null ) {
269
- extract(shortcode_atts(array(
270
- "link" => false,
271
- "active" => false,
272
- "disabled" => false,
273
- "dropdown" => false,
274
- ), $atts));
275
- $return = '<li class="';
276
- $return .= ($dropdown) ? ' dropdown' : '';
277
- $return .= ($active) ? ' active' : '';
278
- $return .= ($disabled) ? ' disabled' : '';
279
- $return .= '"><a href="' . $link . '"';
280
- $return .= ($dropdown) ? ' class="dropdown-toggle" data-toggle="dropdown"' : '';
281
- $return .= ($dropdown) ? '">' . str_replace("<ul", "</a><ul", do_shortcode( $content )) : '">' . do_shortcode( $content ) . '</a>';
282
- $return .= '</li>';
283
- return $return;
284
  }
285
-
286
  /*--------------------------------------------------------------------------------------
287
  *
288
  * bs_alert
@@ -294,52 +175,20 @@ class BoostrapShortcodes {
294
  function bs_alert($atts, $content = null) {
295
  extract(shortcode_atts(array(
296
  "type" => 'success',
 
297
  "dismissable" => false
298
  ), $atts));
299
  $return = '<div class="alert alert-' . $type;
300
  $return .= ($dismissable) ? ' alert-dismissable' : '';
301
  $return .= '">';
302
  $return .= ($dismissable) ? '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>' : '';
 
303
  $return .= do_shortcode( $content ) . '</div>';
304
  return $return;
305
  }
306
 
307
- /*--------------------------------------------------------------------------------------
308
- *
309
- * bs_progress
310
- *
311
- *
312
- *-------------------------------------------------------------------------------------*/
313
- function bs_progress($atts, $content = null) {
314
- extract(shortcode_atts(array(
315
- "striped" => false,
316
- "animated" => false,
317
- ), $atts));
318
- $return = '<div class="progress ';
319
- $return .= ($striped) ? 'progress-striped ' : '';
320
- $return .= ($animated) ? 'active' : '';
321
- $return .= '">' . do_shortcode( $content ) . '</div>';
322
- return $return;
323
- }
324
 
325
- /*--------------------------------------------------------------------------------------
326
- *
327
- * bs_progress_bar
328
- *
329
- *
330
- *-------------------------------------------------------------------------------------*/
331
- function bs_progress_bar($atts, $content = null) {
332
- extract(shortcode_atts(array(
333
- "type" => false,
334
- "percent" => false,
335
- ), $atts));
336
- $return = '<div class="progress-bar ';
337
- $return .= ($type) ? ' progress-bar-' . $type : '';
338
- $return .= '" role="progressbar" aria-valuenow="'. $percent .'" aria-valuemin="0" aria-valuemax="100" style="width: '. $percent .'%">
339
- <span class="sr-only">'. $percent .'% Complete</span>
340
- </div>';
341
- return $return;
342
- }
343
 
344
  /*--------------------------------------------------------------------------------------
345
  *
@@ -381,8 +230,8 @@ class BoostrapShortcodes {
381
  "size" => 'size'
382
  ), $atts));
383
 
384
- $return = '<div class="span' . $size . '">' . do_shortcode( $content ) . '</div>';
385
- return $return;
386
  }
387
 
388
 
@@ -398,8 +247,8 @@ class BoostrapShortcodes {
398
  *-------------------------------------------------------------------------------------*/
399
  function bs_row( $atts, $content = null ) {
400
 
401
- $return = '<div class="row">' . do_shortcode( $content ) . '</div>';
402
- return $return;
403
  }
404
 
405
 
@@ -431,7 +280,6 @@ class BoostrapShortcodes {
431
  "push_md" => false,
432
  "push_sm" => false,
433
  "push_xs" => false,
434
- "xclass" => false
435
  ), $atts));
436
  $return = '<div class="';
437
  $return .= ($lg) ? 'col-lg-' . $lg . ' ' : '';
@@ -450,7 +298,6 @@ class BoostrapShortcodes {
450
  $return .= ($push_md) ? 'col-md-push-' . $push_md . ' ' : '';
451
  $return .= ($push_sm) ? 'col-sm-push-' . $push_sm . ' ' : '';
452
  $return .= ($push_xs) ? 'col-xs-push-' . $push_xs . ' ' : '';
453
- $return .= ($xclass) ? $xclass : '';
454
  $return .= '">' . do_shortcode( $content ) . '</div>';
455
 
456
  return $return;
@@ -464,13 +311,8 @@ class BoostrapShortcodes {
464
  *
465
  *-------------------------------------------------------------------------------------*/
466
  function bs_list_group( $atts, $content = null ) {
467
- extract(shortcode_atts(array(
468
- "linked" => false,
469
- ), $atts));
470
- $return = ($linked) ? ' <div class="list-group">' : '<ul class="list-group">';
471
- $return .= do_shortcode( $content );
472
- $return .= ($linked) ? ' </div>' : '</ul>';
473
- return $return;
474
 
475
  }
476
 
@@ -482,67 +324,11 @@ class BoostrapShortcodes {
482
  *
483
  *-------------------------------------------------------------------------------------*/
484
  function bs_list_group_item( $atts, $content = null ) {
485
- extract(shortcode_atts(array(
486
- "link" => false,
487
- "active" => false
488
- ), $atts));
489
- $return = ($link) ? '<a href="' . $link . '" ' : '<li ';
490
- $return .= 'class="list-group-item ';
491
- $return .= ($active) ? 'active' : '';
492
- $return .= '">' . do_shortcode( $content );
493
- $return .= ($link) ? '</a>' : '</li>';
494
- return $return;
495
- }
496
-
497
- /*--------------------------------------------------------------------------------------
498
- *
499
- * bs_list_group_item_heading
500
- *
501
- *
502
- *-------------------------------------------------------------------------------------*/
503
- function bs_list_group_item_heading( $atts, $content = null ) {
504
- $return = '<h4 class="list-group-item-heading">' . do_shortcode( $content ) . '</h4>';
505
- return $return;
506
- }
507
-
508
- /*--------------------------------------------------------------------------------------
509
- *
510
- * bs_list_group_item_text
511
- *
512
- *
513
- *-------------------------------------------------------------------------------------*/
514
- function bs_list_group_item_text( $atts, $content = null ) {
515
- $return = '<p class="list-group-item-text">' . do_shortcode( $content ) . '</p>';
516
- return $return;
517
- }
518
 
 
519
 
520
- /*--------------------------------------------------------------------------------------
521
- *
522
- * bs_breadcrumb
523
- *
524
- *
525
- *-------------------------------------------------------------------------------------*/
526
- function bs_breadcrumb( $atts, $content = null ) {
527
- $return = '<ol class="breadcrumb">'.do_shortcode( $content ).'</ol>';
528
- return $return;
529
- }
530
-
531
- /*--------------------------------------------------------------------------------------
532
- *
533
- * bs_breadcrumb_item
534
- *
535
- * @author M. W. Delaney
536
- *
537
- *-------------------------------------------------------------------------------------*/
538
- function bs_breadcrumb_item( $atts, $content = null ) {
539
- extract(shortcode_atts(array(
540
- "link" => false,
541
- ), $atts));
542
- $return = '<li><a href="' . $link . '">'.do_shortcode( $content ).'</a></li>';
543
- return $return;
544
  }
545
-
546
  /*--------------------------------------------------------------------------------------
547
  *
548
  * bs_label
@@ -556,8 +342,8 @@ class BoostrapShortcodes {
556
  "type" => 'default'
557
  ), $atts));
558
 
559
- $return = '<span class="label label-' . $type . '">' . do_shortcode( $content ) . '</span>';
560
- return $return;
561
  }
562
 
563
 
@@ -576,8 +362,8 @@ class BoostrapShortcodes {
576
  "right" => false
577
  ), $atts));
578
  $right = ($right) ? " pull-right" : "";
579
- $return = '<span class="badge' . $right . '">' . do_shortcode( $content ) . '</span>';
580
- return $return;
581
  }
582
 
583
 
@@ -596,8 +382,8 @@ class BoostrapShortcodes {
596
  "type" => 'type',
597
  ), $atts));
598
 
599
- $return = '<span class="glyphicon glyphicon-' . $type . '"></span>';
600
- return $return;
601
  }
602
 
603
  /*--------------------------------------------------------------------------------------
@@ -691,8 +477,7 @@ class BoostrapShortcodes {
691
  $size = ' well-'.$size;
692
  }
693
 
694
- $return = '<div class="well' . $size . '">' . do_shortcode( $content ) . '</div>';
695
- return $return;
696
  }
697
 
698
  /*--------------------------------------------------------------------------------------
@@ -712,8 +497,8 @@ class BoostrapShortcodes {
712
  if($footer) {
713
  $footer = '<div class="panel-footer">' . $footer . '</div>';
714
  }
715
- $return = '<div class="panel panel-' . $type . '"><div class="panel-heading"><h3 class="panel-title">' . $title . '</h3></div><div class="panel-body">' . do_shortcode( $content ) . '</div>' . $footer . '</div>';
716
- return $return;
717
  }
718
 
719
  /*--------------------------------------------------------------------------------------
@@ -742,31 +527,31 @@ class BoostrapShortcodes {
742
  $tab_titles = array();
743
  if( isset($matches[1]) ){ $tab_titles = $matches[1]; }
744
 
745
- $return = '';
746
 
747
  if( count($tab_titles) ){
748
- $return .= '<ul class="nav ' . $class . '" id="custom-tabs-'. rand(1, 100) .'">';
749
 
750
  $i = 0;
751
  foreach( $tab_titles as $tab ){
752
  if($i == 0)
753
- $return .= '<li class="active">';
754
  else
755
- $return .= '<li>';
756
 
757
- $return .= '<a href="#custom-tab-' . $GLOBALS['tabs_count'] . '-' . sanitize_title( $tab[0] ) . '" data-toggle="tab">' . $tab[0] . '</a></li>';
758
  $i++;
759
  }
760
 
761
- $return .= '</ul>';
762
- $return .= '<div class="tab-content">';
763
- $return .= do_shortcode( $content );
764
- $return .= '</div>';
765
  } else {
766
- $return .= do_shortcode( $content );
767
  }
768
 
769
- return $return;
770
  }
771
 
772
 
@@ -798,8 +583,7 @@ class BoostrapShortcodes {
798
  $defaults = array( 'title' => 'Tab');
799
  extract( shortcode_atts( $defaults, $atts ) );
800
 
801
- $return = '<div id="custom-tab-' . $GLOBALS['tabs_count'] . '-'. sanitize_title( $title ) .'" class="tab-pane ' . $state . '">'. do_shortcode( $content ) .'</div>';
802
- return $return;
803
  }
804
 
805
 
@@ -829,17 +613,17 @@ class BoostrapShortcodes {
829
  $tab_titles = array();
830
  if( isset($matches[1]) ){ $tab_titles = $matches[1]; }
831
 
832
- $return = '';
833
 
834
  if( count($tab_titles) ){
835
- $return .= '<div class="panel-group" id="accordion-' . $GLOBALS['collapsibles_count'] . '">';
836
- $return .= do_shortcode( $content );
837
- $return .= '</div>';
838
  } else {
839
- $return .= do_shortcode( $content );
840
  }
841
 
842
- return $return;
843
  }
844
 
845
 
@@ -863,14 +647,13 @@ class BoostrapShortcodes {
863
  extract(shortcode_atts(array(
864
  "title" => '',
865
  "type" => 'default',
866
- "active" => false
867
  ), $atts));
868
 
869
- if ($active)
870
- $active = 'in';
871
 
872
- $return = '<div class="panel panel-' . $type . '"><div class="panel-heading"><h3 class="panel-title"><a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion-' . $GLOBALS['collapsibles_count'] . '" href="#collapse_' . $GLOBALS['current_collapse'] . '_'. sanitize_title( $title ) .'">' . $title . '</a></h3></div><div id="collapse_' . $GLOBALS['current_collapse'] . '_'. sanitize_title( $title ) .'" class="panel-collapse collapse ' . $active . '"><div class="panel-body">' . do_shortcode($content) . ' </div></div></div>';
873
- return $return;
874
  }
875
 
876
 
@@ -965,8 +748,7 @@ function bs_media( $atts, $content = null ) {
965
  'title' => false,
966
  );
967
  extract( shortcode_atts( $defaults, $atts ) );
968
- $return = '<div class="media">' . do_shortcode( $content ) . '</div>';
969
- return $return;
970
  }
971
 
972
  function bs_media_object( $atts, $content = null ) {
@@ -1014,40 +796,6 @@ function bs_media_body( $atts, $content = null ) {
1014
  return $return;
1015
  }
1016
 
1017
- /*--------------------------------------------------------------------------------------
1018
- *
1019
- * bs_page_header
1020
- *
1021
- *
1022
- *-------------------------------------------------------------------------------------*/
1023
- function bs_page_header( $atts, $content = null ) {
1024
- $classes = "page-header";
1025
- $dom = new DOMDocument;
1026
- $dom->loadXML($content);
1027
- $hasHeader = $dom->getElementsByTagName('h1');
1028
-
1029
- if($hasHeader->length == 0) {
1030
-
1031
- $wrapper = $dom->createElement('div');
1032
- $dom->appendChild($wrapper);
1033
-
1034
- $header = $dom->createElement('h1', $content);
1035
- $wrapper->appendChild($header);
1036
-
1037
- }
1038
- else {
1039
- $new_root = $dom->createElement('div');
1040
- $new_root->appendChild($dom->documentElement);
1041
- $dom->appendChild($new_root);
1042
- }
1043
- $dom->documentElement->setAttribute('class', $dom->documentElement->getAttribute('class') . ' ' . $classes);
1044
-
1045
- $return = $dom->saveXML();
1046
-
1047
- return $return;
1048
-
1049
- }
1050
-
1051
  /*--------------------------------------------------------------------------------------
1052
  *
1053
  * bs_lead
@@ -1055,8 +803,8 @@ function bs_media_body( $atts, $content = null ) {
1055
  *
1056
  *-------------------------------------------------------------------------------------*/
1057
  function bs_lead( $atts, $content = null ) {
1058
- $return = '<p class="lead">' . do_shortcode( $content ) . '</p>';
1059
- return $return;
1060
  }
1061
 
1062
  /*--------------------------------------------------------------------------------------
@@ -1069,33 +817,10 @@ function bs_media_body( $atts, $content = null ) {
1069
  extract(shortcode_atts(array(
1070
  "type" => 'muted'
1071
  ), $atts));
1072
- $return = '<span class="text-' . $type . '">' . do_shortcode( $content ) . '</span>';
1073
- return $return;
1074
- }
1075
- /*--------------------------------------------------------------------------------------
1076
- *
1077
- * bs_img
1078
- *
1079
- *
1080
- *-------------------------------------------------------------------------------------*/
1081
- function bs_img( $atts, $content = null ) {
1082
- extract(shortcode_atts(array(
1083
- "type" => false,
1084
- "responsive" => false,
1085
- ), $atts));
1086
- $classes .= ($type) ? 'img-' . $type . ' ' : '';
1087
- $classes .= ($responsive) ? ' img-responsive' : '';
1088
- $dom = new DOMDocument;
1089
- $dom->loadXML($content);
1090
- foreach($dom->getElementsByTagName('img') as $image) {
1091
- $image->setAttribute('class', $image->getAttribute('class') . ' ' . $classes);
1092
- }
1093
- $return = $dom->saveXML();
1094
-
1095
- return $return;
1096
 
1097
  }
1098
-
1099
  /*--------------------------------------------------------------------------------------
1100
  *
1101
  * bs_thumbnail
@@ -1197,8 +922,8 @@ function bs_img( $atts, $content = null ) {
1197
  *
1198
  *-------------------------------------------------------------------------------------*/
1199
  function bs_modal_footer( $atts, $content = null ) {
1200
- $return = '<div class="modal-footer">' . do_shortcode( $content ) . '</div>';
1201
- return $return;
1202
  }
1203
 
1204
  }
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.0.3
7
  Author: Filip Stefansson, Simon Yeldon, and Michael W. Delaney
8
  Author URI:
9
  License: GPL2
62
 
63
  add_shortcode('button', array( $this, 'bs_button' ));
64
  add_shortcode('button-group', array( $this, 'bs_button_group' ));
 
 
 
 
 
 
 
65
  add_shortcode('alert', array( $this, 'bs_alert' ));
 
 
66
  add_shortcode('code', array( $this, 'bs_code' ));
67
  add_shortcode('span', array( $this, 'bs_span' ));
68
  add_shortcode('row', array( $this, 'bs_row' ));
69
  add_shortcode('column', array( $this, 'bs_column' ));
 
 
70
  add_shortcode('label', array( $this, 'bs_label' ));
71
  add_shortcode('list-group', array( $this, 'bs_list_group' ));
72
  add_shortcode('list-group-item', array( $this, 'bs_list_group_item' ));
 
 
73
  add_shortcode('badge', array( $this, 'bs_badge' ));
74
  add_shortcode('icon', array( $this, 'bs_icon' ));
75
  add_shortcode('icon_white', array( $this, 'bs_icon_white' ));
87
  add_shortcode('media-object', array( $this, 'bs_media_object' ));
88
  add_shortcode('media-body', array( $this, 'bs_media_body' ));
89
  add_shortcode('jumbotron', array( $this, 'bs_jumbotron' ));
 
90
  add_shortcode('lead', array( $this, 'bs_lead' ));
91
  add_shortcode('emphasis', array( $this, 'bs_emphasis' ));
 
92
  add_shortcode('thumbnail', array( $this, 'bs_thumbnail' ));
93
  add_shortcode('responsive', array( $this, 'bs_responsive' ));
94
  add_shortcode('modal', array( $this, 'bs_modal' ));
111
  "type" => false,
112
  "size" => false,
113
  "block" => false,
 
114
  "link" => '',
115
  "target" => false,
116
  "xclass" => false,
121
  $data = explode('|',$data);
122
  foreach($data as $d):
123
  $d = explode(',',$d);
124
+ $data_props .= 'data-'.$d[0]. '="'.$d[1].'" ';
125
  endforeach;
126
  } else { $data_props = false; }
127
  $return = '<a href="' . $link . '" class="btn';
128
  $return .= ($type) ? ' btn-' . $type : ' btn-default';
129
  $return .= ($size) ? ' btn-' . $size : '';
130
  $return .= ($block) ? ' btn-block' : '';
 
131
  $return .= ($xclass) ? ' ' . $xclass : '';
132
  $return .= '"';
133
  $return .= ($target) ? ' target="' . $target . '"' : '';
149
  extract(shortcode_atts(array(
150
  "size" => false,
151
  "vertical" => false,
152
+ "justified" => false
 
153
  ), $atts));
154
+ if($size) {
155
+ $classes .= ' btn-group-'.$size;
156
+ }
157
+ if($vertical) {
158
+ $classes .= ' btn-group-vertical';
159
+ }
160
+ if($justified) {
161
+ $classes .= ' btn-group-justified';
162
+ }
163
+ return '<div class="btn-group '.$classes.'">' . do_shortcode( $content ) . '</div>';
164
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  }
166
+
167
  /*--------------------------------------------------------------------------------------
168
  *
169
  * bs_alert
175
  function bs_alert($atts, $content = null) {
176
  extract(shortcode_atts(array(
177
  "type" => 'success',
178
+ "strong" => false,
179
  "dismissable" => false
180
  ), $atts));
181
  $return = '<div class="alert alert-' . $type;
182
  $return .= ($dismissable) ? ' alert-dismissable' : '';
183
  $return .= '">';
184
  $return .= ($dismissable) ? '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>' : '';
185
+ $return .= ($strong) ? '<strong>'.$strong.'</strong>' : '';
186
  $return .= do_shortcode( $content ) . '</div>';
187
  return $return;
188
  }
189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
 
191
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
 
193
  /*--------------------------------------------------------------------------------------
194
  *
230
  "size" => 'size'
231
  ), $atts));
232
 
233
+ return '<div class="span' . $size . '">' . do_shortcode( $content ) . '</div>';
234
+
235
  }
236
 
237
 
247
  *-------------------------------------------------------------------------------------*/
248
  function bs_row( $atts, $content = null ) {
249
 
250
+ return '<div class="row">' . do_shortcode( $content ) . '</div>';
251
+
252
  }
253
 
254
 
280
  "push_md" => false,
281
  "push_sm" => false,
282
  "push_xs" => false,
 
283
  ), $atts));
284
  $return = '<div class="';
285
  $return .= ($lg) ? 'col-lg-' . $lg . ' ' : '';
298
  $return .= ($push_md) ? 'col-md-push-' . $push_md . ' ' : '';
299
  $return .= ($push_sm) ? 'col-sm-push-' . $push_sm . ' ' : '';
300
  $return .= ($push_xs) ? 'col-xs-push-' . $push_xs . ' ' : '';
 
301
  $return .= '">' . do_shortcode( $content ) . '</div>';
302
 
303
  return $return;
311
  *
312
  *-------------------------------------------------------------------------------------*/
313
  function bs_list_group( $atts, $content = null ) {
314
+
315
+ return '<ul class="list-group">' . do_shortcode( $content ) . '</ul>';
 
 
 
 
 
316
 
317
  }
318
 
324
  *
325
  *-------------------------------------------------------------------------------------*/
326
  function bs_list_group_item( $atts, $content = null ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
 
328
+ return '<li class="list-group-item">' . do_shortcode( $content ) . '</li>';
329
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
330
  }
331
+
332
  /*--------------------------------------------------------------------------------------
333
  *
334
  * bs_label
342
  "type" => 'default'
343
  ), $atts));
344
 
345
+ return '<span class="label label-' . $type . '">' . do_shortcode( $content ) . '</span>';
346
+
347
  }
348
 
349
 
362
  "right" => false
363
  ), $atts));
364
  $right = ($right) ? " pull-right" : "";
365
+ return '<span class="badge' . $right . '">' . do_shortcode( $content ) . '</span>';
366
+
367
  }
368
 
369
 
382
  "type" => 'type',
383
  ), $atts));
384
 
385
+ return '<span class="glyphicon glyphicon-' . $type . '"></span>';
386
+
387
  }
388
 
389
  /*--------------------------------------------------------------------------------------
477
  $size = ' well-'.$size;
478
  }
479
 
480
+ return '<div class="well' . $size . '">' . do_shortcode( $content ) . '</div>';
 
481
  }
482
 
483
  /*--------------------------------------------------------------------------------------
497
  if($footer) {
498
  $footer = '<div class="panel-footer">' . $footer . '</div>';
499
  }
500
+ return '<div class="panel panel-' . $type . '"><div class="panel-heading"><h3 class="panel-title">' . $title . '</h3></div><div class="panel-body">' . do_shortcode( $content ) . '</div>' . $footer . '</div>';
501
+
502
  }
503
 
504
  /*--------------------------------------------------------------------------------------
527
  $tab_titles = array();
528
  if( isset($matches[1]) ){ $tab_titles = $matches[1]; }
529
 
530
+ $output = '';
531
 
532
  if( count($tab_titles) ){
533
+ $output .= '<ul class="nav ' . $class . '" id="custom-tabs-'. rand(1, 100) .'">';
534
 
535
  $i = 0;
536
  foreach( $tab_titles as $tab ){
537
  if($i == 0)
538
+ $output .= '<li class="active">';
539
  else
540
+ $output .= '<li>';
541
 
542
+ $output .= '<a href="#custom-tab-' . $GLOBALS['tabs_count'] . '-' . sanitize_title( $tab[0] ) . '" data-toggle="tab">' . $tab[0] . '</a></li>';
543
  $i++;
544
  }
545
 
546
+ $output .= '</ul>';
547
+ $output .= '<div class="tab-content">';
548
+ $output .= do_shortcode( $content );
549
+ $output .= '</div>';
550
  } else {
551
+ $output .= do_shortcode( $content );
552
  }
553
 
554
+ return $output;
555
  }
556
 
557
 
583
  $defaults = array( 'title' => 'Tab');
584
  extract( shortcode_atts( $defaults, $atts ) );
585
 
586
+ return '<div id="custom-tab-' . $GLOBALS['tabs_count'] . '-'. sanitize_title( $title ) .'" class="tab-pane ' . $state . '">'. do_shortcode( $content ) .'</div>';
 
587
  }
588
 
589
 
613
  $tab_titles = array();
614
  if( isset($matches[1]) ){ $tab_titles = $matches[1]; }
615
 
616
+ $output = '';
617
 
618
  if( count($tab_titles) ){
619
+ $output .= '<div class="panel-group" id="accordion-' . $GLOBALS['collapsibles_count'] . '">';
620
+ $output .= do_shortcode( $content );
621
+ $output .= '</div>';
622
  } else {
623
+ $output .= do_shortcode( $content );
624
  }
625
 
626
+ return $output;
627
  }
628
 
629
 
647
  extract(shortcode_atts(array(
648
  "title" => '',
649
  "type" => 'default',
650
+ "state" => false
651
  ), $atts));
652
 
653
+ if ($state == "active")
654
+ $state = 'in';
655
 
656
+ return '<div class="panel panel-' . $type . '"><div class="panel-heading"><h3 class="panel-title"><a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion-' . $GLOBALS['collapsibles_count'] . '" href="#collapse_' . $GLOBALS['current_collapse'] . '_'. sanitize_title( $title ) .'">' . $title . '</a></h3></div><div id="collapse_' . $GLOBALS['current_collapse'] . '_'. sanitize_title( $title ) .'" class="panel-collapse collapse ' . $state . '"><div class="panel-body">' . do_shortcode($content) . ' </div></div></div>';
 
657
  }
658
 
659
 
748
  'title' => false,
749
  );
750
  extract( shortcode_atts( $defaults, $atts ) );
751
+ return '<div class="media">' . do_shortcode( $content ) . '</div>';
 
752
  }
753
 
754
  function bs_media_object( $atts, $content = null ) {
796
  return $return;
797
  }
798
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
799
  /*--------------------------------------------------------------------------------------
800
  *
801
  * bs_lead
803
  *
804
  *-------------------------------------------------------------------------------------*/
805
  function bs_lead( $atts, $content = null ) {
806
+ return '<p class="lead">' . do_shortcode( $content ) . '</p>';
807
+
808
  }
809
 
810
  /*--------------------------------------------------------------------------------------
817
  extract(shortcode_atts(array(
818
  "type" => 'muted'
819
  ), $atts));
820
+ return '<p class="text-' . $type . '">' . do_shortcode( $content ) . '</p>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
821
 
822
  }
823
+
824
  /*--------------------------------------------------------------------------------------
825
  *
826
  * bs_thumbnail
922
  *
923
  *-------------------------------------------------------------------------------------*/
924
  function bs_modal_footer( $atts, $content = null ) {
925
+ return '<div class="modal-footer">' . do_shortcode( $content ) . '</div>';
926
+
927
  }
928
 
929
  }
includes/actions-filters.php CHANGED
@@ -1,9 +1,6 @@
1
  <?php
2
- function bootstrap_shortcodes_help_styles() {
3
  wp_register_style( 'bootstrap-shortcodes-help', plugins_url( 'bootstrap-3-shortcodes/includes/help/css/bootstrap-shortcodes-help.css' ) );
4
  wp_enqueue_style( 'bootstrap-shortcodes-help' );
5
- }
6
- add_action( 'admin_enqueue_scripts', 'bootstrap_shortcodes_help_styles' );
7
 
8
  add_filter('the_content', 'bs_fix_shortcodes');
9
 
@@ -24,8 +21,9 @@ function add_bootstrap_button($context) {
24
  //our popup's title
25
  $title = 'Bootstrap Shortcodes Help';
26
 
 
27
  $context .= "<a title='{$title}'
28
- href='#TB_inline?width=640&inlineId={$popup_url}&width=640&height=550' class='thickbox button add_media' style='padding-left: 0px; padding-right: 0px;' title='Bootstrap Shortcodes Help'>
29
  <img src='{$img}' style='height: 20px; position: relative; top: -2px;'></a>";
30
 
31
  return $context;
1
  <?php
 
2
  wp_register_style( 'bootstrap-shortcodes-help', plugins_url( 'bootstrap-3-shortcodes/includes/help/css/bootstrap-shortcodes-help.css' ) );
3
  wp_enqueue_style( 'bootstrap-shortcodes-help' );
 
 
4
 
5
  add_filter('the_content', 'bs_fix_shortcodes');
6
 
21
  //our popup's title
22
  $title = 'Bootstrap Shortcodes Help';
23
 
24
+ //append the icon
25
  $context .= "<a title='{$title}'
26
+ href='#TB_inline?inlineId={$popup_url}&width=640&height=550' class='thickbox button add_media' style='padding-left: 0px; padding-right: 0px;' title='Bootstrap Shortcodes Help'>
27
  <img src='{$img}' style='height: 20px; position: relative; top: -2px;'></a>";
28
 
29
  return $context;
includes/bootstrap-shortcodes-help.php CHANGED
@@ -45,10 +45,8 @@ $html = MarkdownExtra::defaultTransform($text);
45
  # Put HTML content in the document
46
  $html = preg_replace('/(<a href="http:[^"]+")>/is','\\1 target="_blank">',$html);
47
  $html = str_replace('<table>', '<table class="table table-striped">', $html);
48
- $html = str_replace('<ul>', '<div class="list-group">', $html);
49
- $html = str_replace('</ul>', '</div">', $html);
50
- $html = str_replace('<li><a ', '<a class="list-group-item" ', $html);
51
- $html = str_replace('</li>', '', $html);
52
  $html = preg_replace_callback("#<(h[1-6])>(.*?)</\\1>#", "retitle", $html);
53
  $html = str_replace('</pre>', '</pre><p><button class="btn btn-primary btn-sm insert-code">Insert Example <i class="glyphicon glyphicon-share-alt"></i></button></p>', $html);
54
  echo $html;
45
  # Put HTML content in the document
46
  $html = preg_replace('/(<a href="http:[^"]+")>/is','\\1 target="_blank">',$html);
47
  $html = str_replace('<table>', '<table class="table table-striped">', $html);
48
+ $html = str_replace('<ul>', '<ul class="list-group">', $html);
49
+ $html = str_replace('<li>', '<li class="list-group-item">', $html);
 
 
50
  $html = preg_replace_callback("#<(h[1-6])>(.*?)</\\1>#", "retitle", $html);
51
  $html = str_replace('</pre>', '</pre><p><button class="btn btn-primary btn-sm insert-code">Insert Example <i class="glyphicon glyphicon-share-alt"></i></button></p>', $html);
52
  echo $html;
includes/help/css/bootstrap-shortcodes-help.css CHANGED
@@ -1,10 +1,3 @@
1
- #bootstrap-shortcodes-help a:link,
2
- #bootstrap-shortcodes-help a:visited {
3
- color: #428bca;
4
- font-size: 14px;
5
- }
6
-
7
-
8
  /* CSS crunched with Crunch - http://crunchapp.net/ */
9
  #bootstrap-shortcodes-help {
10
  /*! normalize.css v2.1.3 | MIT License | git.io/normalize */
 
 
 
 
 
 
 
1
  /* CSS crunched with Crunch - http://crunchapp.net/ */
2
  #bootstrap-shortcodes-help {
3
  /*! normalize.css v2.1.3 | MIT License | git.io/normalize */
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: filipstefansson, nodley, FoolsRun
3
  Tags: bootstrap, shortcode, shortcodes, responsive, grid
4
  Requires at least: 3.8
5
  Tested up to: 3.8
6
- Stable tag: 3.0.3.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -65,9 +65,6 @@ No, we assume you are already working with a WordPress theme that includes the B
65
 
66
  == Changelog ==
67
 
68
- = 3.0.3.2 =
69
- * Fix help tab popup on edit pages
70
-
71
  = 3.0.3.1 =
72
  * Change help-tab to inline rather than iframe in to meet WordPress.org submission requirements
73
  * Add support for images (http://getbootstrap.com/css/#images)
3
  Tags: bootstrap, shortcode, shortcodes, responsive, grid
4
  Requires at least: 3.8
5
  Tested up to: 3.8
6
+ Stable tag: 3.0.3.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
65
 
66
  == Changelog ==
67
 
 
 
 
68
  = 3.0.3.1 =
69
  * Change help-tab to inline rather than iframe in to meet WordPress.org submission requirements
70
  * Add support for images (http://getbootstrap.com/css/#images)