WordPress.org

Make WordPress Core

Changeset 23775


Ignore:
Timestamp:
03/22/2013 07:28:56 AM (9 years ago)
Author:
helen
Message:

Add a filter for get_the_url(). Make sure get_the_url() also checks for the quote post format, as it currently has a URL field. see #23570.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-formats.php

    r23773 r23775  
    399399 *
    400400 * @param string $content A string which might contain a URL.
    401  * @param boolean $remove Whether the remove the found URL from the passed content.
     401 * @param boolean $remove Whether to remove the found URL from the passed content.
    402402 * @return string The found URL.
    403403 */
     
    447447        return '';
    448448
    449     if ( has_post_format( 'link', $post ) ) {
     449    if ( in_array( get_post_format( $post->ID, array( 'link', 'quote' ) ) ) ) {
    450450        $meta = get_post_format_meta( $post->ID );
    451451        if ( ! empty( $meta['url'] ) )
    452             return esc_url_raw( $meta['url'] );
     452            return apply_filters( 'get_the_url', esc_url_raw( $meta['url'] ), $post );
    453453    }
    454454
    455455    if ( ! empty( $post->post_content ) )
    456         return get_content_url( $post->post_content );
     456        return apply_filters( 'get_the_url', get_content_url( $post->post_content ), $post );
    457457}
    458458
Note: See TracChangeset for help on using the changeset viewer.