@@ -408,12 +408,10 @@ function ableplayer_shortcode( $atts, $content = null ) {
408408 $ o .= ' data-skin=" ' . $ all_atts ['skin ' ] . '" ' ;
409409 }
410410 if ( ! empty ( $ all_atts ['youtube-id ' ] ) ) {
411- $ youtube_url = ableplayer_parse_youtube ( $ all_atts ['youtube-id ' ] );
412- $ o .= ' data-youtube-id=" ' . $ all_atts ['youtube-id ' ] . '" ' ;
411+ $ o .= ' data-youtube-id=" ' . $ all_atts ['youtube-id ' ] . '" ' ;
413412 }
414413 if ( ! empty ( $ all_atts ['youtube-desc-id ' ] ) ) {
415- $ youtube_desc_url = ableplayer_parse_youtube ( $ all_atts ['youtube-id ' ] );
416- $ o .= ' data-youtube-desc-id=" ' . $ all_atts ['youtube-desc-id ' ] . '" ' ;
414+ $ o .= ' data-youtube-desc-id=" ' . $ all_atts ['youtube-desc-id ' ] . '" ' ;
417415 }
418416 if ( ! empty ( $ all_atts ['youtube-nocookie ' ] ) ) {
419417 $ o .= ' data-youtube-nocookie=" ' . $ all_atts ['youtube-nocookie ' ] . '" ' ;
@@ -440,28 +438,6 @@ function ableplayer_shortcode( $atts, $content = null ) {
440438}
441439add_shortcode ( 'ableplayer ' , 'ableplayer_shortcode ' );
442440
443- /**
444- * Parse the value of a YouTube shortcode attribute to extract YouTube ID if necessary.
445- *
446- * @param string $attr Value of the attribute.
447- *
448- * @param string YouTube video ID.
449- */
450- function ableplayer_parse_youtube ( $ attr ) {
451- $ query = parse_url ( $ attr );
452- if ( ! isset ( $ query ['query ' ] ) ) {
453- $ replace = array ( 'http://youtu.be/ ' , 'https://youtu.be/ ' );
454-
455- return str_replace ( $ replace , '' , $ attr );
456- } else {
457- parse_str ( $ query ['query ' ], $ results );
458-
459- return $ results ['v ' ];
460- }
461-
462- return $ attr ;
463- }
464-
465441/**
466442 * Get unique ID for a specific Ableplayer instance.
467443 *
0 commit comments