From 7690d7fbebe58bdd32bea946770c3a9da17d238b Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 12 Jul 2013 19:38:37 +0000 Subject: [PATCH] Move get_url_in_content() out of post-formats.php. see #24202. git-svn-id: http://core.svn.wordpress.org/trunk@24683 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 20 +++++++++++++++++++- wp-includes/post-formats.php | 18 ------------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 822f4dd337..0a480fb1be 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -3409,4 +3409,22 @@ function wp_slash( $value ) { */ function wp_unslash( $value ) { return stripslashes_deep( $value ); -} \ No newline at end of file +} + +/** + * Extract and return the first URL from passed content. + * + * @since 3.6.0 + * + * @param string $content A string which might contain a URL. + * @return string The found URL. + */ +function get_url_in_content( $content ) { + if ( empty( $content ) ) + return ''; + + if ( preg_match( '/]*?href=([\'"])(.+?)\1/is', $content, $matches ) ) + return esc_url_raw( $matches[2] ); + + return false; +} diff --git a/wp-includes/post-formats.php b/wp-includes/post-formats.php index f9e1b19c2b..214beacf6b 100644 --- a/wp-includes/post-formats.php +++ b/wp-includes/post-formats.php @@ -234,24 +234,6 @@ function _post_format_wp_get_object_terms( $terms ) { } add_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' ); -/** - * Extract and return the first URL from passed content. - * - * @since 3.6.0 - * - * @param string $content A string which might contain a URL. - * @return string The found URL. - */ -function get_url_in_content( $content ) { - if ( empty( $content ) ) - return ''; - - if ( preg_match( '/]*?href=([\'"])(.+?)\1/is', $content, $matches ) ) - return esc_url_raw( $matches[2] ); - - return false; -} - /** * Don't display post titles for asides and status posts on the front end. *