File tree Expand file tree Collapse file tree 1 file changed +2
-26
lines changed
Expand file tree Collapse file tree 1 file changed +2
-26
lines changed Original file line number Diff line number Diff line change 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'] . '"';
466464}
467465add_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 *
You can’t perform that action at this time.
0 commit comments