Ticket #23619: 23619.patch
File 23619.patch, 1.4 KB (added by , 12 years ago) |
---|
-
wp-content/themes/twentythirteen/functions.php
70 70 * This theme supports all available post formats. 71 71 * See http://codex.wordpress.org/Post_Formats 72 72 */ 73 add_theme_support( ' post-formats', array(73 add_theme_support( 'structured-post-formats', array( 74 74 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' 75 75 ) ); 76 76 … … 448 448 449 449 if ( ! function_exists( 'twentythirteen_get_first_url' ) ) : 450 450 /** 451 * Return the URL for the first link in the post content or the permalink if no 452 * URL is found. 451 * Return the URL from the post. 453 452 * 453 * @uses get_the_link() to get the URL in the post meta (if it exists) or 454 * the first link found in the post content. 455 * 456 * Falls back to the permalink if no URL is found in the post. 457 * 454 458 * @since Twenty Thirteen 1.0 455 459 * @return string URL 456 460 */ 457 461 function twentythirteen_get_first_url() { 458 $has_url = preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $match ); 459 $link = ( $has_url ) ? $match[1] : apply_filters( 'the_permalink', get_permalink() ); 462 $has_url = get_the_link(); 460 463 461 return esc_url_raw( $link);464 return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() ); 462 465 } 463 466 endif; 464 467