Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
Allow non-English characters in titles for [modal], [tab], and [colla…
Browse files Browse the repository at this point in the history
…pse]
  • Loading branch information
MWDelaney committed Dec 24, 2014
1 parent b8fac3e commit dc5f04e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bootstrap-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ function bs_tabs( $atts, $content = null ) {
$tabs[] = sprintf(
'<li%s><a href="#%s" data-toggle="tab">%s</a></li>',
( !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++;
Expand Down Expand Up @@ -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']++;

Expand All @@ -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'] );

Expand Down Expand Up @@ -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'] );

Expand Down Expand Up @@ -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'] );

Expand Down

0 comments on commit dc5f04e

Please sign in to comment.