Changeset 24684
- Timestamp:
- 07/12/2013 07:51:59 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r24682 r24684 1871 1871 * @since 3.6.0 1872 1872 * 1873 * @param string $type Type of media: audio or video1874 1873 * @param string $content A string which might contain media data. 1874 * @param array $types array of media types: 'audio', 'video', 'object', 'embed', or 'iframe' 1875 1875 * @return array A list of found HTML media embeds 1876 1876 */ 1877 function get_media_embedded_in_content( $content ) {1877 function get_media_embedded_in_content( $content, $types = null ) { 1878 1878 $html = array(); 1879 1880 foreach ( array( 'audio', 'video', 'object', 'embed', 'iframe' ) as $tag ) { 1879 $allowed_media_types = array( 'audio', 'video', 'object', 'embed', 'iframe' ); 1880 if ( ! empty( $types ) ) { 1881 if ( ! is_array( $types ) ) 1882 $types = array( $types ); 1883 $allowed_media_types = array_intersect( $allowed_media_types, $types ); 1884 } 1885 1886 foreach ( $allowed_media_types as $tag ) { 1881 1887 if ( preg_match( '#' . get_tag_regex( $tag ) . '#', $content, $matches ) ) { 1882 1888 $html[] = $matches[0];
Note: See TracChangeset
for help on using the changeset viewer.