From dc5f04ed54d5964d602444a64acb69b22ed187d0 Mon Sep 17 00:00:00 2001 From: MWDelaney Date: Wed, 24 Dec 2014 14:22:08 -0500 Subject: [PATCH] Allow non-English characters in titles for [modal], [tab], and [collapse] --- bootstrap-shortcodes.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bootstrap-shortcodes.php b/bootstrap-shortcodes.php index bb53c54..4fcb529 100644 --- a/bootstrap-shortcodes.php +++ b/bootstrap-shortcodes.php @@ -1183,7 +1183,7 @@ function bs_tabs( $atts, $content = null ) { $tabs[] = sprintf( '%s', ( !empty($tab["tab"]["active"]) || ($GLOBALS['tabs_default_active'] && $i == 0) ) ? ' class="active"' : '', - 'custom-tab-' . $GLOBALS['tabs_count'] . '-' . sanitize_title( $tab["tab"]["title"] ), + 'custom-tab-' . $GLOBALS['tabs_count'] . '-' . md5($tab["tab"]["title"]), $tab["tab"]["title"] ); $i++; @@ -1219,7 +1219,7 @@ function bs_tab( $atts, $content = null ) { ), $atts ); if( $GLOBALS['tabs_default_active'] && $GLOBALS['tabs_default_count'] == 0 ) { - $active = true; + $atts['active'] = true; } $GLOBALS['tabs_default_count']++; @@ -1228,7 +1228,7 @@ function bs_tab( $atts, $content = null ) { $class .= ( $atts['active'] == 'true' ) ? ' active' : ''; $class .= ( $atts['active'] == 'true' && $atts['fade'] == 'true' ) ? ' in' : ''; - $id = 'custom-tab-'. $GLOBALS['tabs_count'] . '-'. sanitize_title( $atts['title'] ); + $id = 'custom-tab-'. $GLOBALS['tabs_count'] . '-'. md5( $atts['title'] ); $data_props = $this->parse_data_attributes( $atts['data'] ); @@ -1312,7 +1312,7 @@ function bs_collapse( $atts, $content = null ) { $a_class .= ( $atts['active'] == 'true' ) ? '' : 'collapsed'; $parent = 'custom-collapse-'. $GLOBALS['collapsibles_count']; - $current_collapse = $parent . '-'. sanitize_title( $atts['title'] ); + $current_collapse = $parent . '-'. md5( $atts['title'] ); $data_props = $this->parse_data_attributes( $atts['data'] ); @@ -1851,7 +1851,7 @@ function bs_modal( $atts, $content = null ) { $div_class = 'modal fade'; $div_class .= ( $atts['size'] ) ? ' bs-modal-' . $atts['size'] : ''; - $id = 'custom-modal-' . sanitize_title( $atts['title'] ); + $id = 'custom-modal-' . md5( $atts['title'] ); $data_props = $this->parse_data_attributes( $atts['data'] );