WordPress.org

Make WordPress Core

Ticket #23619: 23619.patch

File 23619.patch, 1.4 KB (added by Frank Klein, 8 years ago)
  • wp-content/themes/twentythirteen/functions.php

     
    7070         * This theme supports all available post formats.
    7171         * See http://codex.wordpress.org/Post_Formats
    7272         */
    73         add_theme_support( 'post-formats', array(
     73        add_theme_support( 'structured-post-formats', array(
    7474                'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video'
    7575        ) );
    7676
     
    448448
    449449if ( ! function_exists( 'twentythirteen_get_first_url' ) ) :
    450450/**
    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.
    453452 *
     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 *
    454458 * @since Twenty Thirteen 1.0
    455459 * @return string URL
    456460 */
    457461function 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();
    460463
    461         return esc_url_raw( $link );
     464        return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );
    462465}
    463466endif;
    464467