Skip to content

Commit

Permalink
Add Emphasis classes shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
FoolsRun committed Sep 18, 2013
1 parent 7644e83 commit 99d148b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The plugin doesn't support all Bootstrap elements yet, but most of them.
* [Buttons](#buttons)
* [Button Groups](#button-groups)
* [Lead body copy](#lead-body-copy)
* [Emphasis classes](#emphasis-classes)
* [Alerts](#alerts)
* [Code](#code)
* [Labels](#labels)
Expand Down Expand Up @@ -98,6 +99,15 @@ vertical | Whether button group is vertical | optional | true, false | false

[Bootstrap body copy documentation](http://getbootstrap.com/css/#type-body-copy)

### Emphasis classes
[emphasis type="success"] … [/emphasis]

Parameter | Description | Required | Values | Default
--- | --- | --- | --- | ---
type | The type of label to display | required | muted, primary, success, info, warning, danger | muted

[Bootstrap emphasis classes documentation](http://getbootstrap.com/css/#type-emphasis)

### Alerts
[alert type="success"] … [/alert]

Expand Down
15 changes: 15 additions & 0 deletions bootstrap-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function add_shortcodes() {
add_shortcode('media-body', array( $this, 'bs_media_body' ));
add_shortcode('jumbotron', array( $this, 'bs_jumbotron' ));
add_shortcode('lead', array( $this, 'bs_lead' ));
add_shortcode('emphasis', array( $this, 'bs_emphasis' ));
add_shortcode('thumbnail', array( $this, 'bs_thumbnail' ));
}

Expand Down Expand Up @@ -693,6 +694,20 @@ function bs_lead( $atts, $content = null ) {

}

/*--------------------------------------------------------------------------------------
*
* bs_emphasis
*
*
*-------------------------------------------------------------------------------------*/
function bs_emphasis( $atts, $content = null ) {
extract(shortcode_atts(array(
"type" => 'muted'
), $atts));
return '<p class="text-' . $type . '">' . do_shortcode( $content ) . '</p>';

}

/*--------------------------------------------------------------------------------------
*
* bs_thumbnail
Expand Down

0 comments on commit 99d148b

Please sign in to comment.