<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[12598] trunk: Introduce home_url().</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12598">12598</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-04 17:23:29 +0000 (Mon, 04 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Introduce home_url(). Props Denis-de-Bernardy, hakre. see <a href="http://trac.wordpress.org/ticket/9008">#9008</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpcontentthemesdefaultheaderphp">trunk/wp-content/themes/default/header.php</a></li>
<li><a href="#trunkwpincludesauthortemplatephp">trunk/wp-includes/author-template.php</a></li>
<li><a href="#trunkwpincludescanonicalphp">trunk/wp-includes/canonical.php</a></li>
<li><a href="#trunkwpincludescategorytemplatephp">trunk/wp-includes/category-template.php</a></li>
<li><a href="#trunkwpincludesclassesphp">trunk/wp-includes/classes.php</a></li>
<li><a href="#trunkwpincludescommenttemplatephp">trunk/wp-includes/comment-template.php</a></li>
<li><a href="#trunkwpincludescommentphp">trunk/wp-includes/comment.php</a></li>
<li><a href="#trunkwpincludesdefaultwidgetsphp">trunk/wp-includes/default-widgets.php</a></li>
<li><a href="#trunkwpincludesfeedatomcommentsphp">trunk/wp-includes/feed-atom-comments.php</a></li>
<li><a href="#trunkwpincludesfeedphp">trunk/wp-includes/feed.php</a></li>
<li><a href="#trunkwpincludesgeneraltemplatephp">trunk/wp-includes/general-template.php</a></li>
<li><a href="#trunkwpincludeslinktemplatephp">trunk/wp-includes/link-template.php</a></li>
<li><a href="#trunkwpincludespluggablephp">trunk/wp-includes/pluggable.php</a></li>
<li><a href="#trunkwpincludesposttemplatephp">trunk/wp-includes/post-template.php</a></li>
<li><a href="#trunkwpincludesrewritephp">trunk/wp-includes/rewrite.php</a></li>
<li><a href="#trunkwpincludestaxonomyphp">trunk/wp-includes/taxonomy.php</a></li>
<li><a href="#trunkwpincludesthemephp">trunk/wp-includes/theme.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpcontentthemesdefaultheaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/default/header.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/default/header.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-content/themes/default/header.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;div id=&quot;header&quot; role=&quot;banner&quot;&gt;
</span><span class="cx">         &lt;div id=&quot;headerimg&quot;&gt;
</span><del>-                &lt;h1&gt;&lt;a href=&quot;&lt;?php echo get_option('home'); ?&gt;/&quot;&gt;&lt;?php bloginfo('name'); ?&gt;&lt;/a&gt;&lt;/h1&gt;
</del><ins>+                &lt;h1&gt;&lt;a href=&quot;&lt;?php echo home_url(); ?&gt;/&quot;&gt;&lt;?php bloginfo('name'); ?&gt;&lt;/a&gt;&lt;/h1&gt;
</ins><span class="cx">                 &lt;div class=&quot;description&quot;&gt;&lt;?php bloginfo('description'); ?&gt;&lt;/div&gt;
</span><span class="cx">         &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span></span></pre></div>
<a id="trunkwpincludesauthortemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/author-template.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/author-template.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/author-template.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -209,7 +209,7 @@
</span><span class="cx">         $link = $wp_rewrite-&gt;get_author_permastruct();
</span><span class="cx"> 
</span><span class="cx">         if ( empty($link) ) {
</span><del>-                $file = get_option('home') . '/';
</del><ins>+                $file = home_url() . '/';
</ins><span class="cx">                 $link = $file . '?author=' . $auth_ID;
</span><span class="cx">         } else {
</span><span class="cx">                 if ( '' == $author_nicename ) {
</span><span class="lines">@@ -218,7 +218,7 @@
</span><span class="cx">                                 $author_nicename = $user-&gt;user_nicename;
</span><span class="cx">                 }
</span><span class="cx">                 $link = str_replace('%author%', $author_nicename, $link);
</span><del>-                $link = get_option('home') . trailingslashit($link);
</del><ins>+                $link = home_url() . trailingslashit($link);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         $link = apply_filters('author_link', $link, $author_id, $author_nicename);
</span></span></pre></div>
<a id="trunkwpincludescanonicalphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/canonical.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/canonical.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/canonical.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -198,7 +198,7 @@
</span><span class="cx">                 $redirect = @parse_url($redirect_url);
</span><span class="cx"> 
</span><span class="cx">         // www.example.com vs example.com
</span><del>-        $user_home = @parse_url(get_option('home'));
</del><ins>+        $user_home = @parse_url(home_url());
</ins><span class="cx">         if ( !empty($user_home['host']) )
</span><span class="cx">                 $redirect['host'] = $user_home['host'];
</span><span class="cx">         if ( empty($user_home['path']) )
</span></span></pre></div>
<a id="trunkwpincludescategorytemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/category-template.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/category-template.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/category-template.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -20,8 +20,7 @@
</span><span class="cx">         $catlink = $wp_rewrite-&gt;get_category_permastruct();
</span><span class="cx"> 
</span><span class="cx">         if ( empty( $catlink ) ) {
</span><del>-                $file = get_option( 'home' ) . '/';
-                $catlink = $file . '?cat=' . $category_id;
</del><ins>+                $catlink = home_url('?cat=' . $category_id);
</ins><span class="cx">         } else {
</span><span class="cx">                 $category = &amp;get_category( $category_id );
</span><span class="cx">                 if ( is_wp_error( $category ) )
</span><span class="lines">@@ -34,7 +33,7 @@
</span><span class="cx">                         $category_nicename = get_category_parents( $category-&gt;parent, false, '/', true ) . $category_nicename;
</span><span class="cx"> 
</span><span class="cx">                 $catlink = str_replace( '%category%', $category_nicename, $catlink );
</span><del>-                $catlink = get_option( 'home' ) . user_trailingslashit( $catlink, 'category' );
</del><ins>+                $catlink = home_url( user_trailingslashit( $catlink, 'category' ) );
</ins><span class="cx">         }
</span><span class="cx">         return apply_filters( 'category_link', $catlink, $category_id );
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpincludesclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/classes.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/classes.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/classes.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx">                         $req_uri_array = explode('?', $req_uri);
</span><span class="cx">                         $req_uri = $req_uri_array[0];
</span><span class="cx">                         $self = $_SERVER['PHP_SELF'];
</span><del>-                        $home_path = parse_url(get_option('home'));
</del><ins>+                        $home_path = parse_url(home_url());
</ins><span class="cx">                         if ( isset($home_path['path']) )
</span><span class="cx">                                 $home_path = $home_path['path'];
</span><span class="cx">                         else
</span></span></pre></div>
<a id="trunkwpincludescommenttemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/comment-template.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/comment-template.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/comment-template.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -967,7 +967,7 @@
</span><span class="cx">         echo '&lt;a href=&quot;';
</span><span class="cx">         if ( $wpcommentsjavascript ) {
</span><span class="cx">                 if ( empty( $wpcommentspopupfile ) )
</span><del>-                        $home = get_option('home');
</del><ins>+                        $home = home_url();
</ins><span class="cx">                 else
</span><span class="cx">                         $home = get_option('siteurl');
</span><span class="cx">                 echo $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id;
</span></span></pre></div>
<a id="trunkwpincludescommentphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/comment.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/comment.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/comment.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">                 if ( 'trackback' == $comment_type || 'pingback' == $comment_type ) { // check if domain is in blogroll
</span><span class="cx">                         $uri = parse_url($url);
</span><span class="cx">                         $domain = $uri['host'];
</span><del>-                        $uri = parse_url( get_option('home') );
</del><ins>+                        $uri = parse_url( home_url() );
</ins><span class="cx">                         $home_domain = $uri['host'];
</span><span class="cx">                         if ( $wpdb-&gt;get_var($wpdb-&gt;prepare(&quot;SELECT link_id FROM $wpdb-&gt;links WHERE link_url LIKE (%s) LIMIT 1&quot;, '%'.$domain.'%')) || $domain == $home_domain )
</span><span class="cx">                                 return true;
</span><span class="lines">@@ -1819,7 +1819,7 @@
</span><span class="cx"> 
</span><span class="cx">         // when set to true, this outputs debug messages by itself
</span><span class="cx">         $client-&gt;debug = false;
</span><del>-        $home = trailingslashit( get_option('home') );
</del><ins>+        $home = trailingslashit( home_url() );
</ins><span class="cx">         if ( !$client-&gt;query('weblogUpdates.extendedPing', get_option('blogname'), $home, get_bloginfo('rss2_url') ) ) // then try a normal ping
</span><span class="cx">                 $client-&gt;query('weblogUpdates.ping', get_option('blogname'), $home);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpincludesdefaultwidgetsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/default-widgets.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/default-widgets.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/default-widgets.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -447,7 +447,7 @@
</span><span class="cx">         var dropdown = document.getElementById(&quot;cat&quot;);
</span><span class="cx">         function onCatChange() {
</span><span class="cx">                 if ( dropdown.options[dropdown.selectedIndex].value &gt; 0 ) {
</span><del>-                        location.href = &quot;&lt;?php echo get_option('home'); ?&gt;/?cat=&quot;+dropdown.options[dropdown.selectedIndex].value;
</del><ins>+                        location.href = &quot;&lt;?php echo home_url(); ?&gt;/?cat=&quot;+dropdown.options[dropdown.selectedIndex].value;
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">         dropdown.onchange = onCatChange;
</span></span></pre></div>
<a id="trunkwpincludesfeedatomcommentsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/feed-atom-comments.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/feed-atom-comments.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/feed-atom-comments.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">         &lt;link rel=&quot;self&quot; type=&quot;application/atom+xml&quot; href=&quot;&lt;?php echo get_post_comments_feed_link('', 'atom'); ?&gt;&quot; /&gt;
</span><span class="cx">         &lt;id&gt;&lt;?php echo get_post_comments_feed_link('', 'atom'); ?&gt;&lt;/id&gt;
</span><span class="cx"> &lt;?php } elseif(is_search()) { ?&gt;
</span><del>-        &lt;link rel=&quot;alternate&quot; type=&quot;&lt;?php bloginfo_rss('html_type'); ?&gt;&quot; href=&quot;&lt;?php echo get_option('home') . '?s=' . esc_attr(get_search_query()); ?&gt;&quot; /&gt;
</del><ins>+        &lt;link rel=&quot;alternate&quot; type=&quot;&lt;?php bloginfo_rss('html_type'); ?&gt;&quot; href=&quot;&lt;?php echo home_url() . '?s=' . esc_attr(get_search_query()); ?&gt;&quot; /&gt;
</ins><span class="cx">         &lt;link rel=&quot;self&quot; type=&quot;application/atom+xml&quot; href=&quot;&lt;?php echo get_search_comments_feed_link('', 'atom'); ?&gt;&quot; /&gt;
</span><span class="cx">         &lt;id&gt;&lt;?php echo get_search_comments_feed_link('', 'atom'); ?&gt;&lt;/id&gt;
</span><span class="cx"> &lt;?php } else { ?&gt;
</span></span></pre></div>
<a id="trunkwpincludesfeedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/feed.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/feed.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/feed.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -475,7 +475,7 @@
</span><span class="cx">  * @since 2.5
</span><span class="cx">  */
</span><span class="cx"> function self_link() {
</span><del>-        $host = @parse_url(get_option('home'));
</del><ins>+        $host = @parse_url(home_url());
</ins><span class="cx">         $host = $host['host'];
</span><span class="cx">         echo esc_url(
</span><span class="cx">                 'http'
</span></span></pre></div>
<a id="trunkwpincludesgeneraltemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/general-template.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/general-template.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/general-template.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        $form = '&lt;form role=&quot;search&quot; method=&quot;get&quot; id=&quot;searchform&quot; action=&quot;' . get_option('home') . '/&quot; &gt;
</del><ins>+        $form = '&lt;form role=&quot;search&quot; method=&quot;get&quot; id=&quot;searchform&quot; action=&quot;' . home_url() . '/&quot; &gt;
</ins><span class="cx">         &lt;div&gt;&lt;label class=&quot;screen-reader-text&quot; for=&quot;s&quot;&gt;' . __('Search for:') . '&lt;/label&gt;
</span><span class="cx">         &lt;input type=&quot;text&quot; value=&quot;' . esc_attr(apply_filters('the_search_query', get_search_query())) . '&quot; name=&quot;s&quot; id=&quot;s&quot; /&gt;
</span><span class="cx">         &lt;input type=&quot;submit&quot; id=&quot;searchsubmit&quot; value=&quot;'. esc_attr__('Search') .'&quot; /&gt;
</span><span class="lines">@@ -301,7 +301,7 @@
</span><span class="cx">                 case 'siteurl' : // DEPRECATED
</span><span class="cx">                         _deprecated_argument( __FUNCTION__, '2.2', sprintf( __('The \'%1$s\' option is deprecated for the family of bloginfo() functions. Use the \'%2$s\' option instead.'), $show, 'url' ) );
</span><span class="cx">                 case 'url' :
</span><del>-                        $output = get_option('home');
</del><ins>+                        $output = home_url();
</ins><span class="cx">                         break;
</span><span class="cx">                 case 'wpurl' :
</span><span class="cx">                         $output = get_option('siteurl');
</span><span class="lines">@@ -886,7 +886,7 @@
</span><span class="cx">                                                 $arc_week = get_weekstartend($arcresult-&gt;yyyymmdd, get_option('start_of_week'));
</span><span class="cx">                                                 $arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']);
</span><span class="cx">                                                 $arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']);
</span><del>-                                                $url  = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', get_option('home'), '', '?', '=', $arc_year, '&amp;amp;', '=', $arcresult-&gt;week);
</del><ins>+                                                $url  = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', home_url(), '', '?', '=', $arc_year, '&amp;amp;', '=', $arcresult-&gt;week);
</ins><span class="cx">                                                 $text = $arc_week_start . $archive_week_separator . $arc_week_end;
</span><span class="cx">                                                 if ($show_post_count)
</span><span class="cx">                                                         $after = '&amp;nbsp;('.$arcresult-&gt;posts.')'.$afterafter;
</span></span></pre></div>
<a id="trunkwpincludeslinktemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/link-template.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/link-template.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/link-template.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -150,11 +150,11 @@
</span><span class="cx">                         $author,
</span><span class="cx">                         $post-&gt;post_name,
</span><span class="cx">                 );
</span><del>-                $permalink = get_option('home') . str_replace($rewritecode, $rewritereplace, $permalink);
</del><ins>+                $permalink = home_url( str_replace($rewritecode, $rewritereplace, $permalink) );
</ins><span class="cx">                 $permalink = user_trailingslashit($permalink, 'single');
</span><span class="cx">                 return apply_filters('post_link', $permalink, $post, $leavename);
</span><span class="cx">         } else { // if they're not using the fancy permalink option
</span><del>-                $permalink = trailingslashit(get_option('home')) . '?p=' . $post-&gt;ID;
</del><ins>+                $permalink = home_url('?p=' . $post-&gt;ID);
</ins><span class="cx">                 return apply_filters('post_link', $permalink, $post, $leavename);
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx">                 $id = (int) $post-&gt;ID;
</span><span class="cx"> 
</span><span class="cx">         if ( 'page' == get_option('show_on_front') &amp;&amp; $id == get_option('page_on_front') )
</span><del>-                $link = get_option('home');
</del><ins>+                $link = home_url();
</ins><span class="cx">         else
</span><span class="cx">                 $link = _get_page_link( $id , $leavename, $sample );
</span><span class="cx"> 
</span><span class="lines">@@ -228,10 +228,10 @@
</span><span class="cx">         if ( '' != $pagestruct &amp;&amp; ( ( isset($post-&gt;post_status) &amp;&amp; 'draft' != $post-&gt;post_status &amp;&amp; 'pending' != $post-&gt;post_status ) || $sample ) ) {
</span><span class="cx">                 $link = get_page_uri($id);
</span><span class="cx">                 $link = ( $leavename ) ? $pagestruct : str_replace('%pagename%', $link, $pagestruct);
</span><del>-                $link = trailingslashit(get_option('home')) . $link;
</del><ins>+                $link = home_url($link);
</ins><span class="cx">                 $link = user_trailingslashit($link, 'page');
</span><span class="cx">         } else {
</span><del>-                $link = trailingslashit(get_option('home')) . &quot;?page_id=$id&quot;;
</del><ins>+                $link = home_url(&quot;?page_id=$id&quot;);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         return apply_filters( '_get_page_link', $link, $id );
</span><span class="lines">@@ -293,9 +293,9 @@
</span><span class="cx">         $yearlink = $wp_rewrite-&gt;get_year_permastruct();
</span><span class="cx">         if ( !empty($yearlink) ) {
</span><span class="cx">                 $yearlink = str_replace('%year%', $year, $yearlink);
</span><del>-                return apply_filters('year_link', get_option('home') . user_trailingslashit($yearlink, 'year'), $year);
</del><ins>+                return apply_filters('year_link', home_url( user_trailingslashit($yearlink, 'year') ), $year);
</ins><span class="cx">         } else {
</span><del>-                return apply_filters('year_link', trailingslashit(get_option('home')) . '?m=' . $year, $year);
</del><ins>+                return apply_filters('year_link', home_url('?m=' . $year), $year);
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -318,9 +318,9 @@
</span><span class="cx">         if ( !empty($monthlink) ) {
</span><span class="cx">                 $monthlink = str_replace('%year%', $year, $monthlink);
</span><span class="cx">                 $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink);
</span><del>-                return apply_filters('month_link', get_option('home') . user_trailingslashit($monthlink, 'month'), $year, $month);
</del><ins>+                return apply_filters('month_link', home_url( user_trailingslashit($monthlink, 'month') ), $year, $month);
</ins><span class="cx">         } else {
</span><del>-                return apply_filters('month_link', trailingslashit(get_option('home')) . '?m=' . $year . zeroise($month, 2), $year, $month);
</del><ins>+                return apply_filters('month_link', home_url( '?m=' . $year . zeroise($month, 2) ), $year, $month);
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -348,9 +348,9 @@
</span><span class="cx">                 $daylink = str_replace('%year%', $year, $daylink);
</span><span class="cx">                 $daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink);
</span><span class="cx">                 $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink);
</span><del>-                return apply_filters('day_link', get_option('home') . user_trailingslashit($daylink, 'day'), $year, $month, $day);
</del><ins>+                return apply_filters('day_link', home_url( user_trailingslashit($daylink, 'day') ), $year, $month, $day);
</ins><span class="cx">         } else {
</span><del>-                return apply_filters('day_link', trailingslashit(get_option('home')) . '?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day);
</del><ins>+                return apply_filters('day_link', home_url( '?m=' . $year . zeroise($month, 2) . zeroise($day, 2) ), $year, $month, $day);
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -377,7 +377,7 @@
</span><span class="cx"> 
</span><span class="cx">                 $permalink = str_replace('%feed%', $feed, $permalink);
</span><span class="cx">                 $permalink = preg_replace('#/+#', '/', &quot;/$permalink&quot;);
</span><del>-                $output =  get_option('home') . user_trailingslashit($permalink, 'feed');
</del><ins>+                $output =  home_url( user_trailingslashit($permalink, 'feed') );
</ins><span class="cx">         } else {
</span><span class="cx">                 if ( empty($feed) )
</span><span class="cx">                         $feed = get_default_feed();
</span><span class="lines">@@ -385,7 +385,7 @@
</span><span class="cx">                 if ( false !== strpos($feed, 'comments_') )
</span><span class="cx">                         $feed = str_replace('comments_', 'comments-', $feed);
</span><span class="cx"> 
</span><del>-                $output = trailingslashit(get_option('home')) . &quot;?feed={$feed}&quot;;
</del><ins>+                $output = home_url(&quot;?feed={$feed}&quot;);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         return apply_filters('feed_link', $output, $feed);
</span><span class="lines">@@ -417,9 +417,9 @@
</span><span class="cx">         } else {
</span><span class="cx">                 $type = get_post_field('post_type', $post_id);
</span><span class="cx">                 if ( 'page' == $type )
</span><del>-                        $url = trailingslashit(get_option('home')) . &quot;?feed=$feed&amp;amp;page_id=$post_id&quot;;
</del><ins>+                        $url = home_url(&quot;?feed=$feed&amp;amp;page_id=$post_id&quot;);
</ins><span class="cx">                 else
</span><del>-                        $url = trailingslashit(get_option('home')) . &quot;?feed=$feed&amp;amp;p=$post_id&quot;;
</del><ins>+                        $url = home_url(&quot;?feed=$feed&amp;amp;p=$post_id&quot;);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         return apply_filters('post_comments_feed_link', $url);
</span><span class="lines">@@ -471,7 +471,7 @@
</span><span class="cx">                 $feed = get_default_feed();
</span><span class="cx"> 
</span><span class="cx">         if ( '' == $permalink_structure ) {
</span><del>-                $link = trailingslashit(get_option('home')) . &quot;?feed=$feed&amp;amp;author=&quot; . $author_id;
</del><ins>+                $link = home_url(&quot;?feed=$feed&amp;amp;author=&quot; . $author_id);
</ins><span class="cx">         } else {
</span><span class="cx">                 $link = get_author_posts_url($author_id);
</span><span class="cx">                 if ( $feed == get_default_feed() )
</span><span class="lines">@@ -515,7 +515,7 @@
</span><span class="cx">         $permalink_structure = get_option('permalink_structure');
</span><span class="cx"> 
</span><span class="cx">         if ( '' == $permalink_structure ) {
</span><del>-                $link = trailingslashit(get_option('home')) . &quot;?feed=$feed&amp;amp;cat=&quot; . $cat_id;
</del><ins>+                $link = home_url(&quot;?feed=$feed&amp;amp;cat=&quot; . $cat_id);
</ins><span class="cx">         } else {
</span><span class="cx">                 $link = get_category_link($cat_id);
</span><span class="cx">                 if( $feed == get_default_feed() )
</span><span class="lines">@@ -554,7 +554,7 @@
</span><span class="cx">                 $feed = get_default_feed();
</span><span class="cx"> 
</span><span class="cx">         if ( '' == $permalink_structure ) {
</span><del>-                $link = trailingslashit(get_option('home')) . &quot;?feed=$feed&amp;amp;tag=&quot; . $tag-&gt;slug;
</del><ins>+                $link = home_url(&quot;?feed=$feed&amp;amp;tag=&quot; . $tag-&gt;slug);
</ins><span class="cx">         } else {
</span><span class="cx">                 $link = get_tag_link($tag-&gt;term_id);
</span><span class="cx">                 if ( $feed == get_default_feed() )
</span><span class="lines">@@ -629,7 +629,7 @@
</span><span class="cx">         if ( empty($feed) )
</span><span class="cx">                 $feed = get_default_feed();
</span><span class="cx"> 
</span><del>-        $link = trailingslashit(get_option('home')) . &quot;?s=$search&amp;amp;feed=$feed&quot;;
</del><ins>+        $link = home_url(&quot;?s=$search&amp;amp;feed=$feed&quot;);
</ins><span class="cx"> 
</span><span class="cx">         $link = apply_filters('search_feed_link', $link);
</span><span class="cx"> 
</span><span class="lines">@@ -654,7 +654,7 @@
</span><span class="cx">         if ( empty($feed) )
</span><span class="cx">                 $feed = get_default_feed();
</span><span class="cx"> 
</span><del>-        $link = trailingslashit(get_option('home')) . &quot;?s=$search&amp;amp;feed=comments-$feed&quot;;
</del><ins>+        $link = home_url(&quot;?s=$search&amp;amp;feed=comments-$feed&quot;);
</ins><span class="cx"> 
</span><span class="cx">         $link = apply_filters('search_feed_link', $link);
</span><span class="cx"> 
</span><span class="lines">@@ -1275,7 +1275,7 @@
</span><span class="cx"> 
</span><span class="cx">         $request = remove_query_arg( 'paged' );
</span><span class="cx"> 
</span><del>-        $home_root = parse_url(get_option('home'));
</del><ins>+        $home_root = parse_url(home_url());
</ins><span class="cx">         $home_root = ( isset($home_root['path']) ) ? $home_root['path'] : '';
</span><span class="cx">         $home_root = preg_quote( trailingslashit( $home_root ), '|' );
</span><span class="cx"> 
</span><span class="lines">@@ -1709,6 +1709,31 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * Retrieve the home url.
+ *
+ * Returns the 'home' option with the appropriate protocol,  'https' if
+ * is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is
+ * overridden.
+ *
+ * @package WordPress
+ * @since 3.0
+ *
+ * @param  string $path   (optional) Path relative to the home url.
+ * @param  string $scheme (optional) Scheme to give the home url context. Currently 'http','https'
+ * @return string Home url link with optional path appended.
+*/
+function home_url( $path = '', $scheme = null ) {
+        $orig_scheme = $scheme;
+        $scheme      = is_ssl() &amp;&amp; !is_admin() ? 'https' : 'http';
+        $url = str_replace( 'http://', &quot;$scheme://&quot;, get_option('home') );
+
+        if ( !empty( $path ) &amp;&amp; is_string( $path ) &amp;&amp; strpos( $path, '..' ) === false )
+                $url .= '/' . ltrim( $path, '/' );
+
+        return apply_filters( 'home_url', $url, $path, $orig_scheme );
+}
+
+/**
</ins><span class="cx">  * Retrieve the site url.
</span><span class="cx">  *
</span><span class="cx">  * Returns the 'site_url' option with the appropriate protocol,  'https' if
</span></span></pre></div>
<a id="trunkwpincludespluggablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/pluggable.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/pluggable.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/pluggable.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -944,7 +944,7 @@
</span><span class="cx">         $test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location;
</span><span class="cx"> 
</span><span class="cx">         $lp  = parse_url($test);
</span><del>-        $wpp = parse_url(get_option('home'));
</del><ins>+        $wpp = parse_url(home_url());
</ins><span class="cx"> 
</span><span class="cx">         $allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '');
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludesposttemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post-template.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post-template.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/post-template.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -822,7 +822,7 @@
</span><span class="cx">                 $class = '';
</span><span class="cx">                 if ( is_front_page() &amp;&amp; !is_paged() )
</span><span class="cx">                         $class = 'class=&quot;current_page_item&quot;';
</span><del>-                $menu .= '&lt;li ' . $class . '&gt;&lt;a href=&quot;' . get_option('home') . '&quot; title=&quot;' . esc_attr($text) . '&quot;&gt;' . $args['link_before'] . $text . $args['link_after'] . '&lt;/a&gt;&lt;/li&gt;';
</del><ins>+                $menu .= '&lt;li ' . $class . '&gt;&lt;a href=&quot;' . home_url() . '&quot; title=&quot;' . esc_attr($text) . '&quot;&gt;' . $args['link_before'] . $text . $args['link_after'] . '&lt;/a&gt;&lt;/li&gt;';
</ins><span class="cx">                 // If the front page is a page, add it to the exclude list
</span><span class="cx">                 if (get_option('show_on_front') == 'page') {
</span><span class="cx">                         if ( !empty( $list_args['exclude'] ) ) {
</span></span></pre></div>
<a id="trunkwpincludesrewritephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/rewrite.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/rewrite.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/rewrite.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -256,23 +256,23 @@
</span><span class="cx">         $url = $url_split[0];
</span><span class="cx"> 
</span><span class="cx">         // Add 'www.' if it is absent and should be there
</span><del>-        if ( false !== strpos(get_option('home'), '://www.') &amp;&amp; false === strpos($url, '://www.') )
</del><ins>+        if ( false !== strpos(home_url(), '://www.') &amp;&amp; false === strpos($url, '://www.') )
</ins><span class="cx">                 $url = str_replace('://', '://www.', $url);
</span><span class="cx"> 
</span><span class="cx">         // Strip 'www.' if it is present and shouldn't be
</span><del>-        if ( false === strpos(get_option('home'), '://www.') )
</del><ins>+        if ( false === strpos(home_url(), '://www.') )
</ins><span class="cx">                 $url = str_replace('://www.', '://', $url);
</span><span class="cx"> 
</span><span class="cx">         // Strip 'index.php/' if we're not using path info permalinks
</span><span class="cx">         if ( !$wp_rewrite-&gt;using_index_permalinks() )
</span><span class="cx">                 $url = str_replace('index.php/', '', $url);
</span><span class="cx"> 
</span><del>-        if ( false !== strpos($url, get_option('home')) ) {
</del><ins>+        if ( false !== strpos($url, home_url()) ) {
</ins><span class="cx">                 // Chop off http://domain.com
</span><del>-                $url = str_replace(get_option('home'), '', $url);
</del><ins>+                $url = str_replace(home_url(), '', $url);
</ins><span class="cx">         } else {
</span><span class="cx">                 // Chop off /path/to/blog
</span><del>-                $home_path = parse_url(get_option('home'));
</del><ins>+                $home_path = parse_url(home_url());
</ins><span class="cx">                 $home_path = $home_path['path'];
</span><span class="cx">                 $url = str_replace($home_path, '', $url);
</span><span class="cx">         }
</span><span class="lines">@@ -1645,7 +1645,7 @@
</span><span class="cx">                         $site_root = trailingslashit($site_root['path']);
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                $home_root = parse_url(get_option('home'));
</del><ins>+                $home_root = parse_url(home_url());
</ins><span class="cx">                 if ( isset( $home_root['path'] ) ) {
</span><span class="cx">                         $home_root = trailingslashit($home_root['path']);
</span><span class="cx">                 } else {
</span></span></pre></div>
<a id="trunkwpincludestaxonomyphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/taxonomy.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/taxonomy.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/taxonomy.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -2246,15 +2246,15 @@
</span><span class="cx">         $slug = $term-&gt;slug;
</span><span class="cx"> 
</span><span class="cx">         if ( empty($termlink) ) {
</span><del>-                $file = trailingslashit( get_option('home') );
</del><span class="cx">                 $t = get_taxonomy($taxonomy);
</span><span class="cx">                 if ( $t-&gt;query_var )
</span><del>-                        $termlink = &quot;$file?$t-&gt;query_var=$slug&quot;;
</del><ins>+                        $termlink = &quot;?$t-&gt;query_var=$slug&quot;;
</ins><span class="cx">                 else
</span><del>-                        $termlink = &quot;$file?taxonomy=$taxonomy&amp;term=$slug&quot;;
</del><ins>+                        $termlink = &quot;?taxonomy=$taxonomy&amp;term=$slug&quot;;
+                $termlink = home_url($termlink);
</ins><span class="cx">         } else {
</span><span class="cx">                 $termlink = str_replace(&quot;%$taxonomy%&quot;, $slug, $termlink);
</span><del>-                $termlink = get_option('home') . user_trailingslashit($termlink, 'category');
</del><ins>+                $termlink = home_url( user_trailingslashit($termlink, 'category') );
</ins><span class="cx">         }
</span><span class="cx">         return apply_filters('term_link', $termlink, $term, $taxonomy);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpincludesthemephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/theme.php (12597 => 12598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/theme.php        2010-01-04 16:58:43 UTC (rev 12597)
+++ trunk/wp-includes/theme.php        2010-01-04 17:23:29 UTC (rev 12598)
</span><span class="lines">@@ -1098,7 +1098,7 @@
</span><span class="cx">         if (
</span><span class="cx">                 ( false !== strpos($matches[3], '/wp-admin/') )
</span><span class="cx">         ||
</span><del>-                ( false !== strpos($matches[3], '://') &amp;&amp; 0 !== strpos($matches[3], get_option('home')) )
</del><ins>+                ( false !== strpos( $matches[3], '://' ) &amp;&amp; 0 !== strpos( $matches[3], home_url() ) )
</ins><span class="cx">         ||
</span><span class="cx">                 ( false !== strpos($matches[3], '/feed/') )
</span><span class="cx">         ||
</span></span></pre>
</div>
</div>

</body>
</html>