Changeset 23984
- Timestamp:
- 04/14/2013 01:11:44 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/wp-admin.css
r23976 r23984 3984 3984 } 3985 3985 3986 .wp-format-media-holder.empty { 3986 .wp-format-media-holder.empty, 3987 .wp-format-audio .wp-format-media-holder, 3988 .wp-format-video .wp-format-media-holder { 3987 3989 height: auto; 3988 3990 padding: 55px 0 20px; … … 4013 4015 } 4014 4016 4015 .empty .wp-format-media-select { 4017 .empty .wp-format-media-select, 4018 .wp-format-audio .wp-format-media-select, 4019 .wp-format-video .wp-format-media-select { 4016 4020 height: 20px; 4017 4021 } -
trunk/wp-includes/media.php
r23969 r23984 1846 1846 * @param boolean $html Whether to return HTML or URLs 1847 1847 * @param boolean $remove Whether to remove the found URL from the passed content. 1848 * @param int $limit Optional. The number of medias to return 1848 1849 * @return array A list of parsed shortcodes or extracted srcs 1849 1850 */ 1850 function get_content_media( $type, &$content, $html = true, $remove = false ) {1851 function get_content_media( $type, &$content, $html = true, $remove = false, $limit = 0 ) { 1851 1852 $items = array(); 1852 1853 $matches = array(); … … 1860 1861 1861 1862 $items[] = do_shortcode_tag( $shortcode ); 1863 if ( $limit > 0 && count( $items ) >= $limit ) 1864 break; 1862 1865 } 1863 1866 } … … 2044 2047 * @param string $type Required. 'audio' or 'video' 2045 2048 * @param WP_Post $post Optional. Used instead of global $post when passed. 2049 * @param int $limit Optional. The number of medias to remove if content is scanned. 2046 2050 * @return string 2047 2051 */ 2048 function get_the_post_format_media( $type, &$post = null ) {2052 function get_the_post_format_media( $type, &$post = null, $limit = 0 ) { 2049 2053 global $wp_embed; 2050 2054 … … 2091 2095 $content = $post->post_content; 2092 2096 2093 $htmls = get_content_media( $type, $content, true, true );2097 $htmls = get_content_media( $type, $content, true, true, $limit ); 2094 2098 if ( ! empty( $htmls ) ) { 2095 2099 $html = reset( $htmls ); … … 2134 2138 */ 2135 2139 function the_post_format_video() { 2136 echo get_the_post_format_media( 'video' ); 2140 $null = null; 2141 echo get_the_post_format_media( 'video', $null, 1 ); 2137 2142 } 2138 2143 /** … … 2143 2148 */ 2144 2149 function the_post_format_audio() { 2145 echo get_the_post_format_media( 'audio' ); 2150 $null = null; 2151 echo get_the_post_format_media( 'audio', $null, 1 ); 2146 2152 } 2147 2153 -
trunk/wp-includes/query.php
r23899 r23984 3703 3703 break; 3704 3704 case 'audio': 3705 get_the_post_format_media( 'audio', $post );3705 get_the_post_format_media( 'audio', $post, 1 ); 3706 3706 if ( isset( $post->split_content ) ) 3707 3707 $split_content = $post->split_content; 3708 3708 break; 3709 3709 case 'video': 3710 get_the_post_format_media( 'video', $post );3710 get_the_post_format_media( 'video', $post, 1 ); 3711 3711 if ( isset( $post->split_content ) ) 3712 3712 $split_content = $post->split_content;
Note: See TracChangeset
for help on using the changeset viewer.