Changeset 31574 for trunk/src/wp-includes/media.php
- Timestamp:
- 02/27/2015 04:11:00 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r31530 r31574 3221 3221 function get_media_embedded_in_content( $content, $types = null ) { 3222 3222 $html = array(); 3223 $allowed_media_types = array( 'audio', 'video', 'object', 'embed', 'iframe' ); 3223 3224 $allowed_media_types = apply_filters( 'get_media_embedded_in_content_allowed', array( 'audio', 'video', 'object', 'embed', 'iframe' ) ); 3225 3224 3226 if ( ! empty( $types ) ) { 3225 if ( ! is_array( $types ) ) 3227 if ( ! is_array( $types ) ) { 3226 3228 $types = array( $types ); 3229 } 3230 3227 3231 $allowed_media_types = array_intersect( $allowed_media_types, $types ); 3228 3232 } 3229 3233 3230 foreach ( $allowed_media_types as $tag ) { 3231 if ( preg_match( '#' . get_tag_regex( $tag ) . '#', $content, $matches ) ) { 3232 $html[] = $matches[0]; 3234 $tags = implode( '|', $allowed_media_types ); 3235 3236 if ( preg_match_all( '#<(?P<tag>' . $tags . ')[^<]*?(?:>[\s\S]*?<\/(?P=tag)>|\s*\/>)#', $content, $matches ) ) { 3237 foreach ( $matches[0] as $match ) { 3238 $html[] = $match; 3233 3239 } 3234 3240 }
Note: See TracChangeset
for help on using the changeset viewer.