Skip to content

Commit 28b1e78

Browse files
committed
Clean up some attribute rendering in shortcode.
1 parent d433795 commit 28b1e78

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ableplayer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ function ableplayer_shortcode( $atts, $content = null ) {
520520
}
521521

522522
// build a video player.
523-
$o = "<$element ";
523+
$o = PHP_EOL . "<$element";
524524
$o .= ' id="' . esc_attr( $all_atts['id'] ) . '"';
525525
$o .= ' data-able-player';
526526
if ( ableplayer_is_true( $all_atts['autoplay'] ) ) {
@@ -553,10 +553,10 @@ function ableplayer_shortcode( $atts, $content = null ) {
553553
if ( ! empty( $all_atts['height'] ) ) {
554554
$o .= ' height="' . esc_attr( $all_atts['height'] ) . '"';
555555
}
556-
if ( ! empty( $all_atts['heading'] ) ) {
556+
if ( ! empty( $all_atts['heading'] ) && 'auto' !== $all_atts['heading'] ) {
557557
$o .= ' data-heading-level="' . esc_attr( $all_atts['heading'] ) . '"';
558558
}
559-
if ( ! empty( $all_atts['speed'] ) ) {
559+
if ( ! empty( $all_atts['speed'] ) && $all_atts['speed'] !== ableplayer_get_settings( 'default_speed' ) ) {
560560
$o .= ' data-speed-icons="' . esc_attr( $all_atts['speed'] ) . '"';
561561
}
562562
if ( ! empty( $all_atts['start'] ) ) {
@@ -591,10 +591,10 @@ function ableplayer_shortcode( $atts, $content = null ) {
591591
}
592592
$o .= '>' . PHP_EOL;
593593

594-
$o .= $source;
594+
$o .= "\t" . $source;
595595

596596
if ( ! empty( $tracks ) ) {
597-
$o .= implode( PHP_EOL, $tracks );
597+
$o .= implode( PHP_EOL . "\t", $tracks );
598598
}
599599
// enclosing tags.
600600
if ( ! is_null( $content ) ) {

0 commit comments

Comments
 (0)