Make WordPress Core

Ticket #25418: siteurl2.diff

File siteurl2.diff, 5.5 KB (added by technosailor, 12 years ago)

Here's a broader patch that ensures we eat our dogfood throughout core, but I don't feel as strongly about it and would be okay pushing to 3.8 for the second patch. Still think original patch needs to be in 3.7

  • wp-includes/class-http.php

     
    513513                if ( ! $check )
    514514                        return true;
    515515
    516                 $home = parse_url( get_option('siteurl') );
     516                $home = parse_url( site_url() );
    517517
    518518                // Don't block requests back to ourselves by default
    519519                if ( $check['host'] == 'localhost' || $check['host'] == $home['host'] )
     
    15251525                if ( $check === false )
    15261526                        return true;
    15271527
    1528                 $home = parse_url( get_option('siteurl') );
     1528                $home = parse_url( site_url() );
    15291529
    15301530                $result = apply_filters( 'pre_http_send_through_proxy', null, $uri, $check, $home );
    15311531                if ( ! is_null( $result ) )
  • wp-includes/default-constants.php

     
    9191 */
    9292function wp_plugin_directory_constants() {
    9393        if ( !defined('WP_CONTENT_URL') )
    94                 define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
     94                define( 'WP_CONTENT_URL', site_url( '/wp-content' ) ); // full url - WP_CONTENT_DIR is defined further up
    9595
    9696        /**
    9797         * Allows for the plugins directory to be moved from the default location.
     
    209209         * @since 1.5.0
    210210         */
    211211        if ( !defined('SITECOOKIEPATH') )
    212                 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
     212                define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', site_url('/') ) );
    213213
    214214        /**
    215215         * @since 2.6.0
  • wp-includes/theme.php

     
    498498                $theme_root_uri = content_url( 'themes' );
    499499        }
    500500
    501         return apply_filters( 'theme_root_uri', $theme_root_uri, get_option('siteurl'), $stylesheet_or_template );
     501        return apply_filters( 'theme_root_uri', $theme_root_uri, site_url(), $stylesheet_or_template );
    502502}
    503503
    504504/**
  • wp-includes/comment-template.php

     
    858858        if ( '' != get_option('permalink_structure') )
    859859                $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback');
    860860        else
    861                 $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . get_the_ID();
     861                $tb_url = site_url( '/wp-trackback.php?p=' . get_the_ID() );
    862862
    863863        /**
    864864         * Filter the returned trackback URL.
     
    11711171                if ( empty( $wpcommentspopupfile ) )
    11721172                        $home = home_url();
    11731173                else
    1174                         $home = get_option('siteurl');
     1174                        $home = site_url();
    11751175                echo $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id;
    11761176                echo '" onclick="wpopen(this.href); return false"';
    11771177        } else { // if comments_popup_script() is not in the template, display simple comment link
  • wp-includes/bookmark-template.php

     
    103103                        if ( strpos($bookmark->link_image, 'http') === 0 )
    104104                                $output .= "<img src=\"$bookmark->link_image\" $alt $title />";
    105105                        else // If it's a relative path
    106                                 $output .= "<img src=\"" . get_option('siteurl') . "$bookmark->link_image\" $alt $title />";
     106                                $output .= "<img src=\"" . site_url( $bookmark->link_image ) . "\" $alt $title />";
    107107
    108108                        if ( $show_name )
    109109                                $output .= " $name";
  • wp-includes/user.php

     
    719719                $blogs[ $blog_id ]->domain = '';
    720720                $blogs[ $blog_id ]->path = '';
    721721                $blogs[ $blog_id ]->site_id = 1;
    722                 $blogs[ $blog_id ]->siteurl = get_option('siteurl');
     722                $blogs[ $blog_id ]->siteurl = site_url();
    723723                $blogs[ $blog_id ]->archived = 0;
    724724                $blogs[ $blog_id ]->spam = 0;
    725725                $blogs[ $blog_id ]->deleted = 0;
  • wp-includes/general-template.php

     
    478478                        $output = get_feed_link('comments_rss2');
    479479                        break;
    480480                case 'pingback_url':
    481                         $output = get_option('siteurl') .'/xmlrpc.php';
     481                        $output = site_url() .'/xmlrpc.php';
    482482                        break;
    483483                case 'stylesheet_url':
    484484                        $output = get_stylesheet_uri();
  • wp-includes/theme-compat/comments-popup.php

     
    6666<h2><?php _e('Leave a comment'); ?></h2>
    6767<p><?php printf(__('Line and paragraph breaks automatic, e-mail address never displayed, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code>%s</code>'), allowed_tags()); ?></p>
    6868
    69 <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
     69<form action="<?php echo site_url(); ?>/wp-comments-post.php" method="post" id="commentform">
    7070<?php if ( $user_ID ) : ?>
    7171        <p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out &raquo;</a>'), get_edit_user_link(), $user_identity, wp_logout_url(get_permalink())); ?></p>
    7272<?php else : ?>