WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/04/2010 05:23:29 PM (10 years ago)
Author:
ryan
Message:

Introduce home_url(). Props Denis-de-Bernardy, hakre. see #9008

File:
1 edited

Legend:

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

    r12520 r12598  
    257257
    258258    // Add 'www.' if it is absent and should be there
    259     if ( false !== strpos(get_option('home'), '://www.') && false === strpos($url, '://www.') )
     259    if ( false !== strpos(home_url(), '://www.') && false === strpos($url, '://www.') )
    260260        $url = str_replace('://', '://www.', $url);
    261261
    262262    // Strip 'www.' if it is present and shouldn't be
    263     if ( false === strpos(get_option('home'), '://www.') )
     263    if ( false === strpos(home_url(), '://www.') )
    264264        $url = str_replace('://www.', '://', $url);
    265265
     
    268268        $url = str_replace('index.php/', '', $url);
    269269
    270     if ( false !== strpos($url, get_option('home')) ) {
     270    if ( false !== strpos($url, home_url()) ) {
    271271        // Chop off http://domain.com
    272         $url = str_replace(get_option('home'), '', $url);
     272        $url = str_replace(home_url(), '', $url);
    273273    } else {
    274274        // Chop off /path/to/blog
    275         $home_path = parse_url(get_option('home'));
     275        $home_path = parse_url(home_url());
    276276        $home_path = $home_path['path'];
    277277        $url = str_replace($home_path, '', $url);
     
    16461646        }
    16471647
    1648         $home_root = parse_url(get_option('home'));
     1648        $home_root = parse_url(home_url());
    16491649        if ( isset( $home_root['path'] ) ) {
    16501650            $home_root = trailingslashit($home_root['path']);
Note: See TracChangeset for help on using the changeset viewer.