Make WordPress Core

Changeset 24683


Ignore:
Timestamp:
07/12/2013 07:38:37 PM (10 years ago)
Author:
nacin
Message:

Move get_url_in_content() out of post-formats.php. see #24202.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r24642 r24683  
    34113411    return stripslashes_deep( $value );
    34123412}
     3413
     3414/**
     3415 * Extract and return the first URL from passed content.
     3416 *
     3417 * @since 3.6.0
     3418 *
     3419 * @param string $content A string which might contain a URL.
     3420 * @return string The found URL.
     3421 */
     3422function get_url_in_content( $content ) {
     3423    if ( empty( $content ) )
     3424        return '';
     3425
     3426    if ( preg_match( '/<a\s[^>]*?href=([\'"])(.+?)\1/is', $content, $matches ) )
     3427        return esc_url_raw( $matches[2] );
     3428
     3429    return false;
     3430}
  • trunk/wp-includes/post-formats.php

    r24682 r24683  
    236236
    237237/**
    238  * Extract and return the first URL from passed content.
    239  *
    240  * @since 3.6.0
    241  *
    242  * @param string $content A string which might contain a URL.
    243  * @return string The found URL.
    244  */
    245 function get_url_in_content( $content ) {
    246     if ( empty( $content ) )
    247         return '';
    248 
    249     if ( preg_match( '/<a\s[^>]*?href=([\'"])(.+?)\1/is', $content, $matches ) )
    250         return esc_url_raw( $matches[2] );
    251 
    252     return false;
    253 }
    254 
    255 /**
    256238 * Don't display post titles for asides and status posts on the front end.
    257239 *
Note: See TracChangeset for help on using the changeset viewer.