Ticket #24202: 24202.diff
File 24202.diff, 20.4 KB (added by , 11 years ago) |
---|
-
wp-includes/media.php
1906 1906 * @param int $limit Optional. The number of medias to return 1907 1907 * @return array A list of parsed shortcodes or extracted srcs 1908 1908 */ 1909 function get_content_media( $type, &$content, $html = true, $remove = false, $limit = 0 ) { 1909 function get_content_media( $args = array() ) { 1910 $defaults = array( 1911 'type' => null, 1912 'content' => &$content, 1913 'return_html' => true, 1914 'remove_from_content' => false, 1915 'media_count' => 0 1916 ); 1917 1918 $args = wp_parse_args( $args, $defaults ); 1919 1920 if ( null == $args['type'] ) 1921 return; 1922 1910 1923 $items = array(); 1911 1924 1912 if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $ content, $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) {1925 if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $args['content'], $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) { 1913 1926 foreach ( $matches as $shortcode ) { 1914 if ( $ type=== $shortcode[2] ) {1927 if ( $args['type'] === $shortcode[2] ) { 1915 1928 $count = 1; 1916 if ( $ remove)1917 $ content =& str_replace( $shortcode[0], '', $content, $count );1929 if ( $args['remove_from_content'] ) 1930 $args['content'] =& str_replace( $shortcode[0], '', $args['content'], $count ); 1918 1931 1919 1932 $items[] = do_shortcode_tag( $shortcode ); 1920 if ( $ limit > 0 && count( $items ) >= $limit)1933 if ( $args['media_count'] > 0 && count( $items ) >= $args['media_count'] ) 1921 1934 break; 1922 1935 } 1923 1936 } 1924 1937 } 1925 1938 1926 if ( $ html)1939 if ( $args['return_html'] ) 1927 1940 return $items; 1928 1941 1929 1942 $data = array(); … … 1948 1961 * 1949 1962 * @since 3.6.0 1950 1963 * 1951 * @param string $type Type of media: audio or video1964 * @param array $args (optional) An array of arguments. 1952 1965 * @param string $content A string which might contain media data. 1953 1966 * @param boolean $remove Whether to remove the found URL from the passed content. 1954 1967 * @param int $limit Optional. The number of galleries to return 1955 1968 * @return array A list of found HTML media embeds and possibly a URL by itself 1956 1969 */ 1957 function get_embedded_media( $type, &$content, $remove = false, $limit = 0 ) { 1970 function get_embedded_media( $args = array() ) { 1971 $defaults = array( 1972 'type' => null, 1973 'content' => &$content, 1974 'remove_from_content' => false, 1975 'media_count' => 0 1976 ); 1977 1978 $args = wp_parse_args( $args, $defaults ); 1979 1980 if ( null == $args['type'] ) 1981 return; 1982 1958 1983 $html = array(); 1959 1984 1960 foreach ( array( $ type, 'object', 'embed', 'iframe' ) as $tag ) {1961 if ( preg_match( '#' . get_tag_regex( $tag ) . '#', $ content, $matches ) ) {1985 foreach ( array( $args['type'], 'object', 'embed', 'iframe' ) as $tag ) { 1986 if ( preg_match( '#' . get_tag_regex( $tag ) . '#', $args['content'], $matches ) ) { 1962 1987 $html[] = $matches[0]; 1963 if ( $ remove)1964 $ content = str_replace( $matches[0], '', $content);1988 if ( $args['remove_from_content'] ) 1989 $args['content'] = str_replace( $matches[0], '', $args['content'] ); 1965 1990 1966 if ( $ limit > 0 && count( $html ) >= $limit)1991 if ( $args['media_count'] > 0 && count( $html ) >= $args['media_count'] ) 1967 1992 break; 1968 1993 } 1969 1994 } 1970 1995 1971 if ( ! empty( $html ) && count( $html ) >= $ limit)1996 if ( ! empty( $html ) && count( $html ) >= $args['media_count'] ) 1972 1997 return $html; 1973 1998 1974 $lines = explode( "\n", trim( $ content) );1999 $lines = explode( "\n", trim( $args['content'] ) ); 1975 2000 $line = trim( array_shift( $lines ) ); 1976 2001 if ( 0 === stripos( $line, 'http' ) ) { 1977 if ( $ remove)1978 $ content= join( "\n", $lines );2002 if ( $args['remove_from_content'] ) 2003 $args['content'] = join( "\n", $lines ); 1979 2004 1980 2005 $html[] = $line; 1981 2006 } … … 1987 2012 * 1988 2013 * @since 3.6.0 1989 2014 * 2015 * @param array $args (optional) An array of arguments. 1990 2016 * @param string $content A string which might contain audio data. 1991 2017 * @param boolean $html Whether to return HTML or URLs 1992 2018 * @param boolean $remove Whether to remove the found URL from the passed content. 1993 2019 * @return array A list of lists. Each item has a list of HTML or srcs corresponding 1994 2020 * to an [audio]'s HTML or primary src and specified fallbacks 1995 2021 */ 1996 function get_content_audio( &$content, $html = true, $remove = false) {1997 return get_content_media( 'audio', $content, $html, $remove);2022 function get_content_audio( $args = array() ) { 2023 return get_content_media( array_unshift( $args, array( 'type' => 'audio' ) ) ); 1998 2024 } 1999 2025 2000 2026 /** … … 2007 2033 * @param boolean $remove Whether to remove the found URL from the passed content. 2008 2034 * @return array A list of found HTML audio embeds and possibly a URL by itself 2009 2035 */ 2010 function get_embedded_audio( &$content, $remove = false) {2011 return get_embedded_media( 'audio', $content, $remove);2036 function get_embedded_audio( $args = array() ) { 2037 return get_embedded_media( array_unshift( $args, array( 'type' => 'audio' ) ) ); 2012 2038 } 2013 2039 2014 2040 /** … … 2022 2048 * @return array A list of lists. Each item has a list of HTML or srcs corresponding 2023 2049 * to a [video]'s HTML or primary src and specified fallbacks 2024 2050 */ 2025 function get_content_video( &$content, $html = true, $remove = false) {2026 return get_content_media( 'video', $content, $html, $remove);2051 function get_content_video( $args = array() ) { 2052 return get_content_media( array_unshift( $args, array( 'type' => 'video' ) ) ); 2027 2053 } 2028 2054 2029 2055 /** … … 2036 2062 * @param boolean $remove Whether to remove the found URL from the passed content. 2037 2063 * @return array A list of found HTML video embeds and possibly a URL by itself 2038 2064 */ 2039 function get_embedded_video( &$content, $remove = false) {2040 return get_embedded_media( 'video', $content, $remove);2065 function get_embedded_video( $args = array() ) { 2066 return get_embedded_media( array_unshift( $args, array( 'type' => 'video' ) ) ); 2041 2067 } 2042 2068 2043 2069 /** … … 2102 2128 // these functions expect a reference, so we should make a copy of post content to avoid changing it 2103 2129 $content = $post->post_content; 2104 2130 2105 $htmls = get_content_media( $type, $content, true, true, $limit ); 2131 $htmls = get_content_media( array( 2132 'type' => $type, 2133 'content' => $content, 2134 'return_html' => true, 2135 'remove_from_content' => true, 2136 'media_count' => $limit 2137 ) ); 2138 2106 2139 if ( ! empty( $htmls ) ) { 2107 2140 $html = reset( $htmls ); 2108 2141 $post->split_content = $content; … … 2110 2143 return $post->format_content[ $cache_key ]; 2111 2144 } 2112 2145 2113 $embeds = get_embedded_media( $type, $content, true, 1 ); 2146 $embeds = get_embedded_media( array( 2147 'type' => $type, 2148 'content' => $content, 2149 'remove_from_content' => true, 2150 'media_count' => 1 2151 ) ); 2152 2114 2153 if ( ! empty( $embeds ) ) { 2115 2154 $embed = reset( $embeds ); 2116 2155 $post->split_content = $content; … … 2202 2241 * @param int $limit Optional. The number of image srcs to return 2203 2242 * @return array The found images or srcs 2204 2243 */ 2205 function get_content_images( &$content, $html = true, $remove = false, $limit = 0 ) { 2244 function get_content_images( $args = array() ) { 2245 $defaults = array( 2246 'content' => &$content, 2247 'return_html' => true, 2248 'remove_from_content' => false, 2249 'media_count' => 0 2250 ); 2251 2252 $args = wp_parse_args( $args, $defaults ); 2253 2206 2254 $tags = array(); 2207 2255 $captions = array(); 2208 2256 2209 if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $ content, $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) {2257 if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $args['content'], $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) { 2210 2258 foreach ( $matches as $shortcode ) { 2211 2259 if ( 'caption' === $shortcode[2] ) { 2212 2260 $captions[] = $shortcode[0]; 2213 if ( $ html)2261 if ( $args['return_html'] ) 2214 2262 $tags[] = do_shortcode( $shortcode[0] ); 2215 2263 } 2216 2264 2217 if ( $ limit > 0 && count( $tags ) >= $limit)2265 if ( $args['media_count'] > 0 && count( $tags ) >= $args['media_count'] ) 2218 2266 break; 2219 2267 } 2220 2268 } 2221 2269 2222 2270 foreach ( array( 'a', 'img' ) as $tag ) { 2223 if ( preg_match_all( '#' . get_tag_regex( $tag ) . '#i', $ content, $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) {2271 if ( preg_match_all( '#' . get_tag_regex( $tag ) . '#i', $args['content'], $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) { 2224 2272 foreach ( $matches as $node ) { 2225 2273 if ( ! strstr( $node[0], '<img ' ) ) 2226 2274 continue; … … 2231 2279 foreach ( $captions as $caption ) { 2232 2280 if ( strstr( $caption, $node[0] ) ) { 2233 2281 $found = true; 2234 if ( $ remove)2235 $ content = str_replace( $caption, '', $content, $count );2282 if ( $args['remove_from_content'] ) 2283 $args['content'] = str_replace( $caption, '', $args['content'], $count ); 2236 2284 } 2237 2285 } 2238 2286 2239 if ( $ remove)2240 $content = str_replace( $node[0], '', $ content, $count );2287 if ( $args['remove_from_content'] ) 2288 $content = str_replace( $node[0], '', $args['content'], $count ); 2241 2289 2242 2290 if ( ! $found ) 2243 2291 $tags[] = $node[0]; 2244 2292 2245 if ( $ limit > 0 && count( $tags ) >= $limit)2293 if ( $args['media_count'] > 0 && count( $tags ) >= $args['media_count'] ) 2246 2294 break 2; 2247 2295 } 2248 2296 } 2249 2297 } 2250 2298 2251 if ( $ html)2299 if ( $args['return_html'] ) 2252 2300 return $tags; 2253 2301 2254 2302 $srcs = array(); … … 2257 2305 preg_match( '#src=[\'"](.+?)[\'"]#is', $tag, $src ); 2258 2306 if ( ! empty( $src[1] ) ) { 2259 2307 $srcs[] = $src[1]; 2260 if ( $ limit > 0 && count( $srcs ) >= $limit)2308 if ( $args['media_count'] > 0 && count( $srcs ) >= $args['media_count'] ) 2261 2309 break; 2262 2310 } 2263 2311 } 2264 2312 2265 return apply_filters( 'content_images', array_values( array_unique( $srcs ) ), $ content);2313 return apply_filters( 'content_images', array_values( array_unique( $srcs ) ), $args['content'] ); 2266 2314 } 2267 2315 2268 2316 /** … … 2275 2323 * @param boolean $remove Whether to remove the found data from the passed content. 2276 2324 * @return string The found data 2277 2325 */ 2278 function get_content_image( &$content, $html = true, $remove = false ) { 2279 $srcs = get_content_images( $content, $html, $remove, 1 ); 2326 function get_content_image( $args = array() ) { 2327 $defaults = array( 2328 'content' => &$content, 2329 'return_html' => true, 2330 'remove_from_content' => false 2331 ); 2332 2333 $args = wp_parse_args( $args, $defaults ); 2334 2335 $srcs = get_content_images( array_merge( $args, array( 'media_count' => 1 ) ) ); 2280 2336 if ( empty( $srcs ) ) 2281 2337 return ''; 2282 2338 2283 return apply_filters( 'content_image', reset( $srcs ), $ content);2339 return apply_filters( 'content_image', reset( $srcs ), $args['content'] ); 2284 2340 } 2285 2341 2286 2342 /** … … 2294 2350 * @param int $limit Optional. The number of galleries to return 2295 2351 * @return array A list of galleries, which in turn are a list of their srcs in order 2296 2352 */ 2297 function get_content_galleries( &$content, $html = true, $remove = false, $limit = 0 ) { 2353 function get_content_galleries( $args = array() ) { 2354 $defaults = array( 2355 'content' => &$content, 2356 'return_html' => true, 2357 'remove_from_content' => false, 2358 'media_count' => 0 2359 ); 2360 2361 $args = wp_parse_args( $args, $defaults ); 2362 2298 2363 $galleries = array(); 2299 2364 2300 if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $ content, $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) {2365 if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $args['content'], $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) { 2301 2366 foreach ( $matches as $shortcode ) { 2302 2367 if ( 'gallery' === $shortcode[2] ) { 2303 2368 $srcs = array(); 2304 2369 $count = 1; 2305 if ( $ remove)2306 $ content = str_replace( $shortcode[0], '', $content, $count );2370 if ( $args['remove_from_content'] ) 2371 $args['content'] = str_replace( $shortcode[0], '', $args['content'], $count ); 2307 2372 2308 2373 $data = shortcode_parse_atts( $shortcode[3] ); 2309 2374 $gallery = do_shortcode_tag( $shortcode ); 2310 if ( $ html) {2375 if ( $args['return_html'] ) { 2311 2376 $galleries[] = $gallery; 2312 2377 } else { 2313 2378 preg_match_all( '#src=[\'"](.+?)[\'"]#is', $gallery, $src, PREG_SET_ORDER ); … … 2320 2385 $galleries[] = $data; 2321 2386 } 2322 2387 2323 if ( $ limit > 0 && count( $galleries ) >= $limit)2388 if ( $args['media_count'] > 0 && count( $galleries ) >= $args['media_count'] ) 2324 2389 break; 2325 2390 } 2326 2391 } 2327 2392 } 2328 2393 2329 return apply_filters( 'content_galleries', $galleries, $ content);2394 return apply_filters( 'content_galleries', $galleries, $args['content'] ); 2330 2395 } 2331 2396 2332 2397 /** … … 2339 2404 * @return array A list of arrays, each containing gallery data and srcs parsed 2340 2405 * from the expanded shortcode 2341 2406 */ 2342 function get_post_galleries( $post_id = 0, $html = true ) { 2343 $post = empty( $post_id ) ? clone get_post() : get_post( $post_id ); 2407 function get_post_galleries( $args = array() ) { 2408 $defaults = array( 2409 'id' => 0, 2410 'return_html' => true 2411 ); 2412 2413 $args = wp_parse_args( $args, $defaults ); 2414 2415 $post = 0 == $args['id'] ? clone get_post() : get_post( $args['id'] ); 2344 2416 if ( empty( $post ) || ! has_shortcode( $post->post_content, 'gallery' ) ) 2345 2417 return array(); 2346 2418 2347 return get_content_galleries( $post->post_content, $html ); 2419 $galleries = get_content_galleries( array( 2420 'content' => $post->post_content, 2421 'return_html' => $args['return_html'] 2422 ) ); 2423 2424 return $galleries; 2348 2425 } 2349 2426 2350 2427 /** … … 2361 2438 if ( empty( $post ) || ! has_shortcode( $post->post_content, 'gallery' ) ) 2362 2439 return array(); 2363 2440 2364 $data = get_content_galleries( $post->post_content, false ); 2441 $data = get_content_galleries( array( 2442 'content' => $post->post_content, 2443 'return_html' => false 2444 ) ); 2445 2365 2446 return wp_list_pluck( $data, 'src' ); 2366 2447 } 2367 2448 … … 2374 2455 * @param boolean $html Whether to return HTML or data 2375 2456 * @return array Gallery data and srcs parsed from the expanded shortcode 2376 2457 */ 2377 function get_post_gallery( $post_id = 0, $html = true ) { 2378 $post = empty( $post_id ) ? clone get_post() : get_post( $post_id ); 2458 function get_post_gallery( $args = array() ) { 2459 $defaults = array( 2460 'id' => 0, 2461 'return_html' => true 2462 ); 2463 2464 $args = wp_parse_args( $args, $defaults ); 2465 2466 $post = 0 == $args['id'] ? clone get_post() : get_post( $args['id'] ); 2379 2467 if ( empty( $post ) || ! has_shortcode( $post->post_content, 'gallery' ) ) 2380 2468 return array(); 2381 2469 2382 $data = get_content_galleries( $post->post_content, $html, false, 1 ); 2470 $data = get_content_galleries( array( 2471 'content' => $post->post_content, 2472 'return_html' => $args['return_html'], 2473 'remove_from_content' => false, 2474 'media_count' => 1 2475 ) ); 2476 2383 2477 return reset( $data ); 2384 2478 } 2385 2479 … … 2401 2495 * @return array A list of a gallery's image srcs in order 2402 2496 */ 2403 2497 function get_post_gallery_images( $post_id = 0 ) { 2404 $gallery = get_post_gallery( $post_id, false ); 2498 $gallery = get_post_gallery( array( 2499 'id' => $post_id, 2500 'return_html' => false 2501 ) ); 2502 2405 2503 if ( empty( $gallery['src'] ) ) 2406 2504 return array(); 2407 2505 … … 2529 2627 } 2530 2628 2531 2629 $content = $post->post_content; 2532 $htmls = get_content_images( $content, true, true, 1 ); 2630 $htmls = get_content_images( array( 2631 'content' => $content, 2632 'return_html' => true, 2633 'remove_from_content' => true, 2634 'media_count' => 1 2635 ) ); 2636 2533 2637 if ( ! empty( $htmls ) ) { 2534 2638 $html = reset( $htmls ); 2535 2639 $post->split_content = $content; -
wp-includes/post-formats.php
353 353 if ( ! preg_match( '#' . $esc_url . '[^/&\?]?#', $content ) ) { 354 354 $url = $meta['link_url']; 355 355 } else { 356 $url = get_content_url( $content, true);356 $url = get_content_url( array( 'content' => $content, 'remove_from_content' => true ) ); 357 357 } 358 358 } else { 359 359 $content_before = $content; 360 $url = get_content_url( $content, true);360 $url = get_content_url( array( 'content' => $content, 'remove_from_content' => true ) ); 361 361 if ( $content_before == $content ) 362 362 $url = ''; 363 363 } … … 529 529 * @param boolean $remove Whether to remove the found data from the passed content. 530 530 * @return array A chat log as structured data 531 531 */ 532 function get_content_chat( &$content, $remove = false) {532 function get_content_chat( $args = array() ) { 533 533 global $_wp_chat_parsers; 534 534 535 $trimmed = strip_tags( trim( $content ) ); 535 $defaults = array( 536 'content' => &$content, 537 'remove_from_content' => false 538 ); 539 540 $args = wp_parse_args( $args, $defaults ); 541 542 $trimmed = strip_tags( trim( $args['content'] ) ); 536 543 if ( empty( $trimmed ) ) 537 544 return array(); 538 545 … … 620 627 if ( ! empty( $stanza ) ) 621 628 $stanzas[] = $stanza; 622 629 623 if ( $ remove) {630 if ( $args['remove_from_content'] ) { 624 631 if ( 0 === $found_index ) { 625 632 $removed = array_slice( $lines, $last_index ); 626 633 } else { … … 628 635 $after = array_slice( $lines, $last_index + 1 ); 629 636 $removed = array_filter( array_merge( $before, $after ) ); 630 637 } 631 $ content= trim( join( "\n", $removed ) );638 $args['content'] = trim( join( "\n", $removed ) ); 632 639 } 633 640 634 641 return $stanzas; … … 639 646 * 640 647 * @since 3.6.0 641 648 * 642 * @param int $ id (optional) The post ID.649 * @param int $post_id (optional) The post ID. 643 650 * @return array The chat content. 644 651 */ 645 function get_the_post_format_chat( $ id = 0 ) {646 $post = empty( $ id ) ? clone get_post() : get_post( $id );652 function get_the_post_format_chat( $post_id = 0 ) { 653 $post = empty( $post_id ) ? clone get_post() : get_post( $post_id ); 647 654 if ( empty( $post ) ) 648 655 return array(); 649 656 650 $data = get_content_chat( get_paged_content( $post->post_content) );657 $data = get_content_chat( array( 'content' => get_paged_content( $post->post_content ) ) ); 651 658 if ( empty( $data ) ) 652 659 return array(); 653 660 … … 704 711 * @param string $replace (optional) Content to replace the quote content with. 705 712 * @return string The quote content. 706 713 */ 707 function get_content_quote( &$content, $remove = false, $replace = '' ) { 708 if ( empty( $content ) ) 714 function get_content_quote( $args = array() ) { 715 $defaults = array( 716 'content' => &$content, 717 'remove_from_content' => false, 718 'replace_with' => '' 719 ); 720 721 $args = wp_parse_args( $args, $defaults ); 722 723 if ( empty( $args['content'] ) ) 709 724 return ''; 710 725 711 if ( ! preg_match( '/<blockquote[^>]*>(.+?)<\/blockquote>/is', $ content, $matches ) ) {712 $quote = $ content;713 if ( $ remove || ! empty( $replace) )714 $ content = $replace;726 if ( ! preg_match( '/<blockquote[^>]*>(.+?)<\/blockquote>/is', $args['content'], $matches ) ) { 727 $quote = $args['content']; 728 if ( $args['remove_from_content'] || ! empty( $args['replace_with'] ) ) 729 $args['content'] = $args['replace_with']; 715 730 return $quote; 716 731 } 717 732 718 if ( $ remove || ! empty( $replace) )719 $ content = preg_replace( '/<blockquote[^>]*>(.+?)<\/blockquote>/is', addcslashes( $replace, '\\$' ), $content, 1 );733 if ( $args['remove_from_content'] || ! empty( $args['replace_with'] ) ) 734 $args['content'] = preg_replace( '/<blockquote[^>]*>(.+?)<\/blockquote>/is', addcslashes( $args['replace_with'], '\\$' ), $args['content'], 1 ); 720 735 721 736 return $matches[1]; 722 737 } … … 739 754 return ''; 740 755 741 756 $content = $post->post_content; 742 $quote = get_content_quote( $content, true ); 757 $quote = get_content_quote( array( 758 'content' => $content, 759 'remove_from_content' => true 760 ) ); 761 743 762 $post->split_content = $content; 744 763 745 764 if ( ! empty( $quote ) ) … … 778 797 * @return string The found URL. 779 798 */ 780 799 function get_content_url( &$content, $remove = false ) { 781 if ( empty( $content ) ) 800 $defaults = array( 801 'content' => &$content, 802 'remove_from_content' => false 803 ); 804 805 $args = wp_parse_args( $args, $defaults ); 806 807 if ( empty( $args['content'] ) ) 782 808 return ''; 783 809 784 810 // the content is a URL 785 $trimmed = trim( $ content);811 $trimmed = trim( $args['content'] ); 786 812 if ( 0 === stripos( $trimmed, 'http' ) && ! preg_match( '#\s#', $trimmed ) ) { 787 if ( $ remove)788 $ content= '';813 if ( $args['remove_from_content'] ) 814 $args['content'] = ''; 789 815 790 816 return $trimmed; 791 817 // the content is HTML so we grab the first href 792 } elseif ( preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', $ content, $matches ) ) {818 } elseif ( preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', $args['content'], $matches ) ) { 793 819 return esc_url_raw( $matches[1] ); 794 820 } 795 821 … … 798 824 799 825 // the content is a URL followed by content 800 826 if ( 0 === stripos( $line, 'http' ) ) { 801 if ( $ remove)802 $ content= trim( join( "\n", $lines ) );827 if ( $args['remove_from_content'] ) 828 $args['content'] = trim( join( "\n", $lines ) ); 803 829 804 830 return esc_url_raw( $line ); 805 831 } … … 845 871 } 846 872 847 873 if ( ! empty( $post->post_content ) ) 848 return apply_filters( 'get_the_post_format_url', get_content_url( $post->post_content), $post );874 return apply_filters( 'get_the_post_format_url', get_content_url( array( 'content' => $post->post_content ) ), $post ); 849 875 } 850 876 851 877 /**