* Improve admin checkbox functionality.

* Add blockquote shortcode.
This commit is contained in:
MickeyKay
2014-07-17 12:01:00 -07:00
parent 48de78fdad
commit a47a71db6f
3 changed files with 40 additions and 7 deletions
+28 -3
View File
@@ -27,7 +27,10 @@ function trestle_shortcode_empty_paragraph_fix($content)
add_filter('the_content', 'trestle_shortcode_empty_paragraph_fix');
/**
* Columns - [col class="one-half first no-list-margin"] Contents [/col]
* Columns
*
* Example:
* [col class="one-half first no-list-margin"] Contents [/col]
*
* Classes:
* - width (one-half, one-third, etc - uses native Genesis column classes in style.css)
@@ -43,7 +46,10 @@ function trestle_column( $atts, $content = null ) {
add_shortcode( 'col', 'trestle_column' );
/**
* Buttons - [button href="url" class="class"]Text[/button]
* Buttons
*
* Example:
* [button href="url" class="class"]Text[/button]
*/
function trestle_button( $atts, $content = null ) {
extract( shortcode_atts( array(
@@ -52,4 +58,23 @@ function trestle_button( $atts, $content = null ) {
), $atts ) );
return '<a class="button ' . $class . '" href="' . $href . '">' . do_shortcode( $content ) . '</a>';
}
add_shortcode( 'button', 'trestle_button' );
add_shortcode( 'button', 'trestle_button' );
/**
* Blockquote
*
* Example:
* [blockquote name="Speaker" sub_text="Position, Company"]Contents[/blockquote]
*/
function trestle_blockquote( $atts, $content = null ) {
extract( shortcode_atts( array(
'name' => '',
'sub_text' => '',
), $atts ) );
$sub_text_html = $sub_text ? '<em>' . $sub_text . '</em>' : '';
$cite = $name ? '<cite>' . $name . $sub_text_html . '</cite>' : '';
return '<blockquote><p>' . $content . $cite . '</p></blockquote>';
}
add_shortcode( 'blockquote', 'trestle_blockquote' );