From 051fdfb0d19eb77a7c10eea5faa9199ff920b5b2 Mon Sep 17 00:00:00 2001 From: Braad Date: Wed, 29 Apr 2015 13:48:50 -0700 Subject: [PATCH] Fix bug in the date shortcode and minor formatting improvements to shortcodes.php --- includes/shortcodes/shortcodes.php | 66 ++++++++++++++---------------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/includes/shortcodes/shortcodes.php b/includes/shortcodes/shortcodes.php index 68a6398..6356208 100644 --- a/includes/shortcodes/shortcodes.php +++ b/includes/shortcodes/shortcodes.php @@ -1,4 +1,4 @@ -[' => '[', - ']

' => ']', + '

[' => '[', + ']

' => ']', ']
' => ']' ); @@ -37,7 +36,7 @@ function trestle_shortcode_empty_paragraph_fix( $content ) add_shortcode( 'col', 'trestle_column' ); /** * Columns - * + * * Example: * [col class="one-half first no-list-margin"] Contents [/col] * @@ -57,12 +56,10 @@ function trestle_column( $atts, $content = null ) { return '
' . do_shortcode( $content ) . '
'; } - - add_shortcode( 'button', 'trestle_button' ); /** * Button - * + * * Example: [button href="url" title="title" target="target" class="class"]Text[/button] * * @param array $atts Shortcode attributes. @@ -79,7 +76,6 @@ function trestle_button( $atts, $content = null ) { return '' . do_shortcode( $content ) . ''; } - add_shortcode( 'date', 'trestle_date' ); /** * Date @@ -93,10 +89,10 @@ add_shortcode( 'date', 'trestle_date' ); function trestle_date( $atts ) { extract( shortcode_atts( array( 'format' => 'M d, Y', - ), $format ) ); + ), $atts ) ); if ( ! $format ) { - $format = 'M d, Y'; + $format = 'M d, Y'; } return date( $format ); @@ -105,7 +101,7 @@ function trestle_date( $atts ) { add_shortcode( 'blockquote', 'trestle_blockquote_shortcode' ); /** * Blockquote - * + * * Example: [blockquote citation=""]Content[/blockquote] * * @since 1.2.0 @@ -115,28 +111,28 @@ add_shortcode( 'blockquote', 'trestle_blockquote_shortcode' ); * @return string Shortcode output. */ function trestle_blockquote_shortcode( $atts, $content = null ) { - - $atts = shortcode_atts( array( - 'citation' => '', - ), $atts ); - - ob_start(); ?> - -
- - - - - - - - - -
- - '', + ), $atts ); - return $output; + ob_start(); ?> + +
+ + + + + + + - + + +
+ +