diff --git a/README.md b/README.md index ae84809b..51b1db01 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,17 @@ __________ We’ve built in some shortcodes so you can easily add UI elements found in Bootstrap. +| Shortcode | Arguments | Bootstrap Component | +| ------------- | ------------- | ------------- | +| [button] | type, size, url, text | http://getbootstrap.com/css/#buttons | +| [alert]...[/alert] | type, close, text | http://getbootstrap.com/components/#alerts-dismissible | +| [block-message]...[/block-message] | type, close, text | http://getbootstrap.com/components/#alerts | +| [blockquote]...[/blockquote] | float, cite | http://getbootstrap.com/css/#type-blockquotes | +| [row]...[/row] | id | http://getbootstrap.com/css/#grid-example-basic +| [col]...[/col] | id, size, span | http://getbootstrap.com/css/#grid-example-basic + + + Sidebars ________ diff --git a/library/shortcodes.php b/library/shortcodes.php index 36e29725..622c6000 100644 --- a/library/shortcodes.php +++ b/library/shortcodes.php @@ -103,6 +103,33 @@ function blockquotes( $atts, $content = null ) { add_shortcode('blockquote', 'blockquotes'); +function rows($atts, $content = null) { + extract( shortcode_atts( array( + 'id' => '' + ), $atts)); + return "
" . do_shortcode($content) . "
"; +} +add_shortcode('row', 'rows'); + +function cols($atts, $content = null) { + extract( shortcode_atts( array( + 'id' => '', + 'size' => 'md', /* xs, sm, md, lg */ + 'span' => '6' /* 1-12 */ + ), $atts )); + if($span > 12 || $span < 1) { + $span = 6; + } + if(!preg_match('/xs|sm|md|lg/', $size)) { + $size = "md"; + } + + $output = "
"; + $output .= $content; + $output .= "
"; + return $output; +} +add_shortcode('col', 'cols'); ?> \ No newline at end of file