Skip to content

Commit 77a9cb2

Browse files
committed
deploy: 2375d66
1 parent b983137 commit 77a9cb2

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

ableplayer.php.html

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -434,12 +434,10 @@
434434
$o .= ' data-skin="' . $all_atts['skin'] . '"';
435435
}
436436
if ( ! empty( $all_atts['youtube-id'] ) ) {
437-
$youtube_url = ableplayer_parse_youtube( $all_atts['youtube-id'] );
438-
$o .= ' data-youtube-id="' . $all_atts['youtube-id'] . '"';
437+
$o .= ' data-youtube-id="' . $all_atts['youtube-id'] . '"';
439438
}
440439
if ( ! empty( $all_atts['youtube-desc-id'] ) ) {
441-
$youtube_desc_url = ableplayer_parse_youtube( $all_atts['youtube-id'] );
442-
$o .= ' data-youtube-desc-id="' . $all_atts['youtube-desc-id'] . '"';
440+
$o .= ' data-youtube-desc-id="' . $all_atts['youtube-desc-id'] . '"';
443441
}
444442
if ( ! empty( $all_atts['youtube-nocookie'] ) ) {
445443
$o .= ' data-youtube-nocookie="' . $all_atts['youtube-nocookie'] . '"';
@@ -466,28 +464,6 @@
466464
}
467465
add_shortcode( 'ableplayer', 'ableplayer_shortcode' );
468466

469-
/**
470-
* Parse the value of a YouTube shortcode attribute to extract YouTube ID if necessary.
471-
*
472-
* @param string $attr Value of the attribute.
473-
*
474-
* @param string YouTube video ID.
475-
*/
476-
function ableplayer_parse_youtube( $attr ) {
477-
$query = parse_url( $attr );
478-
if ( ! isset( $query['query'] ) ) {
479-
$replace = array( 'http://youtu.be/', 'https://youtu.be/' );
480-
481-
return str_replace( $replace, '', $attr );
482-
} else {
483-
parse_str( $query['query'], $results );
484-
485-
return $results['v'];
486-
}
487-
488-
return $attr;
489-
}
490-
491467
/**
492468
* Get unique ID for a specific Ableplayer instance.
493469
*

0 commit comments

Comments
 (0)