From 4fd8f9915dab41441a17233fc2e60f564f29dc44 Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Fri, 22 Mar 2013 07:28:56 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@23775 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post-formats.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/post-formats.php b/wp-includes/post-formats.php index b8c406faf6..39eaa1a645 100644 --- a/wp-includes/post-formats.php +++ b/wp-includes/post-formats.php @@ -398,7 +398,7 @@ function post_formats_compat( $content, $id = 0 ) { * @since 3.6.0 * * @param string $content A string which might contain a URL. - * @param boolean $remove Whether the remove the found URL from the passed content. + * @param boolean $remove Whether to remove the found URL from the passed content. * @return string The found URL. */ function get_content_url( &$content, $remove = false ) { @@ -446,14 +446,14 @@ function get_the_url( $id = 0 ) { if ( empty( $post ) ) return ''; - if ( has_post_format( 'link', $post ) ) { + if ( in_array( get_post_format( $post->ID, array( 'link', 'quote' ) ) ) ) { $meta = get_post_format_meta( $post->ID ); if ( ! empty( $meta['url'] ) ) - return esc_url_raw( $meta['url'] ); + return apply_filters( 'get_the_url', esc_url_raw( $meta['url'] ), $post ); } if ( ! empty( $post->post_content ) ) - return get_content_url( $post->post_content ); + return apply_filters( 'get_the_url', get_content_url( $post->post_content ), $post ); } /**