Cool changes to jquery and shortcodes.

This commit is contained in:
MickeyKay
2014-11-21 16:03:12 -08:00
parent 3146ae3c98
commit f716b06429
3 changed files with 12 additions and 14 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ function trestle_header_actions() {
$php_vars = array (
'trestle_equal_cols_breakpoint' => genesis_get_option( 'trestle_equal_cols_breakpoint' ),
);
wp_localize_script( 'theme-jquery', 'php_vars', $php_vars );
wp_localize_script( 'theme-jquery', 'trestle_vars', $php_vars );
}
+2 -2
View File
@@ -10,8 +10,8 @@
jQuery(document).ready(function() {
// Get PHP vars passed via wp_localize_script()
trestleEqualColsBreakpoint = php_vars.trestle_equal_cols_breakpoint;
trestleEqualHeightCols = php_vars.trestle_equal_height_cols
trestleEqualColsBreakpoint = trestle_vars.trestle_equal_cols_breakpoint;
trestleEqualHeightCols = trestle_vars.trestle_equal_height_cols;
// Remove .no-jquery body class
jQuery('body').removeClass('no-jquery');
+9 -11
View File
@@ -62,20 +62,18 @@ function trestle_button( $atts, $content = null ) {
add_shortcode( 'button', 'trestle_button' );
/**
* Blockquote
* Buttons
*
* Example:
* [blockquote name="Speaker" sub_text="Position, Company"]Contents[/blockquote]
* [button href="url" title="title" target="target" class="class"]Text[/button]
*/
function trestle_blockquote( $atts, $content = null ) {
function trestle_button( $atts, $content = null ) {
extract( shortcode_atts( array(
'name' => '',
'sub_text' => '',
'href' => '#',
'target' => '',
'title' => '',
'class' => '',
), $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>';
return '<a class="button ' . $class . '" href="' . $href . '" title="' . $title . '" target="' . $target . '">' . do_shortcode( $content ) . '</a>';
}
add_shortcode( 'blockquote', 'trestle_blockquote' );
add_shortcode( 'button', 'trestle_button' );