Version Description
- Add support for [container] shortcode for themes without a container defined
- Add support for [carousel] and [carousel-item] shortcodes
- Add support for "xclass" and "data" parameters to all shortcodes
- Plenty of bugfixes and code cleanup to fix common issues
Download this release
Release Info
Developer | FoolsRun |
Plugin | Bootstrap Shortcodes for WordPress |
Version | 3.0.3.5 |
Comparing to | |
See all releases |
Code changes from version 3.0.3.2 to 3.0.3.5
- README.md +168 -26
- bootstrap-shortcodes.php +528 -93
- includes/actions-filters.php +11 -11
- includes/bootstrap-shortcodes-help.php +6 -4
- includes/php_markdown/Michelf/Markdown.inc.php +10 -0
- includes/php_markdown/Michelf/Markdown.php +45 -33
- includes/php_markdown/Michelf/MarkdownExtra.inc.php +11 -0
- includes/php_markdown/Michelf/MarkdownInterface.inc.php +9 -0
- includes/php_markdown/Michelf/MarkdownInterface.php +37 -0
- includes/php_markdown/Readme.md +68 -13
- includes/php_markdown/Readme.php +1 -1
- includes/php_markdown/composer.json +1 -1
- readme.txt +11 -2
README.md
CHANGED
@@ -43,6 +43,7 @@ The plugin is tested to work with ```Bootstrap 3``` and ```WordPress 3.8```.
|
|
43 |
* [Tooltip](#tooltip)
|
44 |
* [Popover](#popover)
|
45 |
* [Collapse (Accordion)](#collapse-(accordion))
|
|
|
46 |
* [Modal](#modal)
|
47 |
|
48 |
|
@@ -51,18 +52,39 @@ The plugin is tested to work with ```Bootstrap 3``` and ```WordPress 3.8```.
|
|
51 |
## CSS
|
52 |
|
53 |
### Grid
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
#### [row] parameters
|
65 |
-
|
|
|
|
|
|
|
66 |
|
67 |
#### [column] parameters
|
68 |
Parameter | Description | Required | Values | Default
|
@@ -84,6 +106,7 @@ 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 |
|
@@ -91,7 +114,10 @@ xclass | Any extra classes you want to add | optional | any text | none
|
|
91 |
[lead] … [/lead]
|
92 |
|
93 |
#### [lead] parameters
|
94 |
-
|
|
|
|
|
|
|
95 |
|
96 |
[Bootstrap body copy documentation](http://getbootstrap.com/css/#type-body-copy)
|
97 |
|
@@ -102,6 +128,8 @@ None
|
|
102 |
Parameter | Description | Required | Values | Default
|
103 |
--- | --- | --- | --- | ---
|
104 |
type | The type of label to display | required | muted, primary, success, info, warning, danger | muted
|
|
|
|
|
105 |
|
106 |
[Bootstrap emphasis classes documentation](http://getbootstrap.com/css/#type-emphasis)
|
107 |
|
@@ -113,6 +141,8 @@ Parameter | Description | Required | Values | Default
|
|
113 |
--- | --- | --- | --- | ---
|
114 |
inline | Display inline code | optional | true, false | false
|
115 |
scrollable | Set a max height of 350px and provide a scroll bar. Not usable with inline="true". | optional | true, false | false
|
|
|
|
|
116 |
|
117 |
[Bootstrap code documentation](http://getbootstrap.com/css/#code)
|
118 |
|
@@ -130,6 +160,8 @@ bordered | Set "bordered" table style (see Bootstrap documentation) | optional |
|
|
130 |
striped | Set "striped" table style (see Bootstrap documentation) | optional | true, false | false
|
131 |
hover | Set "hover" table style (see Bootstrap documentation) | optional | true, false | false
|
132 |
condensed | Set "condensed" table style (see Bootstrap documentation) | optional | true, false | false
|
|
|
|
|
133 |
|
134 |
[Bootstrap table documentation](http://getbootstrap.com/css/#tables)
|
135 |
|
@@ -142,11 +174,11 @@ 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 [
|
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
|
149 |
-
data | Data attribute and value pairs separated by a comma. Pairs separated by pipe (see example
|
150 |
|
151 |
[Bootstrap button documentation](http://getbootstrap.com/css/#buttons)
|
152 |
|
@@ -159,6 +191,8 @@ 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 |
|
@@ -170,6 +204,8 @@ Parameter | Description | Required | Values | Default
|
|
170 |
--- | --- | --- | --- | ---
|
171 |
visible | Sizes at which this element is visible (separated by spaces) | optional | xs, sm, md, lg | false
|
172 |
hidden | Sizes at which this element is hidden (separated by spaces) | optional | xs, sm, md, lg | false
|
|
|
|
|
173 |
|
174 |
[Bootstrap emphasis classes documentation](http://getbootstrap.com/css/#type-emphasis)
|
175 |
|
@@ -182,6 +218,8 @@ hidden | Sizes at which this element is hidden (separated by spaces) | optional
|
|
182 |
Parameter | Description | Required | Values | Default
|
183 |
--- | --- | --- | --- | ---
|
184 |
type | The type of icon you want to display | required | See Bootstrap docs | none
|
|
|
|
|
185 |
|
186 |
[Bootstrap Glyphicons documentation](http://getbootstrap.com/components/#glyphicons)
|
187 |
|
@@ -217,9 +255,14 @@ 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 |
-
|
|
|
|
|
|
|
223 |
|
224 |
[Bootstrap button groups documentation](http://getbootstrap.com/css/#btn-groups)
|
225 |
|
@@ -259,18 +302,29 @@ Button Dropdowns can be accomplished by combining the [button-group] shortcode,
|
|
259 |
[/button-group]
|
260 |
|
261 |
#### [dropdown] parameters
|
262 |
-
|
|
|
|
|
|
|
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 |
-
|
|
|
|
|
|
|
271 |
|
272 |
#### [divider] parameters
|
273 |
-
|
|
|
|
|
|
|
274 |
|
275 |
[Bootstrap button dropdowns documentation](http://getbootstrap.com/components/#btn-dropdowns)
|
276 |
|
@@ -298,6 +352,8 @@ Parameter | Description | Required | Values | Default
|
|
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
|
@@ -305,6 +361,8 @@ Parameter | Description | Required | Values | Default
|
|
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 |
|
@@ -317,12 +375,17 @@ disabled | Whether the item is disabled | optional | true, false | false
|
|
317 |
[/breadcrumb]
|
318 |
|
319 |
#### [breadcrumb] parameters
|
320 |
-
|
|
|
|
|
|
|
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 |
|
@@ -333,6 +396,8 @@ link | The url you want the breadcrumb-item to link to | optional | any valid li
|
|
333 |
Parameter | Description | Required | Values | Default
|
334 |
--- | --- | --- | --- | ---
|
335 |
type | The type of label to display | optional | default, primary, success, info, warning, danger | default
|
|
|
|
|
336 |
|
337 |
[Bootstrap label documentation](http://getbootstrap.com/components/#labels)
|
338 |
|
@@ -343,6 +408,8 @@ type | The type of label to display | optional | default, primary, success, info
|
|
343 |
Parameter | Description | Required | Values | Default
|
344 |
--- | --- | --- | --- | ---
|
345 |
right | Whether the badge should align to the right of its container | optional | true, false | false
|
|
|
|
|
346 |
|
347 |
[Bootstrap badges documentation](http://getbootstrap.com/components/#badges)
|
348 |
|
@@ -353,6 +420,8 @@ right | Whether the badge should align to the right of its container | optional
|
|
353 |
Parameter | Description | Required | Values | Default
|
354 |
--- | --- | --- | --- | ---
|
355 |
title | The jumbotron title | optional | Any text | none
|
|
|
|
|
356 |
|
357 |
[Bootstrap jumbotron documentation](http://getbootstrap.com/components/#jumbotron)
|
358 |
|
@@ -361,7 +430,10 @@ title | The jumbotron title | optional | Any text | none
|
|
361 |
|
362 |
Automatically inserts H1 tag if not present
|
363 |
#### [page-header] parameters
|
364 |
-
|
|
|
|
|
|
|
365 |
|
366 |
[Bootstrap page-header documentation](http://getbootstrap.com/components/#page-header)
|
367 |
|
@@ -371,7 +443,10 @@ None
|
|
371 |
[thumbnail] … [/thumbnail]
|
372 |
|
373 |
#### [thumbnail] parameters
|
374 |
-
|
|
|
|
|
|
|
375 |
|
376 |
[Bootstrap thumbnails documentation](http://getbootstrap.com/components/#thumbnails)
|
377 |
|
@@ -383,6 +458,8 @@ 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 |
|
@@ -397,12 +474,16 @@ 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 |
|
@@ -418,17 +499,24 @@ type | The type of the progress bar | optional | default, primary, success, info
|
|
418 |
[/media]
|
419 |
|
420 |
#### [media] parameters
|
421 |
-
|
|
|
|
|
|
|
422 |
|
423 |
#### [media-object] parameters
|
424 |
Parameter | Description | Required | Values | Default
|
425 |
--- | --- | --- | --- | ---
|
426 |
pull | Whether the image pulls to the left or right | optional | left, right | right
|
|
|
|
|
427 |
|
428 |
#### [media-body] parameters
|
429 |
Parameter | Description | Required | Values | Default
|
430 |
--- | --- | --- | --- | ---
|
431 |
title | The object title | required | Any text | none
|
|
|
|
|
432 |
|
433 |
__NOTE: media-object should contain an image, or linked image, inserted using the WordPress TinyMCE editor__
|
434 |
|
@@ -482,18 +570,28 @@ __NOTE: media-object should contain an image, or linked image, inserted using th
|
|
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 |
-
|
|
|
|
|
|
|
494 |
|
495 |
#### [list-group-item-text] parameters
|
496 |
-
|
|
|
|
|
|
|
497 |
|
498 |
[Bootstrap list groups documentation](http://getbootstrap.com/components/#list-group)
|
499 |
|
@@ -506,6 +604,8 @@ Parameter | Description | Required | Values | Default
|
|
506 |
type | The type of the panel | optional | default, primary, success, info, warning, danger, link | default
|
507 |
title | The panel title | required | any text | none
|
508 |
footer | The panel footer text if desired | optional | any text | none
|
|
|
|
|
509 |
|
510 |
[Bootstrap panels documentation](http://getbootstrap.com/components/#panels)
|
511 |
|
@@ -516,6 +616,8 @@ footer | The panel footer text if desired | optional | any text | none
|
|
516 |
Parameter | Description | Required | Values | Default
|
517 |
--- | --- | --- | --- | ---
|
518 |
size | Modifies the amount of padding inside the well | optional | sm, lg | normal
|
|
|
|
|
519 |
|
520 |
[Bootstrap wells documentation](http://getbootstrap.com/components/#wells)
|
521 |
|
@@ -535,12 +637,17 @@ size | Modifies the amount of padding inside the well | optional | sm, lg | norm
|
|
535 |
[/tabs]
|
536 |
|
537 |
#### [tabs] parameters
|
538 |
-
|
|
|
|
|
|
|
539 |
|
540 |
#### [tab] parameters
|
541 |
Parameter | Description | Required | Values | Default
|
542 |
--- | --- | --- | --- | ---
|
543 |
title | The title of the tab | required | any text | false
|
|
|
|
|
544 |
|
545 |
[Bootstrap tabs documentation](http://getbootstrap.com/javascript/#tabs)
|
546 |
|
@@ -585,7 +692,10 @@ html | Insert HTML into the tooltip | optional | true, false | false
|
|
585 |
[/collapsibles]
|
586 |
|
587 |
#### [collapsibles] parameters
|
588 |
-
|
|
|
|
|
|
|
589 |
|
590 |
#### [collapse] parameters
|
591 |
Parameter | Description | Required | Values | Default
|
@@ -593,9 +703,37 @@ Parameter | Description | Required | Values | Default
|
|
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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
599 |
### Modal
|
600 |
[modal text="This is my modal" title="Modal Title Goes Here" xclass="btn btn-primary btn-large"]
|
601 |
…
|
@@ -610,8 +748,12 @@ Parameter | Description | Required | Values | Default
|
|
610 |
text | Text of the modal trigger link | required | any text | none
|
611 |
title | Title of the modal popup | required | any text | none
|
612 |
xclass | Any extra classes you want to add to the trigger link | optional | any text | none
|
|
|
613 |
|
614 |
#### [modal-footer] parameters
|
615 |
-
|
|
|
|
|
|
|
616 |
|
617 |
[Bootstrap modal documentation](http://getbootstrap.com/javascript/#modals)
|
43 |
* [Tooltip](#tooltip)
|
44 |
* [Popover](#popover)
|
45 |
* [Collapse (Accordion)](#collapse-(accordion))
|
46 |
+
* [Carousel](#carousel)
|
47 |
* [Modal](#modal)
|
48 |
|
49 |
|
52 |
## CSS
|
53 |
|
54 |
### Grid
|
55 |
+
[row]
|
56 |
+
[column md="6"]
|
57 |
+
…
|
58 |
+
[/column]
|
59 |
+
[column md="6"]
|
60 |
+
…
|
61 |
+
[/column]
|
62 |
+
[/row]
|
63 |
+
|
64 |
+
The container component is also supported in case your theme doesn't incude a container.
|
65 |
+
|
66 |
+
[container]
|
67 |
+
[row]
|
68 |
+
[column md="6"]
|
69 |
+
…
|
70 |
+
[/column]
|
71 |
+
[column md="6"]
|
72 |
+
…
|
73 |
+
[/column]
|
74 |
+
[/row]
|
75 |
+
[/container]
|
76 |
+
|
77 |
+
#### [container] parameters
|
78 |
+
Parameter | Description | Required | Values | Default
|
79 |
+
--- | --- | --- | --- | ---
|
80 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
81 |
+
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
|
82 |
|
83 |
#### [row] parameters
|
84 |
+
Parameter | Description | Required | Values | Default
|
85 |
+
--- | --- | --- | --- | ---
|
86 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
87 |
+
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
|
88 |
|
89 |
#### [column] parameters
|
90 |
Parameter | Description | Required | Values | Default
|
106 |
push_md | Push on column on medium screens | optional | 1-12 | false
|
107 |
push_lg | Push on column on large screens | optional | 1-12 | false
|
108 |
xclass | Any extra classes you want to add | optional | any text | none
|
109 |
+
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
|
110 |
|
111 |
[Bootstrap grid documentation](http://getbootstrap.com/css/#grid).
|
112 |
|
114 |
[lead] … [/lead]
|
115 |
|
116 |
#### [lead] parameters
|
117 |
+
Parameter | Description | Required | Values | Default
|
118 |
+
--- | --- | --- | --- | ---
|
119 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
120 |
+
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
|
121 |
|
122 |
[Bootstrap body copy documentation](http://getbootstrap.com/css/#type-body-copy)
|
123 |
|
128 |
Parameter | Description | Required | Values | Default
|
129 |
--- | --- | --- | --- | ---
|
130 |
type | The type of label to display | required | muted, primary, success, info, warning, danger | muted
|
131 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
132 |
+
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
|
133 |
|
134 |
[Bootstrap emphasis classes documentation](http://getbootstrap.com/css/#type-emphasis)
|
135 |
|
141 |
--- | --- | --- | --- | ---
|
142 |
inline | Display inline code | optional | true, false | false
|
143 |
scrollable | Set a max height of 350px and provide a scroll bar. Not usable with inline="true". | optional | true, false | false
|
144 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
145 |
+
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
|
146 |
|
147 |
[Bootstrap code documentation](http://getbootstrap.com/css/#code)
|
148 |
|
160 |
striped | Set "striped" table style (see Bootstrap documentation) | optional | true, false | false
|
161 |
hover | Set "hover" table style (see Bootstrap documentation) | optional | true, false | false
|
162 |
condensed | Set "condensed" table style (see Bootstrap documentation) | optional | true, false | false
|
163 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
164 |
+
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
|
165 |
|
166 |
[Bootstrap table documentation](http://getbootstrap.com/css/#tables)
|
167 |
|
174 |
type | The type of the button | optional | default, primary, success, info, warning, danger, link | default
|
175 |
size | The size of the button | optional | xs, sm, lg | none
|
176 |
block | Whether the button should be a block-level button | optional | true, false | false
|
177 |
+
dropdown | Whether the button triggers a dropdown menu (see [Button Dropdowns](#button-dropdowns)) | optional | true, false | false
|
178 |
xclass | Any extra classes you want to add | optional | any text | none
|
179 |
link | The url you want the button to link to | optional | any valid link | none
|
180 |
target | Target for the link | optional | any valid target | none
|
181 |
+
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
|
182 |
|
183 |
[Bootstrap button documentation](http://getbootstrap.com/css/#buttons)
|
184 |
|
191 |
--- | --- | --- | --- | ---
|
192 |
type | The effect to apply to wrapped images | optional | rounded, circle, thumbnail | false
|
193 |
responsive | Make the wrapped images responsive | optional | true, false | false
|
194 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
195 |
+
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
|
196 |
|
197 |
[Bootstrap images documentation](http://getbootstrap.com/css/#images)
|
198 |
|
204 |
--- | --- | --- | --- | ---
|
205 |
visible | Sizes at which this element is visible (separated by spaces) | optional | xs, sm, md, lg | false
|
206 |
hidden | Sizes at which this element is hidden (separated by spaces) | optional | xs, sm, md, lg | false
|
207 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
208 |
+
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
|
209 |
|
210 |
[Bootstrap emphasis classes documentation](http://getbootstrap.com/css/#type-emphasis)
|
211 |
|
218 |
Parameter | Description | Required | Values | Default
|
219 |
--- | --- | --- | --- | ---
|
220 |
type | The type of icon you want to display | required | See Bootstrap docs | none
|
221 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
222 |
+
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
|
223 |
|
224 |
[Bootstrap Glyphicons documentation](http://getbootstrap.com/components/#glyphicons)
|
225 |
|
255 |
justified | Whether button group is justified | optional | true, false | false
|
256 |
vertical | Whether button group is vertical | optional | true, false | false
|
257 |
dropup | **Must correspond with the use of [dropdown]** | optional | true, false | false
|
258 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
259 |
+
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
|
260 |
|
261 |
#### [button-toolbar] parameters
|
262 |
+
Parameter | Description | Required | Values | Default
|
263 |
+
--- | --- | --- | --- | ---
|
264 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
265 |
+
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
|
266 |
|
267 |
[Bootstrap button groups documentation](http://getbootstrap.com/css/#btn-groups)
|
268 |
|
302 |
[/button-group]
|
303 |
|
304 |
#### [dropdown] parameters
|
305 |
+
Parameter | Description | Required | Values | Default
|
306 |
+
--- | --- | --- | --- | ---
|
307 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
308 |
+
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
|
309 |
|
310 |
#### [dropdown-item] parameters
|
311 |
Parameter | Description | Required | Values | Default
|
312 |
--- | --- | --- | --- | ---
|
313 |
link | The url you want the dropdown-item to link to | optional | any valid link | none
|
314 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
315 |
+
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
|
316 |
|
317 |
#### [caret] parameters
|
318 |
+
Parameter | Description | Required | Values | Default
|
319 |
+
--- | --- | --- | --- | ---
|
320 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
321 |
+
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
|
322 |
|
323 |
#### [divider] parameters
|
324 |
+
Parameter | Description | Required | Values | Default
|
325 |
+
--- | --- | --- | --- | ---
|
326 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
327 |
+
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
|
328 |
|
329 |
[Bootstrap button dropdowns documentation](http://getbootstrap.com/components/#btn-dropdowns)
|
330 |
|
352 |
type | The type of nav | required | tabs, pills | tabs
|
353 |
stacked | Whether the nav is stacked (should be used with "pills" type | optional | true, false | false
|
354 |
justified | Whether the nav is justified | optional | true, false | false
|
355 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
356 |
+
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
|
357 |
|
358 |
#### [nav-item] parameters
|
359 |
Parameter | Description | Required | Values | Default
|
361 |
link | The url you want the dropdown-item to link to | optional | any valid link | none
|
362 |
active | Whether the item has the "active" style applied | optional | true, false | false
|
363 |
disabled | Whether the item is disabled | optional | true, false | false
|
364 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
365 |
+
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
|
366 |
|
367 |
[Bootstrap button navs documentation](http://getbootstrap.com/components/#nav)
|
368 |
|
375 |
[/breadcrumb]
|
376 |
|
377 |
#### [breadcrumb] parameters
|
378 |
+
Parameter | Description | Required | Values | Default
|
379 |
+
--- | --- | --- | --- | ---
|
380 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
381 |
+
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
|
382 |
|
383 |
#### [breadcrumb-item] parameters
|
384 |
Parameter | Description | Required | Values | Default
|
385 |
--- | --- | --- | --- | ---
|
386 |
link | The url you want the breadcrumb-item to link to | optional | any valid link | none
|
387 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
388 |
+
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
|
389 |
|
390 |
[Bootstrap breadcrumbs documentation](http://getbootstrap.com/components/#breadcrumbs)
|
391 |
|
396 |
Parameter | Description | Required | Values | Default
|
397 |
--- | --- | --- | --- | ---
|
398 |
type | The type of label to display | optional | default, primary, success, info, warning, danger | default
|
399 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
400 |
+
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
|
401 |
|
402 |
[Bootstrap label documentation](http://getbootstrap.com/components/#labels)
|
403 |
|
408 |
Parameter | Description | Required | Values | Default
|
409 |
--- | --- | --- | --- | ---
|
410 |
right | Whether the badge should align to the right of its container | optional | true, false | false
|
411 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
412 |
+
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
|
413 |
|
414 |
[Bootstrap badges documentation](http://getbootstrap.com/components/#badges)
|
415 |
|
420 |
Parameter | Description | Required | Values | Default
|
421 |
--- | --- | --- | --- | ---
|
422 |
title | The jumbotron title | optional | Any text | none
|
423 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
424 |
+
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
|
425 |
|
426 |
[Bootstrap jumbotron documentation](http://getbootstrap.com/components/#jumbotron)
|
427 |
|
430 |
|
431 |
Automatically inserts H1 tag if not present
|
432 |
#### [page-header] parameters
|
433 |
+
Parameter | Description | Required | Values | Default
|
434 |
+
--- | --- | --- | --- | ---
|
435 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
436 |
+
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
|
437 |
|
438 |
[Bootstrap page-header documentation](http://getbootstrap.com/components/#page-header)
|
439 |
|
443 |
[thumbnail] … [/thumbnail]
|
444 |
|
445 |
#### [thumbnail] parameters
|
446 |
+
Parameter | Description | Required | Values | Default
|
447 |
+
--- | --- | --- | --- | ---
|
448 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
449 |
+
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
|
450 |
|
451 |
[Bootstrap thumbnails documentation](http://getbootstrap.com/components/#thumbnails)
|
452 |
|
458 |
--- | --- | --- | --- | ---
|
459 |
type | The type of the alert | required | success, info, warning, danger | success
|
460 |
dismissable | If the alert should be dismissable | optional | true, false | false
|
461 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
462 |
+
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
|
463 |
|
464 |
[Bootstrap alert documentation](http://getbootstrap.com/components/#alerts)
|
465 |
|
474 |
--- | --- | --- | --- | ---
|
475 |
striped | Whether enclosed progress bars will be striped | optional | true, false | false
|
476 |
animated | Whether enclosed progress bars will be animated | optional | true, false | false
|
477 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
478 |
+
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
|
479 |
|
480 |
#### [progress-bar] parameters
|
481 |
Parameter | Description | Required | Values | Default
|
482 |
--- | --- | --- | --- | ---
|
483 |
percent | The percentage amount to show in the progress bar | required | any number between 0 and 100 | false
|
484 |
type | The type of the progress bar | optional | default, primary, success, info, warning, danger | default
|
485 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
486 |
+
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
|
487 |
|
488 |
[Bootstrap progress bars documentation](http://getbootstrap.com/components/#progress)
|
489 |
|
499 |
[/media]
|
500 |
|
501 |
#### [media] parameters
|
502 |
+
Parameter | Description | Required | Values | Default
|
503 |
+
--- | --- | --- | --- | ---
|
504 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
505 |
+
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
|
506 |
|
507 |
#### [media-object] parameters
|
508 |
Parameter | Description | Required | Values | Default
|
509 |
--- | --- | --- | --- | ---
|
510 |
pull | Whether the image pulls to the left or right | optional | left, right | right
|
511 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
512 |
+
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
|
513 |
|
514 |
#### [media-body] parameters
|
515 |
Parameter | Description | Required | Values | Default
|
516 |
--- | --- | --- | --- | ---
|
517 |
title | The object title | required | Any text | none
|
518 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
519 |
+
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
|
520 |
|
521 |
__NOTE: media-object should contain an image, or linked image, inserted using the WordPress TinyMCE editor__
|
522 |
|
570 |
Parameter | Description | Required | Values | Default
|
571 |
--- | --- | --- | --- | ---
|
572 |
linked | Whether this is a linked list group, or a standard one | optional | true, false | false
|
573 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
574 |
+
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
|
575 |
|
576 |
#### [list-group-item] parameters
|
577 |
Parameter | Description | Required | Values | Default
|
578 |
--- | --- | --- | --- | ---
|
579 |
link | The url you want the list item to link to **Must correspond with the "linked" parameter in [list-group]** | optional | any text | false
|
580 |
active | Whether the item has the "active" style applied | optional | true, false | false
|
581 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
582 |
+
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
|
583 |
|
584 |
#### [list-group-item-heading] parameters
|
585 |
+
Parameter | Description | Required | Values | Default
|
586 |
+
--- | --- | --- | --- | ---
|
587 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
588 |
+
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
|
589 |
|
590 |
#### [list-group-item-text] parameters
|
591 |
+
Parameter | Description | Required | Values | Default
|
592 |
+
--- | --- | --- | --- | ---
|
593 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
594 |
+
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
|
595 |
|
596 |
[Bootstrap list groups documentation](http://getbootstrap.com/components/#list-group)
|
597 |
|
604 |
type | The type of the panel | optional | default, primary, success, info, warning, danger, link | default
|
605 |
title | The panel title | required | any text | none
|
606 |
footer | The panel footer text if desired | optional | any text | none
|
607 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
608 |
+
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
|
609 |
|
610 |
[Bootstrap panels documentation](http://getbootstrap.com/components/#panels)
|
611 |
|
616 |
Parameter | Description | Required | Values | Default
|
617 |
--- | --- | --- | --- | ---
|
618 |
size | Modifies the amount of padding inside the well | optional | sm, lg | normal
|
619 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
620 |
+
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
|
621 |
|
622 |
[Bootstrap wells documentation](http://getbootstrap.com/components/#wells)
|
623 |
|
637 |
[/tabs]
|
638 |
|
639 |
#### [tabs] parameters
|
640 |
+
Parameter | Description | Required | Values | Default
|
641 |
+
--- | --- | --- | --- | ---
|
642 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
643 |
+
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
|
644 |
|
645 |
#### [tab] parameters
|
646 |
Parameter | Description | Required | Values | Default
|
647 |
--- | --- | --- | --- | ---
|
648 |
title | The title of the tab | required | any text | false
|
649 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
650 |
+
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
|
651 |
|
652 |
[Bootstrap tabs documentation](http://getbootstrap.com/javascript/#tabs)
|
653 |
|
692 |
[/collapsibles]
|
693 |
|
694 |
#### [collapsibles] parameters
|
695 |
+
Parameter | Description | Required | Values | Default
|
696 |
+
--- | --- | --- | --- | ---
|
697 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
698 |
+
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
|
699 |
|
700 |
#### [collapse] parameters
|
701 |
Parameter | Description | Required | Values | Default
|
703 |
title | The title of the collapsible, visible when collapsed | required | any text | false
|
704 |
type | The type of the panel | optional | default, primary, success, info, warning, danger, link | default
|
705 |
active | Whether the tab is expanded at load time | optional | true, false | false
|
706 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
707 |
+
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
|
708 |
|
709 |
[Bootstrap collapse documentation](http://getbootstrap.com/javascript/#collapse)
|
710 |
|
711 |
+
### Carousel
|
712 |
+
[carousel]
|
713 |
+
[carousel-item] … [/carousel-item]
|
714 |
+
[carousel-item] … [/carousel-item]
|
715 |
+
[carousel-item] … [/carousel-item]
|
716 |
+
[/carousel]
|
717 |
+
|
718 |
+
[carousel-item] wraps an HTML image tag or image inserted via the WordPress editor.
|
719 |
+
#### [carousel] parameters
|
720 |
+
Parameter | Description | Required | Values | Default
|
721 |
+
--- | --- | --- | --- | ---
|
722 |
+
interval | The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle. | optional | any number (in ms) or "false" | 5000
|
723 |
+
wrap | Whether the carousel should cycle continuously or have hard stops. | optional | true, false | false
|
724 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
725 |
+
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
|
726 |
+
|
727 |
+
#### [carousel-item] parameters
|
728 |
+
Parameter | Description | Required | Values | Default
|
729 |
+
--- | --- | --- | --- | ---
|
730 |
+
caption | This carousel slide's caption | optional | Any text | none
|
731 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
732 |
+
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
|
733 |
+
|
734 |
+
[Bootstrap carousel documentation](http://getbootstrap.com/javascript/#carousel)
|
735 |
+
|
736 |
+
|
737 |
### Modal
|
738 |
[modal text="This is my modal" title="Modal Title Goes Here" xclass="btn btn-primary btn-large"]
|
739 |
…
|
748 |
text | Text of the modal trigger link | required | any text | none
|
749 |
title | Title of the modal popup | required | any text | none
|
750 |
xclass | Any extra classes you want to add to the trigger link | optional | any text | none
|
751 |
+
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
|
752 |
|
753 |
#### [modal-footer] parameters
|
754 |
+
Parameter | Description | Required | Values | Default
|
755 |
+
--- | --- | --- | --- | ---
|
756 |
+
xclass | Any extra classes you want to add | optional | any text | none
|
757 |
+
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
|
758 |
|
759 |
[Bootstrap modal documentation](http://getbootstrap.com/javascript/#modals)
|
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.
|
7 |
Author: Filip Stefansson, Simon Yeldon, and Michael W. Delaney
|
8 |
Author URI:
|
9 |
License: GPL2
|
@@ -31,7 +31,7 @@ require_once(dirname(__FILE__) . '/includes/defaults.php');
|
|
31 |
require_once(dirname(__FILE__) . '/includes/functions.php');
|
32 |
require_once(dirname(__FILE__) . '/includes/actions-filters.php');
|
33 |
|
34 |
-
function
|
35 |
|
36 |
// Bootstrap tooltip js
|
37 |
wp_enqueue_script( 'bootstrap-shortcodes-tooltip', BS_SHORTCODES_URL . 'js/bootstrap-shortcodes-tooltip.js', array( 'jquery' ), false, true );
|
@@ -40,7 +40,7 @@ function bootsrap_shortcodes_scripts() {
|
|
40 |
wp_enqueue_script( 'bootstrap-shortcodes-popover', BS_SHORTCODES_URL . 'js/bootstrap-shortcodes-popover.js', array( 'jquery' ), false, true );
|
41 |
|
42 |
}
|
43 |
-
add_action( 'wp_enqueue_scripts', '
|
44 |
|
45 |
// Begin Shortcodes
|
46 |
class BoostrapShortcodes {
|
@@ -64,6 +64,7 @@ class BoostrapShortcodes {
|
|
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' ));
|
@@ -90,6 +91,8 @@ class BoostrapShortcodes {
|
|
90 |
add_shortcode('table-wrap', array( $this, 'bs_table_wrap' ));
|
91 |
add_shortcode('collapsibles', array( $this, 'bs_collapsibles' ));
|
92 |
add_shortcode('collapse', array( $this, 'bs_collapse' ));
|
|
|
|
|
93 |
add_shortcode('well', array( $this, 'bs_well' ));
|
94 |
add_shortcode('tabs', array( $this, 'bs_tabs' ));
|
95 |
add_shortcode('tab', array( $this, 'bs_tab' ));
|
@@ -133,13 +136,7 @@ class BoostrapShortcodes {
|
|
133 |
"title" => false,
|
134 |
"data" => false
|
135 |
), $atts));
|
136 |
-
|
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 : '';
|
@@ -167,14 +164,20 @@ class BoostrapShortcodes {
|
|
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 |
-
|
177 |
-
|
|
|
|
|
|
|
178 |
}
|
179 |
|
180 |
/*--------------------------------------------------------------------------------------
|
@@ -184,7 +187,16 @@ class BoostrapShortcodes {
|
|
184 |
*
|
185 |
*-------------------------------------------------------------------------------------*/
|
186 |
function bs_button_toolbar( $atts, $content = null ) {
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
return $return;
|
189 |
}
|
190 |
|
@@ -197,9 +209,40 @@ class BoostrapShortcodes {
|
|
197 |
*
|
198 |
*-------------------------------------------------------------------------------------*/
|
199 |
function bs_caret( $atts, $content = null ) {
|
200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
return $return;
|
202 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
|
204 |
/*--------------------------------------------------------------------------------------
|
205 |
*
|
@@ -209,7 +252,16 @@ class BoostrapShortcodes {
|
|
209 |
*
|
210 |
*-------------------------------------------------------------------------------------*/
|
211 |
function bs_dropdown( $atts, $content = null ) {
|
212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
return $return;
|
214 |
}
|
215 |
|
@@ -223,8 +275,14 @@ class BoostrapShortcodes {
|
|
223 |
function bs_dropdown_item( $atts, $content = null ) {
|
224 |
extract(shortcode_atts(array(
|
225 |
"link" => false,
|
|
|
|
|
226 |
), $atts));
|
227 |
-
|
|
|
|
|
|
|
|
|
228 |
return $return;
|
229 |
}
|
230 |
|
@@ -236,7 +294,16 @@ class BoostrapShortcodes {
|
|
236 |
*
|
237 |
*-------------------------------------------------------------------------------------*/
|
238 |
function bs_dropdown_divider( $atts, $content = null ) {
|
239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
return $return;
|
241 |
}
|
242 |
|
@@ -251,11 +318,17 @@ class BoostrapShortcodes {
|
|
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 |
-
|
|
|
|
|
|
|
259 |
return $return;
|
260 |
}
|
261 |
|
@@ -271,14 +344,21 @@ class BoostrapShortcodes {
|
|
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
|
281 |
-
|
|
|
|
|
|
|
|
|
282 |
$return .= '</li>';
|
283 |
return $return;
|
284 |
}
|
@@ -294,11 +374,17 @@ 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 |
-
|
|
|
|
|
|
|
302 |
$return .= ($dismissable) ? '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>' : '';
|
303 |
$return .= do_shortcode( $content ) . '</div>';
|
304 |
return $return;
|
@@ -314,11 +400,17 @@ class BoostrapShortcodes {
|
|
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 .= '
|
|
|
|
|
|
|
322 |
return $return;
|
323 |
}
|
324 |
|
@@ -332,10 +424,16 @@ class BoostrapShortcodes {
|
|
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 |
-
|
|
|
|
|
|
|
339 |
<span class="sr-only">'. $percent .'% Complete</span>
|
340 |
</div>';
|
341 |
return $return;
|
@@ -352,13 +450,22 @@ class BoostrapShortcodes {
|
|
352 |
function bs_code($atts, $content = null) {
|
353 |
extract(shortcode_atts(array(
|
354 |
"inline" => false,
|
355 |
-
"scrollable" => false
|
|
|
|
|
356 |
), $atts));
|
|
|
357 |
if($inline) {
|
358 |
-
$return = '<code
|
|
|
|
|
|
|
359 |
} else {
|
360 |
$return = '<pre';
|
361 |
-
$
|
|
|
|
|
|
|
362 |
$return .= '>' . $content . '</pre>';
|
363 |
}
|
364 |
return $return;
|
@@ -397,8 +504,16 @@ class BoostrapShortcodes {
|
|
397 |
*
|
398 |
*-------------------------------------------------------------------------------------*/
|
399 |
function bs_row( $atts, $content = null ) {
|
400 |
-
|
401 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
402 |
return $return;
|
403 |
}
|
404 |
|
@@ -431,8 +546,10 @@ 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 . ' ' : '';
|
438 |
$return .= ($md) ? 'col-md-' . $md . ' ' : '';
|
@@ -450,8 +567,10 @@ 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 .= '"
|
|
|
|
|
455 |
|
456 |
return $return;
|
457 |
}
|
@@ -466,8 +585,15 @@ class BoostrapShortcodes {
|
|
466 |
function bs_list_group( $atts, $content = null ) {
|
467 |
extract(shortcode_atts(array(
|
468 |
"linked" => false,
|
|
|
|
|
469 |
), $atts));
|
470 |
-
|
|
|
|
|
|
|
|
|
|
|
471 |
$return .= do_shortcode( $content );
|
472 |
$return .= ($linked) ? ' </div>' : '</ul>';
|
473 |
return $return;
|
@@ -484,12 +610,18 @@ class BoostrapShortcodes {
|
|
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 |
-
|
|
|
|
|
|
|
493 |
$return .= ($link) ? '</a>' : '</li>';
|
494 |
return $return;
|
495 |
}
|
@@ -501,7 +633,16 @@ class BoostrapShortcodes {
|
|
501 |
*
|
502 |
*-------------------------------------------------------------------------------------*/
|
503 |
function bs_list_group_item_heading( $atts, $content = null ) {
|
504 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
return $return;
|
506 |
}
|
507 |
|
@@ -512,7 +653,16 @@ class BoostrapShortcodes {
|
|
512 |
*
|
513 |
*-------------------------------------------------------------------------------------*/
|
514 |
function bs_list_group_item_text( $atts, $content = null ) {
|
515 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
516 |
return $return;
|
517 |
}
|
518 |
|
@@ -524,7 +674,16 @@ class BoostrapShortcodes {
|
|
524 |
*
|
525 |
*-------------------------------------------------------------------------------------*/
|
526 |
function bs_breadcrumb( $atts, $content = null ) {
|
527 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
528 |
return $return;
|
529 |
}
|
530 |
|
@@ -538,8 +697,14 @@ class BoostrapShortcodes {
|
|
538 |
function bs_breadcrumb_item( $atts, $content = null ) {
|
539 |
extract(shortcode_atts(array(
|
540 |
"link" => false,
|
|
|
|
|
541 |
), $atts));
|
542 |
-
|
|
|
|
|
|
|
|
|
543 |
return $return;
|
544 |
}
|
545 |
|
@@ -553,10 +718,16 @@ class BoostrapShortcodes {
|
|
553 |
*-------------------------------------------------------------------------------------*/
|
554 |
function bs_label( $atts, $content = null ) {
|
555 |
extract(shortcode_atts(array(
|
556 |
-
"type" => 'default'
|
|
|
|
|
557 |
), $atts));
|
558 |
-
|
559 |
-
$return = '<span class="label label-' . $type
|
|
|
|
|
|
|
|
|
560 |
return $return;
|
561 |
}
|
562 |
|
@@ -573,10 +744,17 @@ class BoostrapShortcodes {
|
|
573 |
*-------------------------------------------------------------------------------------*/
|
574 |
function bs_badge( $atts, $content = null ) {
|
575 |
extract(shortcode_atts(array(
|
576 |
-
"right" => false
|
|
|
|
|
577 |
), $atts));
|
|
|
578 |
$right = ($right) ? " pull-right" : "";
|
579 |
-
$return = '<span class="badge' . $right
|
|
|
|
|
|
|
|
|
580 |
return $return;
|
581 |
}
|
582 |
|
@@ -594,9 +772,15 @@ class BoostrapShortcodes {
|
|
594 |
function bs_icon( $atts, $content = null ) {
|
595 |
extract(shortcode_atts(array(
|
596 |
"type" => 'type',
|
|
|
|
|
597 |
), $atts));
|
598 |
-
|
599 |
-
$return = '<span class="glyphicon glyphicon-' . $type
|
|
|
|
|
|
|
|
|
600 |
return $return;
|
601 |
}
|
602 |
|
@@ -657,15 +841,25 @@ class BoostrapShortcodes {
|
|
657 |
'striped' => false,
|
658 |
'hover' => false,
|
659 |
'condensed' => false,
|
660 |
-
|
|
|
|
|
661 |
$classes = 'table';
|
662 |
$classes .= ($bordered) ? ' table-bordered' : '';
|
663 |
$classes .= ($striped) ? ' table-striped' : '';
|
664 |
$classes .= ($hover) ? ' table-hover' : '';
|
665 |
-
$classes .= ($condensed) ? ' table-condensed' : '';
|
|
|
666 |
$dom = new DOMDocument;
|
667 |
$dom->loadXML($content);
|
668 |
$dom->documentElement->setAttribute('class', $dom->documentElement->getAttribute('class') . ' ' . $classes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
669 |
$return = $dom->saveXML();
|
670 |
return $return;
|
671 |
}
|
@@ -684,14 +878,21 @@ class BoostrapShortcodes {
|
|
684 |
*-------------------------------------------------------------------------------------*/
|
685 |
function bs_well( $atts, $content = null ) {
|
686 |
extract(shortcode_atts(array(
|
687 |
-
"size" => false
|
688 |
-
|
|
|
|
|
|
|
689 |
|
690 |
if($size) {
|
691 |
$size = ' well-'.$size;
|
692 |
}
|
693 |
|
694 |
-
$return = '<div class="well' . $size
|
|
|
|
|
|
|
|
|
695 |
return $return;
|
696 |
}
|
697 |
|
@@ -707,12 +908,19 @@ class BoostrapShortcodes {
|
|
707 |
extract(shortcode_atts(array(
|
708 |
"title" => '',
|
709 |
"type" => 'default',
|
710 |
-
"footer" => false
|
711 |
-
|
|
|
|
|
|
|
712 |
if($footer) {
|
713 |
$footer = '<div class="panel-footer">' . $footer . '</div>';
|
714 |
}
|
715 |
-
$return = '<div class="panel panel-' . $type
|
|
|
|
|
|
|
|
|
716 |
return $return;
|
717 |
}
|
718 |
|
@@ -732,9 +940,12 @@ class BoostrapShortcodes {
|
|
732 |
else
|
733 |
$GLOBALS['tabs_count'] = 0;
|
734 |
|
735 |
-
$defaults = array(
|
|
|
|
|
|
|
736 |
extract( shortcode_atts( $defaults, $atts ) );
|
737 |
-
|
738 |
|
739 |
// Extract the tab titles for use in the tab widget.
|
740 |
preg_match_all( '/tab title="([^\"]+)"/i', $content, $matches, PREG_OFFSET_CAPTURE );
|
@@ -745,7 +956,11 @@ class BoostrapShortcodes {
|
|
745 |
$return = '';
|
746 |
|
747 |
if( count($tab_titles) ){
|
748 |
-
$return .= '<ul class="nav
|
|
|
|
|
|
|
|
|
749 |
|
750 |
$i = 0;
|
751 |
foreach( $tab_titles as $tab ){
|
@@ -795,10 +1010,19 @@ class BoostrapShortcodes {
|
|
795 |
}
|
796 |
}
|
797 |
|
798 |
-
$defaults = array(
|
|
|
|
|
|
|
|
|
799 |
extract( shortcode_atts( $defaults, $atts ) );
|
|
|
800 |
|
801 |
-
$return = '<div id="custom-tab-' . $GLOBALS['tabs_count'] . '-'. sanitize_title( $title ) .'" class="tab-pane ' . $state
|
|
|
|
|
|
|
|
|
802 |
return $return;
|
803 |
}
|
804 |
|
@@ -820,8 +1044,12 @@ class BoostrapShortcodes {
|
|
820 |
else
|
821 |
$GLOBALS['collapsibles_count'] = 0;
|
822 |
|
823 |
-
$defaults = array(
|
|
|
|
|
|
|
824 |
extract( shortcode_atts( $defaults, $atts ) );
|
|
|
825 |
|
826 |
// Extract the tab titles for use in the tab widget.
|
827 |
preg_match_all( '/collapse title="([^\"]+)"/i', $content, $matches, PREG_OFFSET_CAPTURE );
|
@@ -832,7 +1060,11 @@ class BoostrapShortcodes {
|
|
832 |
$return = '';
|
833 |
|
834 |
if( count($tab_titles) ){
|
835 |
-
$return .= '<div class="panel-group
|
|
|
|
|
|
|
|
|
836 |
$return .= do_shortcode( $content );
|
837 |
$return .= '</div>';
|
838 |
} else {
|
@@ -843,8 +1075,6 @@ class BoostrapShortcodes {
|
|
843 |
}
|
844 |
|
845 |
|
846 |
-
|
847 |
-
|
848 |
/*--------------------------------------------------------------------------------------
|
849 |
*
|
850 |
* bs_collapse
|
@@ -863,17 +1093,118 @@ 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
873 |
return $return;
|
874 |
}
|
875 |
|
876 |
|
|
|
877 |
/*--------------------------------------------------------------------------------------
|
878 |
*
|
879 |
* bs_tooltip
|
@@ -962,10 +1293,17 @@ function bs_popover( $atts, $content = null ) {
|
|
962 |
function bs_media( $atts, $content = null ) {
|
963 |
|
964 |
$defaults = array(
|
965 |
-
'
|
|
|
966 |
);
|
967 |
extract( shortcode_atts( $defaults, $atts ) );
|
968 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
969 |
return $return;
|
970 |
}
|
971 |
|
@@ -973,13 +1311,24 @@ function bs_media_object( $atts, $content = null ) {
|
|
973 |
|
974 |
$defaults = array(
|
975 |
'pull' => "left",
|
|
|
|
|
976 |
);
|
977 |
extract( shortcode_atts( $defaults, $atts ) );
|
978 |
|
979 |
$classes = "media-object";
|
|
|
|
|
980 |
$dom = new DOMDocument;
|
981 |
$dom->loadXML($content);
|
982 |
$dom->documentElement->setAttribute('class', $dom->documentElement->getAttribute('class') . ' ' . $classes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
983 |
$return = $dom->saveXML();
|
984 |
$return = '<span class="pull-'. $pull . '">' . $return . '</span>';
|
985 |
return $return;
|
@@ -989,9 +1338,16 @@ function bs_media_body( $atts, $content = null ) {
|
|
989 |
|
990 |
$defaults = array(
|
991 |
'title' => false,
|
|
|
|
|
992 |
);
|
993 |
extract( shortcode_atts( $defaults, $atts ) );
|
994 |
-
|
|
|
|
|
|
|
|
|
|
|
995 |
$return .= ($title) ? '<h4 class="media-heading">' . $title . '</h4>' : '';
|
996 |
$return .= $content . '</div>';
|
997 |
return $return;
|
@@ -1005,10 +1361,16 @@ function bs_media_body( $atts, $content = null ) {
|
|
1005 |
*-------------------------------------------------------------------------------------*/
|
1006 |
function bs_jumbotron( $atts, $content = null ) {
|
1007 |
extract(shortcode_atts(array(
|
1008 |
-
"title" => false
|
|
|
|
|
1009 |
), $atts));
|
1010 |
-
|
1011 |
-
$return .='<div class="jumbotron
|
|
|
|
|
|
|
|
|
1012 |
$return .= ($title) ? '<h1>' . $title . '</h1>' : '';
|
1013 |
$return .= do_shortcode( $content ) . '</div>';
|
1014 |
return $return;
|
@@ -1021,7 +1383,14 @@ function bs_media_body( $atts, $content = null ) {
|
|
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');
|
@@ -1041,7 +1410,13 @@ function bs_media_body( $atts, $content = null ) {
|
|
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;
|
@@ -1055,7 +1430,16 @@ function bs_media_body( $atts, $content = null ) {
|
|
1055 |
*
|
1056 |
*-------------------------------------------------------------------------------------*/
|
1057 |
function bs_lead( $atts, $content = null ) {
|
1058 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1059 |
return $return;
|
1060 |
}
|
1061 |
|
@@ -1067,9 +1451,16 @@ function bs_media_body( $atts, $content = null ) {
|
|
1067 |
*-------------------------------------------------------------------------------------*/
|
1068 |
function bs_emphasis( $atts, $content = null ) {
|
1069 |
extract(shortcode_atts(array(
|
1070 |
-
"type" => 'muted'
|
|
|
|
|
1071 |
), $atts));
|
1072 |
-
|
|
|
|
|
|
|
|
|
|
|
1073 |
return $return;
|
1074 |
}
|
1075 |
/*--------------------------------------------------------------------------------------
|
@@ -1082,13 +1473,23 @@ 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 |
|
@@ -1103,7 +1504,12 @@ function bs_img( $atts, $content = null ) {
|
|
1103 |
*
|
1104 |
*-------------------------------------------------------------------------------------*/
|
1105 |
function bs_thumbnail( $atts, $content = null ) {
|
|
|
|
|
|
|
|
|
1106 |
$classes = "thumbnail";
|
|
|
1107 |
$dom = new DOMDocument;
|
1108 |
$dom->loadXML($content);
|
1109 |
if(!$dom->documentElement) {
|
@@ -1111,7 +1517,13 @@ function bs_img( $atts, $content = null ) {
|
|
1111 |
$dom->appendChild($element);
|
1112 |
}
|
1113 |
$dom->documentElement->setAttribute('class', $dom->documentElement->getAttribute('class') . ' ' . $classes);
|
1114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1115 |
$return = $dom->saveXML();
|
1116 |
|
1117 |
return $return;
|
@@ -1128,7 +1540,11 @@ function bs_img( $atts, $content = null ) {
|
|
1128 |
extract( shortcode_atts( array(
|
1129 |
'visible' => '',
|
1130 |
'hidden' => '',
|
1131 |
-
|
|
|
|
|
|
|
|
|
1132 |
if($visible) {
|
1133 |
$visible = explode(' ',$visible);
|
1134 |
foreach($visible as $v):
|
@@ -1141,17 +1557,11 @@ function bs_img( $atts, $content = null ) {
|
|
1141 |
$classes .= 'hidden-'.$h.' ';
|
1142 |
endforeach;
|
1143 |
}
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
}
|
1150 |
-
$dom->documentElement->setAttribute('class', $dom->documentElement->getAttribute('class') . ' ' . $classes);
|
1151 |
-
|
1152 |
-
$return = $dom->saveXML();
|
1153 |
-
|
1154 |
-
return $return;
|
1155 |
|
1156 |
}
|
1157 |
|
@@ -1167,10 +1577,15 @@ function bs_img( $atts, $content = null ) {
|
|
1167 |
extract(shortcode_atts(array(
|
1168 |
"text" => '',
|
1169 |
"title" => '',
|
1170 |
-
"xclass" =>
|
|
|
1171 |
), $atts));
|
|
|
1172 |
$sani_title = 'modal'. sanitize_title( $title );
|
1173 |
-
$return .='<a data-toggle="modal" href="#'. $sani_title .'"
|
|
|
|
|
|
|
1174 |
$return .='<div class="modal fade" id="'. $sani_title .'" tabindex="-1" role="dialog" aria-hidden="true">';
|
1175 |
$return .='<div class="modal-dialog">';
|
1176 |
$return .='<div class="modal-content">';
|
@@ -1197,9 +1612,29 @@ function bs_img( $atts, $content = null ) {
|
|
1197 |
*
|
1198 |
*-------------------------------------------------------------------------------------*/
|
1199 |
function bs_modal_footer( $atts, $content = null ) {
|
1200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1201 |
return $return;
|
1202 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1203 |
|
1204 |
}
|
1205 |
|
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.5
|
7 |
Author: Filip Stefansson, Simon Yeldon, and Michael W. Delaney
|
8 |
Author URI:
|
9 |
License: GPL2
|
31 |
require_once(dirname(__FILE__) . '/includes/functions.php');
|
32 |
require_once(dirname(__FILE__) . '/includes/actions-filters.php');
|
33 |
|
34 |
+
function bootstrap_shortcodes_scripts() {
|
35 |
|
36 |
// Bootstrap tooltip js
|
37 |
wp_enqueue_script( 'bootstrap-shortcodes-tooltip', BS_SHORTCODES_URL . 'js/bootstrap-shortcodes-tooltip.js', array( 'jquery' ), false, true );
|
40 |
wp_enqueue_script( 'bootstrap-shortcodes-popover', BS_SHORTCODES_URL . 'js/bootstrap-shortcodes-popover.js', array( 'jquery' ), false, true );
|
41 |
|
42 |
}
|
43 |
+
add_action( 'wp_enqueue_scripts', 'bootstrap_shortcodes_scripts', 9999 ); // Register this fxn and allow Wordpress to call it automatcally in the header
|
44 |
|
45 |
// Begin Shortcodes
|
46 |
class BoostrapShortcodes {
|
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('container', array( $this, 'bs_container' ));
|
68 |
add_shortcode('dropdown', array( $this, 'bs_dropdown' ));
|
69 |
add_shortcode('dropdown-item', array( $this, 'bs_dropdown_item' ));
|
70 |
add_shortcode('nav', array( $this, 'bs_nav' ));
|
91 |
add_shortcode('table-wrap', array( $this, 'bs_table_wrap' ));
|
92 |
add_shortcode('collapsibles', array( $this, 'bs_collapsibles' ));
|
93 |
add_shortcode('collapse', array( $this, 'bs_collapse' ));
|
94 |
+
add_shortcode('carousel', array( $this, 'bs_carousel' ));
|
95 |
+
add_shortcode('carousel-item', array( $this, 'bs_carousel_item' ));
|
96 |
add_shortcode('well', array( $this, 'bs_well' ));
|
97 |
add_shortcode('tabs', array( $this, 'bs_tabs' ));
|
98 |
add_shortcode('tab', array( $this, 'bs_tab' ));
|
136 |
"title" => false,
|
137 |
"data" => false
|
138 |
), $atts));
|
139 |
+
$data_props = $this->parse_data_attributes($data);
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
$return = '<a href="' . $link . '" class="btn';
|
141 |
$return .= ($type) ? ' btn-' . $type : ' btn-default';
|
142 |
$return .= ($size) ? ' btn-' . $size : '';
|
164 |
"size" => false,
|
165 |
"vertical" => false,
|
166 |
"justified" => false,
|
167 |
+
"dropup" => false,
|
168 |
+
"xclass" => false,
|
169 |
+
"data" => false
|
170 |
), $atts));
|
171 |
+
$data_props = $this->parse_data_attributes($data);
|
172 |
$classes .= ($size) ? ' btn-group-' . $size : '';
|
173 |
$classes .= ($vertical) ? ' btn-group-vertical' : '';
|
174 |
$classes .= ($justified) ? ' btn-group-justified' : '';
|
175 |
$classes .= ($dropup) ? ' dropup' : '';
|
176 |
+
$classes .= ($xclass) ? ' ' . $xclass : '';
|
177 |
+
$return = '<div class="btn-group '.$classes .'"';
|
178 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
179 |
+
$return .= '>' . do_shortcode( $content ) . '</div>';
|
180 |
+
return $return;
|
181 |
}
|
182 |
|
183 |
/*--------------------------------------------------------------------------------------
|
187 |
*
|
188 |
*-------------------------------------------------------------------------------------*/
|
189 |
function bs_button_toolbar( $atts, $content = null ) {
|
190 |
+
extract(shortcode_atts(array(
|
191 |
+
"xclass" => false,
|
192 |
+
"data" => false
|
193 |
+
), $atts));
|
194 |
+
$data_props = $this->parse_data_attributes($data);
|
195 |
+
$return = '<div class="btn-toolbar';
|
196 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
197 |
+
$return .= '"';
|
198 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
199 |
+
$return .=' role="toolbar">' . do_shortcode( $content ) . '</div>';
|
200 |
return $return;
|
201 |
}
|
202 |
|
209 |
*
|
210 |
*-------------------------------------------------------------------------------------*/
|
211 |
function bs_caret( $atts, $content = null ) {
|
212 |
+
extract(shortcode_atts(array(
|
213 |
+
"xclass" => false,
|
214 |
+
"data" => false
|
215 |
+
), $atts));
|
216 |
+
$data_props = $this->parse_data_attributes($data);
|
217 |
+
$return = '<span class="caret';
|
218 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
219 |
+
$return .= '"';
|
220 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
221 |
+
$return .='></span>';
|
222 |
return $return;
|
223 |
}
|
224 |
+
|
225 |
+
/*--------------------------------------------------------------------------------------
|
226 |
+
*
|
227 |
+
* bs_container
|
228 |
+
*
|
229 |
+
* @author Robin Wouters
|
230 |
+
* @since 3.0.3.3
|
231 |
+
*
|
232 |
+
*-------------------------------------------------------------------------------------*/
|
233 |
+
function bs_container( $atts, $content = null ) {
|
234 |
+
extract(shortcode_atts(array(
|
235 |
+
"xclass" => false,
|
236 |
+
"data" => false
|
237 |
+
), $atts));
|
238 |
+
$data_props = $this->parse_data_attributes($data);
|
239 |
+
$return = '<div class="container';
|
240 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
241 |
+
$return .= '"';
|
242 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
243 |
+
$return .='>' . do_shortcode( $content ) . '</div>';
|
244 |
+
return $return;
|
245 |
+
}
|
246 |
|
247 |
/*--------------------------------------------------------------------------------------
|
248 |
*
|
252 |
*
|
253 |
*-------------------------------------------------------------------------------------*/
|
254 |
function bs_dropdown( $atts, $content = null ) {
|
255 |
+
extract(shortcode_atts(array(
|
256 |
+
"xclass" => false,
|
257 |
+
"data" => false
|
258 |
+
), $atts));
|
259 |
+
$data_props = $this->parse_data_attributes($data);
|
260 |
+
$return = '<ul class="dropdown-menu';
|
261 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
262 |
+
$return .= '"';
|
263 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
264 |
+
$return .=' role="menu">' . do_shortcode( $content ) . '</ul>';
|
265 |
return $return;
|
266 |
}
|
267 |
|
275 |
function bs_dropdown_item( $atts, $content = null ) {
|
276 |
extract(shortcode_atts(array(
|
277 |
"link" => false,
|
278 |
+
"xclass" => false,
|
279 |
+
"data" => false
|
280 |
), $atts));
|
281 |
+
$data_props = $this->parse_data_attributes($data);
|
282 |
+
$return = '<li><a href="'. $link .'"';
|
283 |
+
$return .= ($xclass) ? ' class="' . $xclass . '"' : '';
|
284 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
285 |
+
$return .= '>' . do_shortcode( $content ) . '</a></li>';
|
286 |
return $return;
|
287 |
}
|
288 |
|
294 |
*
|
295 |
*-------------------------------------------------------------------------------------*/
|
296 |
function bs_dropdown_divider( $atts, $content = null ) {
|
297 |
+
extract(shortcode_atts(array(
|
298 |
+
"xclass" => false,
|
299 |
+
"data" => false
|
300 |
+
), $atts));
|
301 |
+
$data_props = $this->parse_data_attributes($data);
|
302 |
+
$return = '<li class="divider';
|
303 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
304 |
+
$return .= '"';
|
305 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
306 |
+
$return .='>' . do_shortcode( $content ) . '</li>';
|
307 |
return $return;
|
308 |
}
|
309 |
|
318 |
"type" => 'tabs',
|
319 |
"stacked" => false,
|
320 |
"justified" => false,
|
321 |
+
"xclass" => false,
|
322 |
+
"data" => false
|
323 |
), $atts));
|
324 |
+
$data_props = $this->parse_data_attributes($data);
|
325 |
$classes = 'nav nav-' . $type;
|
326 |
$classes .= ($stacked) ? ' nav-stacked' : '';
|
327 |
$classes .= ($justified) ? ' nav-justified' : '';
|
328 |
+
$classes .= ($xclass) ? ' ' . $xclass : '';
|
329 |
+
$return = '<ul class="'.$classes.'"';
|
330 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
331 |
+
$return .='>' . do_shortcode( $content ) . '</ul>';
|
332 |
return $return;
|
333 |
}
|
334 |
|
344 |
"active" => false,
|
345 |
"disabled" => false,
|
346 |
"dropdown" => false,
|
347 |
+
"xclass" => false,
|
348 |
+
"data" => false
|
349 |
), $atts));
|
350 |
+
$data_props = $this->parse_data_attributes($data);
|
351 |
$return = '<li class="';
|
352 |
$return .= ($dropdown) ? ' dropdown' : '';
|
353 |
$return .= ($active) ? ' active' : '';
|
354 |
$return .= ($disabled) ? ' disabled' : '';
|
355 |
$return .= '"><a href="' . $link . '"';
|
356 |
+
$return .= ($dropdown) ? ' class="dropdown-toggle' : '';
|
357 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
358 |
+
$return .= '"';
|
359 |
+
$return .= ($dropdown) ? ' data-toggle="dropdown"' : '';
|
360 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
361 |
+
$return .= ($dropdown) ? '>' . str_replace("<ul", "</a><ul", do_shortcode( $content )) : '>' . do_shortcode( $content ) . '</a>';
|
362 |
$return .= '</li>';
|
363 |
return $return;
|
364 |
}
|
374 |
function bs_alert($atts, $content = null) {
|
375 |
extract(shortcode_atts(array(
|
376 |
"type" => 'success',
|
377 |
+
"dismissable" => false,
|
378 |
+
"xclass" => false,
|
379 |
+
"data" => false
|
380 |
), $atts));
|
381 |
+
$data_props = $this->parse_data_attributes($data);
|
382 |
$return = '<div class="alert alert-' . $type;
|
383 |
$return .= ($dismissable) ? ' alert-dismissable' : '';
|
384 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
385 |
+
$return .= '"';
|
386 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
387 |
+
$return .='>';
|
388 |
$return .= ($dismissable) ? '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>' : '';
|
389 |
$return .= do_shortcode( $content ) . '</div>';
|
390 |
return $return;
|
400 |
extract(shortcode_atts(array(
|
401 |
"striped" => false,
|
402 |
"animated" => false,
|
403 |
+
"xclass" => false,
|
404 |
+
"data" => false
|
405 |
), $atts));
|
406 |
+
$data_props = $this->parse_data_attributes($data);
|
407 |
$return = '<div class="progress ';
|
408 |
$return .= ($striped) ? 'progress-striped ' : '';
|
409 |
$return .= ($animated) ? 'active' : '';
|
410 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
411 |
+
$return .= '"';
|
412 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
413 |
+
$return .='>' . do_shortcode( $content ) . '</div>';
|
414 |
return $return;
|
415 |
}
|
416 |
|
424 |
extract(shortcode_atts(array(
|
425 |
"type" => false,
|
426 |
"percent" => false,
|
427 |
+
"xclass" => false,
|
428 |
+
"data" => false
|
429 |
), $atts));
|
430 |
+
$data_props = $this->parse_data_attributes($data);
|
431 |
$return = '<div class="progress-bar ';
|
432 |
$return .= ($type) ? ' progress-bar-' . $type : '';
|
433 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
434 |
+
$return .= '"';
|
435 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
436 |
+
$return .= ' role="progressbar" aria-valuenow="'. $percent .'" aria-valuemin="0" aria-valuemax="100" style="width: '. $percent .'%">
|
437 |
<span class="sr-only">'. $percent .'% Complete</span>
|
438 |
</div>';
|
439 |
return $return;
|
450 |
function bs_code($atts, $content = null) {
|
451 |
extract(shortcode_atts(array(
|
452 |
"inline" => false,
|
453 |
+
"scrollable" => false,
|
454 |
+
"xclass" => false,
|
455 |
+
"data" => false
|
456 |
), $atts));
|
457 |
+
$data_props = $this->parse_data_attributes($data);
|
458 |
if($inline) {
|
459 |
+
$return = '<code';
|
460 |
+
$return .= ($xclass) ? ' class="' . $xclass . '"' : '';
|
461 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
462 |
+
$return .= '>' . $content . '</code>';
|
463 |
} else {
|
464 |
$return = '<pre';
|
465 |
+
$classes = ($scrollable) ? 'pre-scrollable': '';
|
466 |
+
$classes .= ($xclass) ? ' ' . $xclass : '';
|
467 |
+
$return .= (!empty($classes)) ? 'class="' . $classes . '"' :'';
|
468 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
469 |
$return .= '>' . $content . '</pre>';
|
470 |
}
|
471 |
return $return;
|
504 |
*
|
505 |
*-------------------------------------------------------------------------------------*/
|
506 |
function bs_row( $atts, $content = null ) {
|
507 |
+
extract(shortcode_atts(array(
|
508 |
+
"xclass" => false,
|
509 |
+
"data" => false
|
510 |
+
), $atts));
|
511 |
+
$data_props = $this->parse_data_attributes($data);
|
512 |
+
$return = '<div class="row';
|
513 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
514 |
+
$return .= '"';
|
515 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
516 |
+
$return .= '>' . do_shortcode( $content ) . '</div>';
|
517 |
return $return;
|
518 |
}
|
519 |
|
546 |
"push_md" => false,
|
547 |
"push_sm" => false,
|
548 |
"push_xs" => false,
|
549 |
+
"xclass" => false,
|
550 |
+
"data" => false
|
551 |
), $atts));
|
552 |
+
$data_props = $this->parse_data_attributes($data);
|
553 |
$return = '<div class="';
|
554 |
$return .= ($lg) ? 'col-lg-' . $lg . ' ' : '';
|
555 |
$return .= ($md) ? 'col-md-' . $md . ' ' : '';
|
567 |
$return .= ($push_md) ? 'col-md-push-' . $push_md . ' ' : '';
|
568 |
$return .= ($push_sm) ? 'col-sm-push-' . $push_sm . ' ' : '';
|
569 |
$return .= ($push_xs) ? 'col-xs-push-' . $push_xs . ' ' : '';
|
570 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
571 |
+
$return .= '"';
|
572 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
573 |
+
$return .= '>' . do_shortcode( $content ) . '</div>';
|
574 |
|
575 |
return $return;
|
576 |
}
|
585 |
function bs_list_group( $atts, $content = null ) {
|
586 |
extract(shortcode_atts(array(
|
587 |
"linked" => false,
|
588 |
+
"xclass" => false,
|
589 |
+
"data" => false
|
590 |
), $atts));
|
591 |
+
$data_props = $this->parse_data_attributes($data);
|
592 |
+
$return = ($linked) ? ' <div class="list-group' : '<ul class="list-group';
|
593 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
594 |
+
$return .= '"';
|
595 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
596 |
+
$return .= '>';
|
597 |
$return .= do_shortcode( $content );
|
598 |
$return .= ($linked) ? ' </div>' : '</ul>';
|
599 |
return $return;
|
610 |
function bs_list_group_item( $atts, $content = null ) {
|
611 |
extract(shortcode_atts(array(
|
612 |
"link" => false,
|
613 |
+
"active" => false,
|
614 |
+
"xclass" => false,
|
615 |
+
"data" => false
|
616 |
), $atts));
|
617 |
+
$data_props = $this->parse_data_attributes($data);
|
618 |
$return = ($link) ? '<a href="' . $link . '" ' : '<li ';
|
619 |
$return .= 'class="list-group-item ';
|
620 |
$return .= ($active) ? 'active' : '';
|
621 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
622 |
+
$return .= '"';
|
623 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
624 |
+
$return .= '>' . do_shortcode( $content );
|
625 |
$return .= ($link) ? '</a>' : '</li>';
|
626 |
return $return;
|
627 |
}
|
633 |
*
|
634 |
*-------------------------------------------------------------------------------------*/
|
635 |
function bs_list_group_item_heading( $atts, $content = null ) {
|
636 |
+
extract(shortcode_atts(array(
|
637 |
+
"xclass" => false,
|
638 |
+
"data" => false
|
639 |
+
), $atts));
|
640 |
+
$data_props = $this->parse_data_attributes($data);
|
641 |
+
$return = '<h4 class="list-group-item-heading';
|
642 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
643 |
+
$return .= '"';
|
644 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
645 |
+
$return .= '>' . do_shortcode( $content ) . '</h4>';
|
646 |
return $return;
|
647 |
}
|
648 |
|
653 |
*
|
654 |
*-------------------------------------------------------------------------------------*/
|
655 |
function bs_list_group_item_text( $atts, $content = null ) {
|
656 |
+
extract(shortcode_atts(array(
|
657 |
+
"xclass" => false,
|
658 |
+
"data" => false
|
659 |
+
), $atts));
|
660 |
+
$data_props = $this->parse_data_attributes($data);
|
661 |
+
$return = '<p class="list-group-item-text';
|
662 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
663 |
+
$return .= '"';
|
664 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
665 |
+
$return .= '>' . do_shortcode( $content ) . '</p>';
|
666 |
return $return;
|
667 |
}
|
668 |
|
674 |
*
|
675 |
*-------------------------------------------------------------------------------------*/
|
676 |
function bs_breadcrumb( $atts, $content = null ) {
|
677 |
+
extract(shortcode_atts(array(
|
678 |
+
"xclass" => false,
|
679 |
+
"data" => false
|
680 |
+
), $atts));
|
681 |
+
$data_props = $this->parse_data_attributes($data);
|
682 |
+
$return = '<ol class="breadcrumb';
|
683 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
684 |
+
$return .= '"';
|
685 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
686 |
+
$return .= '>' . do_shortcode( $content ).'</ol>';
|
687 |
return $return;
|
688 |
}
|
689 |
|
697 |
function bs_breadcrumb_item( $atts, $content = null ) {
|
698 |
extract(shortcode_atts(array(
|
699 |
"link" => false,
|
700 |
+
"xclass" => false,
|
701 |
+
"data" => false
|
702 |
), $atts));
|
703 |
+
$data_props = $this->parse_data_attributes($data);
|
704 |
+
$return = '<li><a href="' . $link . '"';
|
705 |
+
$return .= ($xclass) ? 'class="' . $xclass .'"': '';
|
706 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
707 |
+
$return .= '>' . do_shortcode( $content ).'</a></li>';
|
708 |
return $return;
|
709 |
}
|
710 |
|
718 |
*-------------------------------------------------------------------------------------*/
|
719 |
function bs_label( $atts, $content = null ) {
|
720 |
extract(shortcode_atts(array(
|
721 |
+
"type" => 'default',
|
722 |
+
"xclass" => false,
|
723 |
+
"data" => false
|
724 |
), $atts));
|
725 |
+
$data_props = $this->parse_data_attributes($data);
|
726 |
+
$return = '<span class="label label-' . $type;
|
727 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
728 |
+
$return .= '"';
|
729 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
730 |
+
$return .= '>' .do_shortcode( $content ) . '</span>';
|
731 |
return $return;
|
732 |
}
|
733 |
|
744 |
*-------------------------------------------------------------------------------------*/
|
745 |
function bs_badge( $atts, $content = null ) {
|
746 |
extract(shortcode_atts(array(
|
747 |
+
"right" => false,
|
748 |
+
"xclass" => false,
|
749 |
+
"data" => false
|
750 |
), $atts));
|
751 |
+
$data_props = $this->parse_data_attributes($data);
|
752 |
$right = ($right) ? " pull-right" : "";
|
753 |
+
$return = '<span class="badge' . $right;
|
754 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
755 |
+
$return .= '"';
|
756 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
757 |
+
$return .= '>' .do_shortcode( $content ) . '</span>';
|
758 |
return $return;
|
759 |
}
|
760 |
|
772 |
function bs_icon( $atts, $content = null ) {
|
773 |
extract(shortcode_atts(array(
|
774 |
"type" => 'type',
|
775 |
+
"xclass" => false,
|
776 |
+
"data" => false
|
777 |
), $atts));
|
778 |
+
$data_props = $this->parse_data_attributes($data);
|
779 |
+
$return = '<span class="glyphicon glyphicon-' . $type;
|
780 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
781 |
+
$return .= '"';
|
782 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
783 |
+
$return .= '></span>';
|
784 |
return $return;
|
785 |
}
|
786 |
|
841 |
'striped' => false,
|
842 |
'hover' => false,
|
843 |
'condensed' => false,
|
844 |
+
'xclass' => false,
|
845 |
+
'data' => false
|
846 |
+
), $atts));
|
847 |
$classes = 'table';
|
848 |
$classes .= ($bordered) ? ' table-bordered' : '';
|
849 |
$classes .= ($striped) ? ' table-striped' : '';
|
850 |
$classes .= ($hover) ? ' table-hover' : '';
|
851 |
+
$classes .= ($condensed) ? ' table-condensed' : '';
|
852 |
+
$classes .= ($xclass) ? ' ' . $xclass : '';
|
853 |
$dom = new DOMDocument;
|
854 |
$dom->loadXML($content);
|
855 |
$dom->documentElement->setAttribute('class', $dom->documentElement->getAttribute('class') . ' ' . $classes);
|
856 |
+
if($data) {
|
857 |
+
$data = explode('|',$data);
|
858 |
+
foreach($data as $d):
|
859 |
+
$d = explode(',',$d);
|
860 |
+
$dom->documentElement->setAttribute('data-'.$d[0],trim($d[1]));
|
861 |
+
endforeach;
|
862 |
+
}
|
863 |
$return = $dom->saveXML();
|
864 |
return $return;
|
865 |
}
|
878 |
*-------------------------------------------------------------------------------------*/
|
879 |
function bs_well( $atts, $content = null ) {
|
880 |
extract(shortcode_atts(array(
|
881 |
+
"size" => false,
|
882 |
+
"xclass" => false,
|
883 |
+
"data" => false
|
884 |
+
), $atts));
|
885 |
+
$data_props = $this->parse_data_attributes($data);
|
886 |
|
887 |
if($size) {
|
888 |
$size = ' well-'.$size;
|
889 |
}
|
890 |
|
891 |
+
$return = '<div class="well' . $size;
|
892 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
893 |
+
$return .= '"';
|
894 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
895 |
+
$return .= '>' . do_shortcode( $content ) . '</div>';
|
896 |
return $return;
|
897 |
}
|
898 |
|
908 |
extract(shortcode_atts(array(
|
909 |
"title" => '',
|
910 |
"type" => 'default',
|
911 |
+
"footer" => false,
|
912 |
+
"xclass" => false,
|
913 |
+
"data" => false
|
914 |
+
), $atts));
|
915 |
+
$data_props = $this->parse_data_attributes($data);
|
916 |
if($footer) {
|
917 |
$footer = '<div class="panel-footer">' . $footer . '</div>';
|
918 |
}
|
919 |
+
$return = '<div class="panel panel-' . $type;
|
920 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
921 |
+
$return .= '"';
|
922 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
923 |
+
$return .= '><div class="panel-heading"><h3 class="panel-title">' . $title . '</h3></div><div class="panel-body">' . do_shortcode( $content ) . '</div>' . $footer . '</div>';
|
924 |
return $return;
|
925 |
}
|
926 |
|
940 |
else
|
941 |
$GLOBALS['tabs_count'] = 0;
|
942 |
|
943 |
+
$defaults = array(
|
944 |
+
'xclass' => false,
|
945 |
+
'data' => false
|
946 |
+
);
|
947 |
extract( shortcode_atts( $defaults, $atts ) );
|
948 |
+
$data_props = $this->parse_data_attributes($data);
|
949 |
|
950 |
// Extract the tab titles for use in the tab widget.
|
951 |
preg_match_all( '/tab title="([^\"]+)"/i', $content, $matches, PREG_OFFSET_CAPTURE );
|
956 |
$return = '';
|
957 |
|
958 |
if( count($tab_titles) ){
|
959 |
+
$return .= '<ul class="nav nav-tabs';
|
960 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
961 |
+
$return .= '"';
|
962 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
963 |
+
$return .= ' id="custom-tabs-'. rand(1, 100) .'">';
|
964 |
|
965 |
$i = 0;
|
966 |
foreach( $tab_titles as $tab ){
|
1010 |
}
|
1011 |
}
|
1012 |
|
1013 |
+
$defaults = array(
|
1014 |
+
'title' => 'Tab',
|
1015 |
+
'xclass' => false,
|
1016 |
+
'data' => false
|
1017 |
+
);
|
1018 |
extract( shortcode_atts( $defaults, $atts ) );
|
1019 |
+
$data_props = $this->parse_data_attributes($data);
|
1020 |
|
1021 |
+
$return = '<div id="custom-tab-' . $GLOBALS['tabs_count'] . '-'. sanitize_title( $title ) .'" class="tab-pane ' . $state;
|
1022 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
1023 |
+
$return .= '"';
|
1024 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
1025 |
+
$return .= '>'. do_shortcode( $content ) .'</div>';
|
1026 |
return $return;
|
1027 |
}
|
1028 |
|
1044 |
else
|
1045 |
$GLOBALS['collapsibles_count'] = 0;
|
1046 |
|
1047 |
+
$defaults = array(
|
1048 |
+
'xclass' => false,
|
1049 |
+
'data' => false
|
1050 |
+
);
|
1051 |
extract( shortcode_atts( $defaults, $atts ) );
|
1052 |
+
$data_props = $this->parse_data_attributes($data);
|
1053 |
|
1054 |
// Extract the tab titles for use in the tab widget.
|
1055 |
preg_match_all( '/collapse title="([^\"]+)"/i', $content, $matches, PREG_OFFSET_CAPTURE );
|
1060 |
$return = '';
|
1061 |
|
1062 |
if( count($tab_titles) ){
|
1063 |
+
$return .= '<div class="panel-group';
|
1064 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
1065 |
+
$return .= '"';
|
1066 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
1067 |
+
$return .= ' id="accordion-' . $GLOBALS['collapsibles_count'] . '">';
|
1068 |
$return .= do_shortcode( $content );
|
1069 |
$return .= '</div>';
|
1070 |
} else {
|
1075 |
}
|
1076 |
|
1077 |
|
|
|
|
|
1078 |
/*--------------------------------------------------------------------------------------
|
1079 |
*
|
1080 |
* bs_collapse
|
1093 |
extract(shortcode_atts(array(
|
1094 |
"title" => '',
|
1095 |
"type" => 'default',
|
1096 |
+
"active" => false,
|
1097 |
+
"xclass" => false,
|
1098 |
+
"data" => false
|
1099 |
), $atts));
|
1100 |
+
$data_props = $this->parse_data_attributes($data);
|
1101 |
|
1102 |
if ($active)
|
1103 |
$active = 'in';
|
1104 |
|
1105 |
+
$return = '<div class="panel panel-' . $type;
|
1106 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
1107 |
+
$return .= '"';
|
1108 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
1109 |
+
$return .= '><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>';
|
1110 |
+
return $return;
|
1111 |
+
}
|
1112 |
+
|
1113 |
+
|
1114 |
+
/*--------------------------------------------------------------------------------------
|
1115 |
+
*
|
1116 |
+
* bs_carousel
|
1117 |
+
*
|
1118 |
+
* @author Filip Stefansson
|
1119 |
+
* @since 1.0
|
1120 |
+
*
|
1121 |
+
*-------------------------------------------------------------------------------------*/
|
1122 |
+
function bs_carousel( $atts, $content = null ) {
|
1123 |
+
extract(shortcode_atts(array(
|
1124 |
+
"interval" => "5000",
|
1125 |
+
"pause" => false,
|
1126 |
+
"wrap" => false,
|
1127 |
+
"xclass" => false,
|
1128 |
+
"data" => false,
|
1129 |
+
), $atts));
|
1130 |
+
|
1131 |
+
if( isset($GLOBALS['carousel_count']) )
|
1132 |
+
$GLOBALS['carousel_count']++;
|
1133 |
+
else
|
1134 |
+
$GLOBALS['carousel_count'] = 0;
|
1135 |
+
|
1136 |
+
$GLOBALS['carousel_active'] = true;
|
1137 |
+
|
1138 |
+
$data_props = $this->parse_data_attributes($data);
|
1139 |
+
|
1140 |
+
$i = 0;
|
1141 |
+
$indicator_count = substr_count($content,'<img');
|
1142 |
+
while($i < $indicator_count) {
|
1143 |
+
$indicators .= '<li data-target="#carousel-' . $GLOBALS['carousel_count'] . '" data-slide-to="' . $i . '"';
|
1144 |
+
$indicators .= ($i == 0) ? 'class="active"' : '';
|
1145 |
+
$indicators .= '></li>';
|
1146 |
+
$i++;
|
1147 |
+
}
|
1148 |
+
$indicators_return = '<!-- Indicators -->';
|
1149 |
+
$indicators_return .= '<ol class="carousel-indicators">';
|
1150 |
+
$indicators_return .= $indicators;
|
1151 |
+
$indicators_return .= '</ol>';
|
1152 |
+
|
1153 |
+
$return = '';
|
1154 |
+
$return .= '<div id="carousel-' . $GLOBALS['carousel_count'] . '" class="carousel slide';
|
1155 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
1156 |
+
$return .= '"';
|
1157 |
+
$return .= ' data-ride="carousel"';
|
1158 |
+
$return .= ($interval) ? ' data-interval="' . $interval . '"' : '';
|
1159 |
+
$return .= ($pause) ? ' data-pause="' . $pause . '"' : '';
|
1160 |
+
$return .= ($wrap) ? ' data-wrap="' . $wrap . '"' : '';
|
1161 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
1162 |
+
$return .= '>';
|
1163 |
+
$return .= $indicators_return;
|
1164 |
+
$return .= '<div class="carousel-inner">' . do_shortcode( $content ) . '</div>';
|
1165 |
+
$return .= '<!-- Controls -->';
|
1166 |
+
$return .= '<a class="left carousel-control" href="#carousel-' . $GLOBALS['carousel_count'] . '" data-slide="prev">';
|
1167 |
+
$return .= '<span class="glyphicon glyphicon-chevron-left"></span>';
|
1168 |
+
$return .= '</a>';
|
1169 |
+
$return .= '<a class="right carousel-control" href="#carousel-' . $GLOBALS['carousel_count'] . '" data-slide="next">';
|
1170 |
+
$return .= '<span class="glyphicon glyphicon-chevron-right"></span>';
|
1171 |
+
$return .= '</a>';
|
1172 |
+
$return .= '</div>';
|
1173 |
+
|
1174 |
+
return $return;
|
1175 |
+
}
|
1176 |
+
|
1177 |
+
|
1178 |
+
/*--------------------------------------------------------------------------------------
|
1179 |
+
*
|
1180 |
+
* bs_carousel_item
|
1181 |
+
*
|
1182 |
+
* @author Filip Stefansson
|
1183 |
+
* @since 1.0
|
1184 |
+
*
|
1185 |
+
*-------------------------------------------------------------------------------------*/
|
1186 |
+
function bs_carousel_item( $atts, $content = null ) {
|
1187 |
+
extract(shortcode_atts(array(
|
1188 |
+
"caption" => false,
|
1189 |
+
"xclass" => false,
|
1190 |
+
"data" => false
|
1191 |
+
), $atts));
|
1192 |
+
$content=preg_replace('/class=".*?"/', '', $content);
|
1193 |
+
$data_props = $this->parse_data_attributes($data);
|
1194 |
+
$return = '<div class="item';
|
1195 |
+
$return .= ($GLOBALS['carousel_active']) ? ' active' : '';
|
1196 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
1197 |
+
$return .= '"';
|
1198 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
1199 |
+
$return .= '>' . do_shortcode($content);
|
1200 |
+
$return .= ($caption) ? '<div class="carousel-caption">' . $caption . '</div>' : '';
|
1201 |
+
$return .='</div>';
|
1202 |
+
$GLOBALS['carousel_active'] = false;
|
1203 |
return $return;
|
1204 |
}
|
1205 |
|
1206 |
|
1207 |
+
|
1208 |
/*--------------------------------------------------------------------------------------
|
1209 |
*
|
1210 |
* bs_tooltip
|
1293 |
function bs_media( $atts, $content = null ) {
|
1294 |
|
1295 |
$defaults = array(
|
1296 |
+
'xclass' => false,
|
1297 |
+
'data' =>false
|
1298 |
);
|
1299 |
extract( shortcode_atts( $defaults, $atts ) );
|
1300 |
+
$data_props = $this->parse_data_attributes($data);
|
1301 |
+
|
1302 |
+
$return = '<div class="media';
|
1303 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
1304 |
+
$return .= '"';
|
1305 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
1306 |
+
$return .= '>' . do_shortcode( $content ) . '</div>';
|
1307 |
return $return;
|
1308 |
}
|
1309 |
|
1311 |
|
1312 |
$defaults = array(
|
1313 |
'pull' => "left",
|
1314 |
+
'xclass' => false,
|
1315 |
+
'data' =>false
|
1316 |
);
|
1317 |
extract( shortcode_atts( $defaults, $atts ) );
|
1318 |
|
1319 |
$classes = "media-object";
|
1320 |
+
$classes .= ($xclass) ? ' ' . $xclass : '';
|
1321 |
+
|
1322 |
$dom = new DOMDocument;
|
1323 |
$dom->loadXML($content);
|
1324 |
$dom->documentElement->setAttribute('class', $dom->documentElement->getAttribute('class') . ' ' . $classes);
|
1325 |
+
if($data) {
|
1326 |
+
$data = explode('|',$data);
|
1327 |
+
foreach($data as $d):
|
1328 |
+
$d = explode(',',$d);
|
1329 |
+
$dom->documentElement->setAttribute('data-'.$d[0],trim($d[1]));
|
1330 |
+
endforeach;
|
1331 |
+
}
|
1332 |
$return = $dom->saveXML();
|
1333 |
$return = '<span class="pull-'. $pull . '">' . $return . '</span>';
|
1334 |
return $return;
|
1338 |
|
1339 |
$defaults = array(
|
1340 |
'title' => false,
|
1341 |
+
'xclass' => false,
|
1342 |
+
'data' =>false
|
1343 |
);
|
1344 |
extract( shortcode_atts( $defaults, $atts ) );
|
1345 |
+
$data_props = $this->parse_data_attributes($data);
|
1346 |
+
$return .= '<div class="media-body';
|
1347 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
1348 |
+
$return .= '"';
|
1349 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
1350 |
+
$return .= '>';
|
1351 |
$return .= ($title) ? '<h4 class="media-heading">' . $title . '</h4>' : '';
|
1352 |
$return .= $content . '</div>';
|
1353 |
return $return;
|
1361 |
*-------------------------------------------------------------------------------------*/
|
1362 |
function bs_jumbotron( $atts, $content = null ) {
|
1363 |
extract(shortcode_atts(array(
|
1364 |
+
"title" => false,
|
1365 |
+
"xclass" => false,
|
1366 |
+
"data" => false
|
1367 |
), $atts));
|
1368 |
+
$data_props = $this->parse_data_attributes($data);
|
1369 |
+
$return .='<div class="jumbotron';
|
1370 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
1371 |
+
$return .= '"';
|
1372 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
1373 |
+
$return .= '>';
|
1374 |
$return .= ($title) ? '<h1>' . $title . '</h1>' : '';
|
1375 |
$return .= do_shortcode( $content ) . '</div>';
|
1376 |
return $return;
|
1383 |
*
|
1384 |
*-------------------------------------------------------------------------------------*/
|
1385 |
function bs_page_header( $atts, $content = null ) {
|
1386 |
+
extract(shortcode_atts(array(
|
1387 |
+
"xclass" => false,
|
1388 |
+
"data" => false
|
1389 |
+
), $atts));
|
1390 |
+
$data_props = $this->parse_data_attributes($data);
|
1391 |
$classes = "page-header";
|
1392 |
+
$classes .= ($xclass) ? ' ' . $xclass : '';
|
1393 |
+
|
1394 |
$dom = new DOMDocument;
|
1395 |
$dom->loadXML($content);
|
1396 |
$hasHeader = $dom->getElementsByTagName('h1');
|
1410 |
$dom->appendChild($new_root);
|
1411 |
}
|
1412 |
$dom->documentElement->setAttribute('class', $dom->documentElement->getAttribute('class') . ' ' . $classes);
|
1413 |
+
if($data) {
|
1414 |
+
$data = explode('|',$data);
|
1415 |
+
foreach($data as $d):
|
1416 |
+
$d = explode(',',$d);
|
1417 |
+
$dom->documentElement->setAttribute('data-'.$d[0],trim($d[1]));
|
1418 |
+
endforeach;
|
1419 |
+
}
|
1420 |
$return = $dom->saveXML();
|
1421 |
|
1422 |
return $return;
|
1430 |
*
|
1431 |
*-------------------------------------------------------------------------------------*/
|
1432 |
function bs_lead( $atts, $content = null ) {
|
1433 |
+
extract(shortcode_atts(array(
|
1434 |
+
"xclass" => false,
|
1435 |
+
"data" => false
|
1436 |
+
), $atts));
|
1437 |
+
$data_props = $this->parse_data_attributes($data);
|
1438 |
+
$return = '<p class="lead';
|
1439 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
1440 |
+
$return .= '"';
|
1441 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
1442 |
+
$return .= '>' . do_shortcode( $content ) . '</p>';
|
1443 |
return $return;
|
1444 |
}
|
1445 |
|
1451 |
*-------------------------------------------------------------------------------------*/
|
1452 |
function bs_emphasis( $atts, $content = null ) {
|
1453 |
extract(shortcode_atts(array(
|
1454 |
+
"type" => 'muted',
|
1455 |
+
"xclass" => false,
|
1456 |
+
"data" => false
|
1457 |
), $atts));
|
1458 |
+
$data_props = $this->parse_data_attributes($data);
|
1459 |
+
$return = '<span class="text-' . $type;
|
1460 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
1461 |
+
$return .= '"';
|
1462 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
1463 |
+
$return .= '>' . do_shortcode( $content ) . '</span>';
|
1464 |
return $return;
|
1465 |
}
|
1466 |
/*--------------------------------------------------------------------------------------
|
1473 |
extract(shortcode_atts(array(
|
1474 |
"type" => false,
|
1475 |
"responsive" => false,
|
1476 |
+
"xclass" => false,
|
1477 |
+
"data" => false
|
1478 |
), $atts));
|
1479 |
$classes .= ($type) ? 'img-' . $type . ' ' : '';
|
1480 |
+
$classes .= ($responsive) ? ' img-responsive' : '';
|
1481 |
+
$classes .= ($xclass) ? ' ' . $xclass : '';
|
1482 |
$dom = new DOMDocument;
|
1483 |
$dom->loadXML($content);
|
1484 |
foreach($dom->getElementsByTagName('img') as $image) {
|
1485 |
$image->setAttribute('class', $image->getAttribute('class') . ' ' . $classes);
|
1486 |
+
if($data) {
|
1487 |
+
$data = explode('|',$data);
|
1488 |
+
foreach($data as $d):
|
1489 |
+
$d = explode(',',$d);
|
1490 |
+
$image->setAttribute('data-'.$d[0],trim($d[1]));
|
1491 |
+
endforeach;
|
1492 |
+
}
|
1493 |
}
|
1494 |
$return = $dom->saveXML();
|
1495 |
|
1504 |
*
|
1505 |
*-------------------------------------------------------------------------------------*/
|
1506 |
function bs_thumbnail( $atts, $content = null ) {
|
1507 |
+
extract(shortcode_atts(array(
|
1508 |
+
"xclass" => false,
|
1509 |
+
"data" => false
|
1510 |
+
), $atts));
|
1511 |
$classes = "thumbnail";
|
1512 |
+
$classes .= ($xclass) ? ' ' . $xclass : '';
|
1513 |
$dom = new DOMDocument;
|
1514 |
$dom->loadXML($content);
|
1515 |
if(!$dom->documentElement) {
|
1517 |
$dom->appendChild($element);
|
1518 |
}
|
1519 |
$dom->documentElement->setAttribute('class', $dom->documentElement->getAttribute('class') . ' ' . $classes);
|
1520 |
+
if($data) {
|
1521 |
+
$data = explode('|',$data);
|
1522 |
+
foreach($data as $d):
|
1523 |
+
$d = explode(',',$d);
|
1524 |
+
$dom->documentElement->setAttribute('data-'.$d[0],trim($d[1]));
|
1525 |
+
endforeach;
|
1526 |
+
}
|
1527 |
$return = $dom->saveXML();
|
1528 |
|
1529 |
return $return;
|
1540 |
extract( shortcode_atts( array(
|
1541 |
'visible' => '',
|
1542 |
'hidden' => '',
|
1543 |
+
"xclass" => false,
|
1544 |
+
"data" => false
|
1545 |
+
), $atts));
|
1546 |
+
$data_props = $this->parse_data_attributes($data);
|
1547 |
+
$classes='';
|
1548 |
if($visible) {
|
1549 |
$visible = explode(' ',$visible);
|
1550 |
foreach($visible as $v):
|
1557 |
$classes .= 'hidden-'.$h.' ';
|
1558 |
endforeach;
|
1559 |
}
|
1560 |
+
$classes .= ($xclass) ? ' ' . $xclass : '';
|
1561 |
+
$return = '<span class="' . $classes . '"';
|
1562 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
1563 |
+
$return .= '>' . do_shortcode($content) . '</span>';
|
1564 |
+
return $return;
|
|
|
|
|
|
|
|
|
|
|
|
|
1565 |
|
1566 |
}
|
1567 |
|
1577 |
extract(shortcode_atts(array(
|
1578 |
"text" => '',
|
1579 |
"title" => '',
|
1580 |
+
"xclass" => false,
|
1581 |
+
"data"=>false
|
1582 |
), $atts));
|
1583 |
+
$data_props = $this->parse_data_attributes($data);
|
1584 |
$sani_title = 'modal'. sanitize_title( $title );
|
1585 |
+
$return .='<a data-toggle="modal" href="#'. $sani_title .'"';
|
1586 |
+
$return .= ($xclass) ? ' class="' . $xclass .'"' : '';
|
1587 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
1588 |
+
$return .= '>'. $text .'</a>';
|
1589 |
$return .='<div class="modal fade" id="'. $sani_title .'" tabindex="-1" role="dialog" aria-hidden="true">';
|
1590 |
$return .='<div class="modal-dialog">';
|
1591 |
$return .='<div class="modal-content">';
|
1612 |
*
|
1613 |
*-------------------------------------------------------------------------------------*/
|
1614 |
function bs_modal_footer( $atts, $content = null ) {
|
1615 |
+
extract(shortcode_atts(array(
|
1616 |
+
"xclass" => false,
|
1617 |
+
"data"=>false
|
1618 |
+
), $atts));
|
1619 |
+
$data_props = $this->parse_data_attributes($data);
|
1620 |
+
$return = '<div class="modal-footer';
|
1621 |
+
$return .= ($xclass) ? ' ' . $xclass : '';
|
1622 |
+
$return .= '"';
|
1623 |
+
$return .= ($data_props) ? ' ' . $data_props : '';
|
1624 |
+
$return .= '>' . do_shortcode( $content ) . '</div>';
|
1625 |
return $return;
|
1626 |
}
|
1627 |
+
|
1628 |
+
function parse_data_attributes($data){
|
1629 |
+
if($data) {
|
1630 |
+
$data = explode('|',$data);
|
1631 |
+
foreach($data as $d):
|
1632 |
+
$d = explode(',',$d);
|
1633 |
+
$data_props .= 'data-'.$d[0]. '="'.trim($d[1]).'" ';
|
1634 |
+
endforeach;
|
1635 |
+
} else { $data_props = false; }
|
1636 |
+
return $data_props;
|
1637 |
+
}
|
1638 |
|
1639 |
}
|
1640 |
|
includes/actions-filters.php
CHANGED
@@ -1,19 +1,14 @@
|
|
1 |
<?php
|
2 |
function bootstrap_shortcodes_help_styles() {
|
3 |
-
|
4 |
-
|
5 |
}
|
6 |
add_action( 'admin_enqueue_scripts', 'bootstrap_shortcodes_help_styles' );
|
7 |
|
8 |
add_filter('the_content', 'bs_fix_shortcodes');
|
9 |
|
10 |
-
// Create a Media Button for the help file
|
11 |
-
//add a button to the content editor, next to the media button
|
12 |
-
//this button will show a popup that contains inline content
|
13 |
-
add_action('media_buttons_context', 'add_bootstrap_button');
|
14 |
-
|
15 |
//action to add a custom button to the content editor
|
16 |
-
function add_bootstrap_button(
|
17 |
|
18 |
//path to my icon
|
19 |
$img = BS_SHORTCODES_URL . 'images/Twitter_Boostrap_logo.svg';
|
@@ -24,12 +19,17 @@ 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}
|
29 |
<img src='{$img}' style='height: 20px; position: relative; top: -2px;'></a>";
|
30 |
|
31 |
-
|
32 |
}
|
|
|
|
|
|
|
|
|
33 |
|
34 |
function boostrap_shortcodes_help() {
|
35 |
include('bootstrap-shortcodes-help.php');
|
@@ -37,4 +37,4 @@ function boostrap_shortcodes_help() {
|
|
37 |
add_action( 'admin_footer', 'boostrap_shortcodes_help' );
|
38 |
|
39 |
|
40 |
-
?>
|
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 |
|
|
|
|
|
|
|
|
|
|
|
10 |
//action to add a custom button to the content editor
|
11 |
+
function add_bootstrap_button() {
|
12 |
|
13 |
//path to my icon
|
14 |
$img = BS_SHORTCODES_URL . 'images/Twitter_Boostrap_logo.svg';
|
19 |
//our popup's title
|
20 |
$title = 'Bootstrap Shortcodes Help';
|
21 |
|
22 |
+
//append the icon
|
23 |
$context .= "<a title='{$title}'
|
24 |
+
href='#TB_inline?width=640&height=650&inlineId={$popup_url}' class='thickbox button add_media' style='padding-left: 0px; padding-right: 0px;' title='Bootstrap Shortcodes Help'>
|
25 |
<img src='{$img}' style='height: 20px; position: relative; top: -2px;'></a>";
|
26 |
|
27 |
+
echo $context;
|
28 |
}
|
29 |
+
// Create a Media Button for the help file
|
30 |
+
//add a button to the content editor, next to the media button
|
31 |
+
//this button will show a popup that contains inline content
|
32 |
+
add_action('media_buttons', 'add_bootstrap_button', 11);
|
33 |
|
34 |
function boostrap_shortcodes_help() {
|
35 |
include('bootstrap-shortcodes-help.php');
|
37 |
add_action( 'admin_footer', 'boostrap_shortcodes_help' );
|
38 |
|
39 |
|
40 |
+
?>
|
includes/bootstrap-shortcodes-help.php
CHANGED
@@ -9,11 +9,13 @@ function retitle($match) {
|
|
9 |
return "<$h3 id='$id'>$title</$h3>";
|
10 |
}
|
11 |
|
12 |
-
|
13 |
# Install PSR-0-compatible class autoloader
|
14 |
-
spl_autoload_register(function($class){
|
15 |
-
require 'php_markdown/' . preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php';
|
16 |
-
});
|
|
|
|
|
17 |
|
18 |
# Get Markdown class
|
19 |
//use \Michelf\Markdown;
|
9 |
return "<$h3 id='$id'>$title</$h3>";
|
10 |
}
|
11 |
|
12 |
+
//$thisfile = realpath(dirname(__FILE__));
|
13 |
# Install PSR-0-compatible class autoloader
|
14 |
+
//spl_autoload_register(function($class){
|
15 |
+
// require 'php_markdown/' . preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php';
|
16 |
+
//});
|
17 |
+
|
18 |
+
require_once 'php_markdown/Michelf/MarkdownExtra.inc.php';
|
19 |
|
20 |
# Get Markdown class
|
21 |
//use \Michelf\Markdown;
|
includes/php_markdown/Michelf/Markdown.inc.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
# Use this file if you cannot use class autoloading. It will include all the
|
4 |
+
# files needed for the Markdown parser.
|
5 |
+
#
|
6 |
+
# Take a look at the PSR-0-compatible class autoloading implementation
|
7 |
+
# in the Readme.php file if you want a simple autoloader setup.
|
8 |
+
|
9 |
+
require_once dirname(__FILE__) . '/MarkdownInterface.php';
|
10 |
+
require_once dirname(__FILE__) . '/Markdown.php';
|
includes/php_markdown/Michelf/Markdown.php
CHANGED
@@ -17,11 +17,11 @@ namespace Michelf;
|
|
17 |
# Markdown Parser Class
|
18 |
#
|
19 |
|
20 |
-
class Markdown {
|
21 |
|
22 |
### Version ###
|
23 |
|
24 |
-
const MARKDOWNLIB_VERSION = "1.
|
25 |
|
26 |
### Simple Function Interface ###
|
27 |
|
@@ -1269,7 +1269,7 @@ class Markdown {
|
|
1269 |
# Ampersand-encoding based entirely on Nat Irons's Amputator
|
1270 |
# MT plugin: <http://bumppo.net/projects/amputator/>
|
1271 |
$text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/',
|
1272 |
-
'&', $text)
|
1273 |
}
|
1274 |
# Encode remaining <'s
|
1275 |
$text = str_replace('<', '<', $text);
|
@@ -1302,9 +1302,16 @@ class Markdown {
|
|
1302 |
>
|
1303 |
}xi',
|
1304 |
array(&$this, '_doAutoLinks_email_callback'), $text);
|
|
|
1305 |
|
1306 |
return $text;
|
1307 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1308 |
protected function _doAutoLinks_url_callback($matches) {
|
1309 |
$url = $this->encodeAttribute($matches[1]);
|
1310 |
$link = "<a href=\"$url\">$url</a>";
|
@@ -1524,7 +1531,7 @@ class Markdown {
|
|
1524 |
# one.
|
1525 |
#
|
1526 |
|
1527 |
-
class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
1528 |
|
1529 |
### Configuration Variables ###
|
1530 |
|
@@ -1832,9 +1839,6 @@ class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
|
1832 |
<\?.*?\?> | <%.*?%> # Processing instruction
|
1833 |
|
|
1834 |
<!\[CDATA\[.*?\]\]> # CData Block
|
1835 |
-
|
|
1836 |
-
# Code span marker
|
1837 |
-
`+
|
1838 |
'. ( !$span ? ' # If not in span.
|
1839 |
|
|
1840 |
# Indented code block
|
@@ -1846,7 +1850,7 @@ class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
|
1846 |
|
|
1847 |
# Fenced code block marker
|
1848 |
(?<= ^ | \n )
|
1849 |
-
[ ]{0,'.($indent+3).'}
|
1850 |
[ ]*
|
1851 |
(?:
|
1852 |
\.?[-_:a-zA-Z0-9]+ # standalone class name
|
@@ -1854,8 +1858,14 @@ class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
|
1854 |
'.$this->id_class_attr_nocatch_re.' # extra attributes
|
1855 |
)?
|
1856 |
[ ]*
|
1857 |
-
\n
|
1858 |
' : '' ). ' # End (if not is span).
|
|
|
|
|
|
|
|
|
|
|
|
|
1859 |
)
|
1860 |
}xs';
|
1861 |
|
@@ -1897,28 +1907,12 @@ class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
|
1897 |
$text = $parts[2]; # Remaining text after current tag.
|
1898 |
$tag_re = preg_quote($tag); # For use in a regular expression.
|
1899 |
|
1900 |
-
#
|
1901 |
-
# Check for: Code span marker
|
1902 |
-
#
|
1903 |
-
if ($tag{0} == "`") {
|
1904 |
-
# Find corresponding end marker.
|
1905 |
-
$tag_re = preg_quote($tag);
|
1906 |
-
if (preg_match('{^(?>.+?|\n(?!\n))*?(?<!`)'.$tag_re.'(?!`)}',
|
1907 |
-
$text, $matches))
|
1908 |
-
{
|
1909 |
-
# End marker found: pass text unchanged until marker.
|
1910 |
-
$parsed .= $tag . $matches[0];
|
1911 |
-
$text = substr($text, strlen($matches[0]));
|
1912 |
-
}
|
1913 |
-
else {
|
1914 |
-
# Unmatched marker: just skip it.
|
1915 |
-
$parsed .= $tag;
|
1916 |
-
}
|
1917 |
-
}
|
1918 |
#
|
1919 |
# Check for: Fenced code block marker.
|
|
|
|
|
1920 |
#
|
1921 |
-
|
1922 |
# Fenced code block marker: find matching end marker.
|
1923 |
$fence_indent = strlen($capture[1]); # use captured indent in re
|
1924 |
$fence_re = $capture[2]; # use captured fence in re
|
@@ -1943,6 +1937,25 @@ class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
|
1943 |
$parsed .= $tag;
|
1944 |
}
|
1945 |
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1946 |
# Check for: Opening Block level tag or
|
1947 |
# Opening Context Block tag (like ins and del)
|
1948 |
# used as a block tag (tag is alone on it's line).
|
@@ -2767,7 +2780,7 @@ class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
|
2767 |
(?:\n|\A)
|
2768 |
# 1: Opening marker
|
2769 |
(
|
2770 |
-
|
2771 |
)
|
2772 |
[ ]*
|
2773 |
(?:
|
@@ -2786,7 +2799,7 @@ class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
|
2786 |
)
|
2787 |
|
2788 |
# Closing marker.
|
2789 |
-
\1 [ ]* \n
|
2790 |
}xm',
|
2791 |
array(&$this, '_doFencedCodeBlocks_callback'), $text);
|
2792 |
|
@@ -2936,8 +2949,8 @@ class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
|
2936 |
$text .= "<div class=\"footnotes\">\n";
|
2937 |
$text .= "<hr". $this->empty_element_suffix ."\n";
|
2938 |
$text .= "<ol>\n\n";
|
2939 |
-
|
2940 |
-
$attr = "
|
2941 |
if ($this->fn_backlink_class != "") {
|
2942 |
$class = $this->fn_backlink_class;
|
2943 |
$class = $this->encodeAttribute($class);
|
@@ -3091,4 +3104,3 @@ class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
|
3091 |
}
|
3092 |
|
3093 |
}
|
3094 |
-
|
17 |
# Markdown Parser Class
|
18 |
#
|
19 |
|
20 |
+
class Markdown implements MarkdownInterface {
|
21 |
|
22 |
### Version ###
|
23 |
|
24 |
+
const MARKDOWNLIB_VERSION = "1.4.0";
|
25 |
|
26 |
### Simple Function Interface ###
|
27 |
|
1269 |
# Ampersand-encoding based entirely on Nat Irons's Amputator
|
1270 |
# MT plugin: <http://bumppo.net/projects/amputator/>
|
1271 |
$text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/',
|
1272 |
+
'&', $text);
|
1273 |
}
|
1274 |
# Encode remaining <'s
|
1275 |
$text = str_replace('<', '<', $text);
|
1302 |
>
|
1303 |
}xi',
|
1304 |
array(&$this, '_doAutoLinks_email_callback'), $text);
|
1305 |
+
$text = preg_replace_callback('{<(tel:([^\'">\s]+))>}i',array(&$this, '_doAutoLinks_tel_callback'), $text);
|
1306 |
|
1307 |
return $text;
|
1308 |
}
|
1309 |
+
protected function _doAutoLinks_tel_callback($matches) {
|
1310 |
+
$url = $this->encodeAttribute($matches[1]);
|
1311 |
+
$tel = $this->encodeAttribute($matches[2]);
|
1312 |
+
$link = "<a href=\"$url\">$tel</a>";
|
1313 |
+
return $this->hashPart($link);
|
1314 |
+
}
|
1315 |
protected function _doAutoLinks_url_callback($matches) {
|
1316 |
$url = $this->encodeAttribute($matches[1]);
|
1317 |
$link = "<a href=\"$url\">$url</a>";
|
1531 |
# one.
|
1532 |
#
|
1533 |
|
1534 |
+
abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
1535 |
|
1536 |
### Configuration Variables ###
|
1537 |
|
1839 |
<\?.*?\?> | <%.*?%> # Processing instruction
|
1840 |
|
|
1841 |
<!\[CDATA\[.*?\]\]> # CData Block
|
|
|
|
|
|
|
1842 |
'. ( !$span ? ' # If not in span.
|
1843 |
|
|
1844 |
# Indented code block
|
1850 |
|
|
1851 |
# Fenced code block marker
|
1852 |
(?<= ^ | \n )
|
1853 |
+
[ ]{0,'.($indent+3).'}(?:~{3,}|`{3,})
|
1854 |
[ ]*
|
1855 |
(?:
|
1856 |
\.?[-_:a-zA-Z0-9]+ # standalone class name
|
1858 |
'.$this->id_class_attr_nocatch_re.' # extra attributes
|
1859 |
)?
|
1860 |
[ ]*
|
1861 |
+
(?= \n )
|
1862 |
' : '' ). ' # End (if not is span).
|
1863 |
+
|
|
1864 |
+
# Code span marker
|
1865 |
+
# Note, this regex needs to go after backtick fenced
|
1866 |
+
# code blocks but it should also be kept outside of the
|
1867 |
+
# "if not in span" condition adding backticks to the parser
|
1868 |
+
`+
|
1869 |
)
|
1870 |
}xs';
|
1871 |
|
1907 |
$text = $parts[2]; # Remaining text after current tag.
|
1908 |
$tag_re = preg_quote($tag); # For use in a regular expression.
|
1909 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1910 |
#
|
1911 |
# Check for: Fenced code block marker.
|
1912 |
+
# Note: need to recheck the whole tag to disambiguate backtick
|
1913 |
+
# fences from code spans
|
1914 |
#
|
1915 |
+
if (preg_match('{^\n?([ ]{0,'.($indent+3).'})(~{3,}|`{3,})[ ]*(?:\.?[-_:a-zA-Z0-9]+|'.$this->id_class_attr_nocatch_re.')?[ ]*\n?$}', $tag, $capture)) {
|
1916 |
# Fenced code block marker: find matching end marker.
|
1917 |
$fence_indent = strlen($capture[1]); # use captured indent in re
|
1918 |
$fence_re = $capture[2]; # use captured fence in re
|
1937 |
$parsed .= $tag;
|
1938 |
}
|
1939 |
#
|
1940 |
+
# Check for: Code span marker
|
1941 |
+
# Note: need to check this after backtick fenced code blocks
|
1942 |
+
#
|
1943 |
+
else if ($tag{0} == "`") {
|
1944 |
+
# Find corresponding end marker.
|
1945 |
+
$tag_re = preg_quote($tag);
|
1946 |
+
if (preg_match('{^(?>.+?|\n(?!\n))*?(?<!`)'.$tag_re.'(?!`)}',
|
1947 |
+
$text, $matches))
|
1948 |
+
{
|
1949 |
+
# End marker found: pass text unchanged until marker.
|
1950 |
+
$parsed .= $tag . $matches[0];
|
1951 |
+
$text = substr($text, strlen($matches[0]));
|
1952 |
+
}
|
1953 |
+
else {
|
1954 |
+
# Unmatched marker: just skip it.
|
1955 |
+
$parsed .= $tag;
|
1956 |
+
}
|
1957 |
+
}
|
1958 |
+
#
|
1959 |
# Check for: Opening Block level tag or
|
1960 |
# Opening Context Block tag (like ins and del)
|
1961 |
# used as a block tag (tag is alone on it's line).
|
2780 |
(?:\n|\A)
|
2781 |
# 1: Opening marker
|
2782 |
(
|
2783 |
+
(?:~{3,}|`{3,}) # 3 or more tildes/backticks.
|
2784 |
)
|
2785 |
[ ]*
|
2786 |
(?:
|
2799 |
)
|
2800 |
|
2801 |
# Closing marker.
|
2802 |
+
\1 [ ]* (?= \n )
|
2803 |
}xm',
|
2804 |
array(&$this, '_doFencedCodeBlocks_callback'), $text);
|
2805 |
|
2949 |
$text .= "<div class=\"footnotes\">\n";
|
2950 |
$text .= "<hr". $this->empty_element_suffix ."\n";
|
2951 |
$text .= "<ol>\n\n";
|
2952 |
+
|
2953 |
+
$attr = "";
|
2954 |
if ($this->fn_backlink_class != "") {
|
2955 |
$class = $this->fn_backlink_class;
|
2956 |
$class = $this->encodeAttribute($class);
|
3104 |
}
|
3105 |
|
3106 |
}
|
|
includes/php_markdown/Michelf/MarkdownExtra.inc.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
# Use this file if you cannot use class autoloading. It will include all the
|
4 |
+
# files needed for the MarkdownExtra parser.
|
5 |
+
#
|
6 |
+
# Take a look at the PSR-0-compatible class autoloading implementation
|
7 |
+
# in the Readme.php file if you want a simple autoloader setup.
|
8 |
+
|
9 |
+
require_once dirname(__FILE__) . '/MarkdownInterface.php';
|
10 |
+
require_once dirname(__FILE__) . '/Markdown.php';
|
11 |
+
require_once dirname(__FILE__) . '/MarkdownExtra.php';
|
includes/php_markdown/Michelf/MarkdownInterface.inc.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
# Use this file if you cannot use class autoloading. It will include all the
|
4 |
+
# files needed for the MarkdownInterface interface.
|
5 |
+
#
|
6 |
+
# Take a look at the PSR-0-compatible class autoloading implementation
|
7 |
+
# in the Readme.php file if you want a simple autoloader setup.
|
8 |
+
|
9 |
+
require_once dirname(__FILE__) . '/MarkdownInterface.php';
|
includes/php_markdown/Michelf/MarkdownInterface.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
#
|
3 |
+
# Markdown - A text-to-HTML conversion tool for web writers
|
4 |
+
#
|
5 |
+
# PHP Markdown
|
6 |
+
# Copyright (c) 2004-2013 Michel Fortin
|
7 |
+
# <http://michelf.com/projects/php-markdown/>
|
8 |
+
#
|
9 |
+
# Original Markdown
|
10 |
+
# Copyright (c) 2004-2006 John Gruber
|
11 |
+
# <http://daringfireball.net/projects/markdown/>
|
12 |
+
#
|
13 |
+
namespace Michelf;
|
14 |
+
|
15 |
+
|
16 |
+
#
|
17 |
+
# Markdown Parser Interface
|
18 |
+
#
|
19 |
+
|
20 |
+
interface MarkdownInterface {
|
21 |
+
|
22 |
+
#
|
23 |
+
# Initialize the parser and return the result of its transform method.
|
24 |
+
# This will work fine for derived classes too.
|
25 |
+
#
|
26 |
+
public static function defaultTransform($text);
|
27 |
+
|
28 |
+
#
|
29 |
+
# Main function. Performs some preprocessing on the input text
|
30 |
+
# and pass it through the document gamut.
|
31 |
+
#
|
32 |
+
public function transform($text);
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
?>
|
includes/php_markdown/Readme.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
PHP Markdown
|
2 |
============
|
3 |
|
4 |
-
PHP Markdown Lib 1.
|
5 |
|
6 |
by Michel Fortin
|
7 |
<http://michelf.ca/>
|
@@ -14,19 +14,21 @@ Introduction
|
|
14 |
------------
|
15 |
|
16 |
This is a library package that includes the PHP Markdown parser and its
|
17 |
-
sibling PHP Markdown Extra
|
18 |
|
19 |
Markdown is a text-to-HTML conversion tool for web writers. Markdown
|
20 |
allows you to write using an easy-to-read, easy-to-write plain text
|
21 |
format, then convert it to structurally valid XHTML (or HTML).
|
22 |
|
23 |
-
"Markdown" is two things: a plain text markup syntax, and a
|
24 |
-
tool, written in Perl, that converts the plain text
|
25 |
-
PHP Markdown is a port to PHP of the original Markdown
|
26 |
-
John Gruber.
|
27 |
|
28 |
-
Full documentation of Markdown
|
29 |
-
|
|
|
|
|
30 |
|
31 |
|
32 |
Requirement
|
@@ -47,9 +49,8 @@ Usage
|
|
47 |
|
48 |
This library package is meant to be used with class autoloading. For autoloading
|
49 |
to work, your project needs have setup a PSR-0-compatible autoloader. See the
|
50 |
-
included Readme.php file for a minimal autoloader setup. (If you
|
51 |
-
|
52 |
-
files prior use instead.)
|
53 |
|
54 |
With class autoloading in place, putting the 'Michelf' folder in your
|
55 |
include path should be enough for this to work:
|
@@ -85,6 +86,22 @@ To learn more, see the full list of [configuration variables].
|
|
85 |
[configuration variables]: http://michelf.ca/projects/php-markdown/configuration/
|
86 |
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
Public API and Versioning Policy
|
89 |
---------------------------------
|
90 |
|
@@ -128,13 +145,51 @@ that the backtrack limit is not too low by running `php --info | grep pcre`.
|
|
128 |
See Installation and Requirement above for details.
|
129 |
|
130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
Version History
|
132 |
---------------
|
133 |
|
134 |
-
PHP Markdown Lib 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
|
136 |
This is the first release of PHP Markdown Lib. This package requires PHP
|
137 |
-
version
|
138 |
optionally with Composer. Here is a list of the changes since
|
139 |
PHP Markdown Extra 1.2.6:
|
140 |
|
1 |
PHP Markdown
|
2 |
============
|
3 |
|
4 |
+
PHP Markdown Lib 1.4.0 - 29 Nov 2013
|
5 |
|
6 |
by Michel Fortin
|
7 |
<http://michelf.ca/>
|
14 |
------------
|
15 |
|
16 |
This is a library package that includes the PHP Markdown parser and its
|
17 |
+
sibling PHP Markdown Extra with additional features.
|
18 |
|
19 |
Markdown is a text-to-HTML conversion tool for web writers. Markdown
|
20 |
allows you to write using an easy-to-read, easy-to-write plain text
|
21 |
format, then convert it to structurally valid XHTML (or HTML).
|
22 |
|
23 |
+
"Markdown" is actually two things: a plain text markup syntax, and a
|
24 |
+
software tool, originally written in Perl, that converts the plain text
|
25 |
+
markup to HTML. PHP Markdown is a port to PHP of the original Markdown
|
26 |
+
program by John Gruber.
|
27 |
|
28 |
+
* [Full documentation of the Markdown syntax](<http://daringfireball.net/projects/markdown/>)
|
29 |
+
- Daring Fireball (John Gruber)
|
30 |
+
* [Markdown Extra syntax additions](<http://michelf.ca/projects/php-markdown/extra/>)
|
31 |
+
- Michel Fortin
|
32 |
|
33 |
|
34 |
Requirement
|
49 |
|
50 |
This library package is meant to be used with class autoloading. For autoloading
|
51 |
to work, your project needs have setup a PSR-0-compatible autoloader. See the
|
52 |
+
included Readme.php file for a minimal autoloader setup. (If you cannot use
|
53 |
+
autoloading, see below.)
|
|
|
54 |
|
55 |
With class autoloading in place, putting the 'Michelf' folder in your
|
56 |
include path should be enough for this to work:
|
86 |
[configuration variables]: http://michelf.ca/projects/php-markdown/configuration/
|
87 |
|
88 |
|
89 |
+
### Usage without an autoloader
|
90 |
+
|
91 |
+
If you cannot use class autoloading, you can still use `include` or `require`
|
92 |
+
to access the parser. To load the `\Michelf\Markdown` parser, do it this way:
|
93 |
+
|
94 |
+
require_once 'Michelf/Markdown.inc.php';
|
95 |
+
|
96 |
+
Or, if you need the `\Michelf\MarkdownExtra` parser:
|
97 |
+
|
98 |
+
require_once 'Michelf/MarkdownExtra.inc.php';
|
99 |
+
|
100 |
+
While the plain `.php` files depend on autoloading to work correctly, using the
|
101 |
+
`.inc.php` files instead will eagerly load the dependencies that would be
|
102 |
+
loaded on demand if you were using autoloading.
|
103 |
+
|
104 |
+
|
105 |
Public API and Versioning Policy
|
106 |
---------------------------------
|
107 |
|
145 |
See Installation and Requirement above for details.
|
146 |
|
147 |
|
148 |
+
Development and Testing
|
149 |
+
-----------------------
|
150 |
+
|
151 |
+
Pull requests for fixing bugs are welcome. Proposed new features are
|
152 |
+
going meticulously reviewed -- taking into account backward compatibility,
|
153 |
+
potential side effects, and future extensibility -- before deciding on
|
154 |
+
acceptance or rejection.
|
155 |
+
|
156 |
+
If you make a pull request that includes changes to the parser please add
|
157 |
+
tests for what is being changed to [MDTest][] and make a pull request there
|
158 |
+
too.
|
159 |
+
|
160 |
+
[MDTest]: https://github.com/michelf/mdtest/
|
161 |
+
|
162 |
+
|
163 |
Version History
|
164 |
---------------
|
165 |
|
166 |
+
PHP Markdown Lib 1.4.0 (29 Nov 2013)
|
167 |
+
|
168 |
+
* Added support for the `tel:` URL scheme in automatic links.
|
169 |
+
|
170 |
+
<tel:+1-111-111-1111>
|
171 |
+
|
172 |
+
It gets converted to this (note the `tel:` prefix becomes invisible):
|
173 |
+
|
174 |
+
<a href="tel:+1-111-111-1111">+1-111-111-1111</a>
|
175 |
+
|
176 |
+
* Added backtick fenced code blocks to MarkdownExtra, originally from
|
177 |
+
Github-Flavored Markdown.
|
178 |
+
|
179 |
+
* Added an interface called MarkdownInterface implemented by both
|
180 |
+
the Markdown and MarkdownExtra parsers. You can use the interface if
|
181 |
+
you want to create a mockup parser object for unit testing.
|
182 |
+
|
183 |
+
* For those of you who cannot use class autoloading, you can now
|
184 |
+
include `Michelf/Markdown.inc.php` or `Michelf/MarkdownExtra.inc.php` (note
|
185 |
+
the `.inc.php` extension) to automatically include other files required
|
186 |
+
by the parser.
|
187 |
+
|
188 |
+
|
189 |
+
PHP Markdown Lib 1.3 (11 Apr 2013)
|
190 |
|
191 |
This is the first release of PHP Markdown Lib. This package requires PHP
|
192 |
+
version 5.3 or later and is designed to work with PSR-0 autoloading and,
|
193 |
optionally with Composer. Here is a list of the changes since
|
194 |
PHP Markdown Extra 1.2.6:
|
195 |
|
includes/php_markdown/Readme.php
CHANGED
@@ -12,7 +12,7 @@ spl_autoload_register(function($class){
|
|
12 |
# Get Markdown class
|
13 |
use \Michelf\Markdown;
|
14 |
|
15 |
-
# Read file and pass content through the Markdown
|
16 |
$text = file_get_contents('Readme.md');
|
17 |
$html = Markdown::defaultTransform($text);
|
18 |
|
12 |
# Get Markdown class
|
13 |
use \Michelf\Markdown;
|
14 |
|
15 |
+
# Read file and pass content through the Markdown parser
|
16 |
$text = file_get_contents('Readme.md');
|
17 |
$html = Markdown::defaultTransform($text);
|
18 |
|
includes/php_markdown/composer.json
CHANGED
@@ -25,7 +25,7 @@
|
|
25 |
},
|
26 |
"extra": {
|
27 |
"branch-alias": {
|
28 |
-
"dev-lib": "1.
|
29 |
}
|
30 |
}
|
31 |
}
|
25 |
},
|
26 |
"extra": {
|
27 |
"branch-alias": {
|
28 |
+
"dev-lib": "1.4.x-dev"
|
29 |
}
|
30 |
}
|
31 |
}
|
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.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -16,11 +16,13 @@ Plenty of great WordPress plugins focus on providing or including the Bootstrap
|
|
16 |
|
17 |
This plugin creates a simple, out of the way button just above the WordPress TinyMCE editor (next to the "Add Media" button) which pops up the plugin's documentation and shortcode examples for reference and handy "Insert Example" links to send the example shortcodes straight to the editor. There are no additional TinyMCE buttons to clutter up your screen, just great, easy to use shortcodes!
|
18 |
|
|
|
|
|
19 |
If you like this plugin, check out our companion plugin for Font Awesome, [Font Awesome Shortcodes](http://www.wordpress.org/plugins/font-awesome-shortcodes/)
|
20 |
|
21 |
###Supported Shortcodes
|
22 |
####CSS
|
23 |
-
* Grid
|
24 |
* Lead body copy
|
25 |
* Emphasis classes
|
26 |
* Code
|
@@ -49,6 +51,7 @@ If you like this plugin, check out our companion plugin for Font Awesome, [Font
|
|
49 |
* Tooltip
|
50 |
* Popover
|
51 |
* Collapse (Accordion)
|
|
|
52 |
* Modal
|
53 |
|
54 |
== Installation ==
|
@@ -65,6 +68,12 @@ 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 |
|
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.5
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
16 |
|
17 |
This plugin creates a simple, out of the way button just above the WordPress TinyMCE editor (next to the "Add Media" button) which pops up the plugin's documentation and shortcode examples for reference and handy "Insert Example" links to send the example shortcodes straight to the editor. There are no additional TinyMCE buttons to clutter up your screen, just great, easy to use shortcodes!
|
18 |
|
19 |
+
For questions, support, or to contribute to this plugin, check out [our GitHub project](https://github.com/filipstefansson/bootstrap-3-shortcodes)
|
20 |
+
|
21 |
If you like this plugin, check out our companion plugin for Font Awesome, [Font Awesome Shortcodes](http://www.wordpress.org/plugins/font-awesome-shortcodes/)
|
22 |
|
23 |
###Supported Shortcodes
|
24 |
####CSS
|
25 |
+
* Grid (container, row, columns, fully responsive)
|
26 |
* Lead body copy
|
27 |
* Emphasis classes
|
28 |
* Code
|
51 |
* Tooltip
|
52 |
* Popover
|
53 |
* Collapse (Accordion)
|
54 |
+
* Carousel
|
55 |
* Modal
|
56 |
|
57 |
== Installation ==
|
68 |
|
69 |
== Changelog ==
|
70 |
|
71 |
+
= 3.0.3.5 =
|
72 |
+
* Add support for [container] shortcode for themes without a container defined
|
73 |
+
* Add support for [carousel] and [carousel-item] shortcodes
|
74 |
+
* Add support for "xclass" and "data" parameters to all shortcodes
|
75 |
+
* Plenty of bugfixes and code cleanup to fix common issues
|
76 |
+
|
77 |
= 3.0.3.2 =
|
78 |
* Fix help tab popup on edit pages
|
79 |
|