@@ 2284-2297 (lines=14) @@ | ||
2281 | } |
|
2282 | } |
|
2283 | ||
2284 | if ( ! $primary ) { |
|
2285 | $audios = get_attached_media( 'audio', $post_id ); |
|
2286 | if ( empty( $audios ) ) { |
|
2287 | return; |
|
2288 | } |
|
2289 | ||
2290 | $audio = reset( $audios ); |
|
2291 | $atts['src'] = wp_get_attachment_url( $audio->ID ); |
|
2292 | if ( empty( $atts['src'] ) ) { |
|
2293 | return; |
|
2294 | } |
|
2295 | ||
2296 | array_unshift( $default_types, 'src' ); |
|
2297 | } |
|
2298 | ||
2299 | /** |
|
2300 | * Filters the media library used for the audio shortcode. |
|
@@ 2521-2534 (lines=14) @@ | ||
2518 | } |
|
2519 | } |
|
2520 | ||
2521 | if ( ! $primary ) { |
|
2522 | $videos = get_attached_media( 'video', $post_id ); |
|
2523 | if ( empty( $videos ) ) { |
|
2524 | return; |
|
2525 | } |
|
2526 | ||
2527 | $video = reset( $videos ); |
|
2528 | $atts['src'] = wp_get_attachment_url( $video->ID ); |
|
2529 | if ( empty( $atts['src'] ) ) { |
|
2530 | return; |
|
2531 | } |
|
2532 | ||
2533 | array_unshift( $default_types, 'src' ); |
|
2534 | } |
|
2535 | ||
2536 | /** |
|
2537 | * Filters the media library used for the video shortcode. |