Move get_url_in_content() out of post-formats.php. see #24202.
git-svn-id: https://develop.svn.wordpress.org/trunk@24683 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a187c535ca
commit
3a408ff249
@ -3409,4 +3409,22 @@ function wp_slash( $value ) {
|
||||
*/
|
||||
function wp_unslash( $value ) {
|
||||
return stripslashes_deep( $value );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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( '/<a\s[^>]*?href=([\'"])(.+?)\1/is', $content, $matches ) )
|
||||
return esc_url_raw( $matches[2] );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -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( '/<a\s[^>]*?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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user