Changeset 12598
- Timestamp:
- 01/04/2010 05:23:29 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/default/header.php
r10949 r12598 39 39 <div id="header" role="banner"> 40 40 <div id="headerimg"> 41 <h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>41 <h1><a href="<?php echo home_url(); ?>/"><?php bloginfo('name'); ?></a></h1> 42 42 <div class="description"><?php bloginfo('description'); ?></div> 43 43 </div> -
trunk/wp-includes/author-template.php
r12584 r12598 210 210 211 211 if ( empty($link) ) { 212 $file = get_option('home') . '/';212 $file = home_url() . '/'; 213 213 $link = $file . '?author=' . $auth_ID; 214 214 } else { … … 219 219 } 220 220 $link = str_replace('%author%', $author_nicename, $link); 221 $link = get_option('home') . trailingslashit($link);221 $link = home_url() . trailingslashit($link); 222 222 } 223 223 -
trunk/wp-includes/canonical.php
r12202 r12598 199 199 200 200 // www.example.com vs example.com 201 $user_home = @parse_url( get_option('home'));201 $user_home = @parse_url(home_url()); 202 202 if ( !empty($user_home['host']) ) 203 203 $redirect['host'] = $user_home['host']; -
trunk/wp-includes/category-template.php
r12319 r12598 21 21 22 22 if ( empty( $catlink ) ) { 23 $file = get_option( 'home' ) . '/'; 24 $catlink = $file . '?cat=' . $category_id; 23 $catlink = home_url('?cat=' . $category_id); 25 24 } else { 26 25 $category = &get_category( $category_id ); … … 35 34 36 35 $catlink = str_replace( '%category%', $category_nicename, $catlink ); 37 $catlink = get_option( 'home' ) . user_trailingslashit( $catlink, 'category');36 $catlink = home_url( user_trailingslashit( $catlink, 'category' ) ); 38 37 } 39 38 return apply_filters( 'category_link', $catlink, $category_id ); -
trunk/wp-includes/classes.php
r11930 r12598 160 160 $req_uri = $req_uri_array[0]; 161 161 $self = $_SERVER['PHP_SELF']; 162 $home_path = parse_url( get_option('home'));162 $home_path = parse_url(home_url()); 163 163 if ( isset($home_path['path']) ) 164 164 $home_path = $home_path['path']; -
trunk/wp-includes/comment-template.php
r12586 r12598 968 968 if ( $wpcommentsjavascript ) { 969 969 if ( empty( $wpcommentspopupfile ) ) 970 $home = get_option('home');970 $home = home_url(); 971 971 else 972 972 $home = get_option('siteurl'); -
trunk/wp-includes/comment.php
r12584 r12598 79 79 $uri = parse_url($url); 80 80 $domain = $uri['host']; 81 $uri = parse_url( get_option('home') );81 $uri = parse_url( home_url() ); 82 82 $home_domain = $uri['host']; 83 83 if ( $wpdb->get_var($wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_url LIKE (%s) LIMIT 1", '%'.$domain.'%')) || $domain == $home_domain ) … … 1820 1820 // when set to true, this outputs debug messages by itself 1821 1821 $client->debug = false; 1822 $home = trailingslashit( get_option('home') );1822 $home = trailingslashit( home_url() ); 1823 1823 if ( !$client->query('weblogUpdates.extendedPing', get_option('blogname'), $home, get_bloginfo('rss2_url') ) ) // then try a normal ping 1824 1824 $client->query('weblogUpdates.ping', get_option('blogname'), $home); -
trunk/wp-includes/default-widgets.php
r12475 r12598 448 448 function onCatChange() { 449 449 if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { 450 location.href = "<?php echo get_option('home'); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;450 location.href = "<?php echo home_url(); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value; 451 451 } 452 452 } -
trunk/wp-includes/feed-atom-comments.php
r12587 r12598 33 33 <id><?php echo get_post_comments_feed_link('', 'atom'); ?></id> 34 34 <?php } elseif(is_search()) { ?> 35 <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo get_option('home') . '?s=' . esc_attr(get_search_query()); ?>" />35 <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo home_url() . '?s=' . esc_attr(get_search_query()); ?>" /> 36 36 <link rel="self" type="application/atom+xml" href="<?php echo get_search_comments_feed_link('', 'atom'); ?>" /> 37 37 <id><?php echo get_search_comments_feed_link('', 'atom'); ?></id> -
trunk/wp-includes/feed.php
r12484 r12598 476 476 */ 477 477 function self_link() { 478 $host = @parse_url( get_option('home'));478 $host = @parse_url(home_url()); 479 479 $host = $host['host']; 480 480 echo esc_url( -
trunk/wp-includes/general-template.php
r12590 r12598 122 122 } 123 123 124 $form = '<form role="search" method="get" id="searchform" action="' . get_option('home') . '/" >124 $form = '<form role="search" method="get" id="searchform" action="' . home_url() . '/" > 125 125 <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label> 126 126 <input type="text" value="' . esc_attr(apply_filters('the_search_query', get_search_query())) . '" name="s" id="s" /> … … 302 302 _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' ) ); 303 303 case 'url' : 304 $output = get_option('home');304 $output = home_url(); 305 305 break; 306 306 case 'wpurl' : … … 887 887 $arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']); 888 888 $arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']); 889 $url = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', get_option('home'), '', '?', '=', $arc_year, '&', '=', $arcresult->week);889 $url = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', home_url(), '', '?', '=', $arc_year, '&', '=', $arcresult->week); 890 890 $text = $arc_week_start . $archive_week_separator . $arc_week_end; 891 891 if ($show_post_count) -
trunk/wp-includes/link-template.php
r12597 r12598 151 151 $post->post_name, 152 152 ); 153 $permalink = get_option('home') . str_replace($rewritecode, $rewritereplace, $permalink);153 $permalink = home_url( str_replace($rewritecode, $rewritereplace, $permalink) ); 154 154 $permalink = user_trailingslashit($permalink, 'single'); 155 155 return apply_filters('post_link', $permalink, $post, $leavename); 156 156 } else { // if they're not using the fancy permalink option 157 $permalink = trailingslashit(get_option('home')) . '?p=' . $post->ID;157 $permalink = home_url('?p=' . $post->ID); 158 158 return apply_filters('post_link', $permalink, $post, $leavename); 159 159 } … … 196 196 197 197 if ( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) 198 $link = get_option('home');198 $link = home_url(); 199 199 else 200 200 $link = _get_page_link( $id , $leavename, $sample ); … … 229 229 $link = get_page_uri($id); 230 230 $link = ( $leavename ) ? $pagestruct : str_replace('%pagename%', $link, $pagestruct); 231 $link = trailingslashit(get_option('home')) . $link;231 $link = home_url($link); 232 232 $link = user_trailingslashit($link, 'page'); 233 233 } else { 234 $link = trailingslashit(get_option('home')) . "?page_id=$id";234 $link = home_url("?page_id=$id"); 235 235 } 236 236 … … 294 294 if ( !empty($yearlink) ) { 295 295 $yearlink = str_replace('%year%', $year, $yearlink); 296 return apply_filters('year_link', get_option('home') . user_trailingslashit($yearlink, 'year'), $year);296 return apply_filters('year_link', home_url( user_trailingslashit($yearlink, 'year') ), $year); 297 297 } else { 298 return apply_filters('year_link', trailingslashit(get_option('home')) . '?m=' . $year, $year);298 return apply_filters('year_link', home_url('?m=' . $year), $year); 299 299 } 300 300 } … … 319 319 $monthlink = str_replace('%year%', $year, $monthlink); 320 320 $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink); 321 return apply_filters('month_link', get_option('home') . user_trailingslashit($monthlink, 'month'), $year, $month);321 return apply_filters('month_link', home_url( user_trailingslashit($monthlink, 'month') ), $year, $month); 322 322 } else { 323 return apply_filters('month_link', trailingslashit(get_option('home')) . '?m=' . $year . zeroise($month, 2), $year, $month);323 return apply_filters('month_link', home_url( '?m=' . $year . zeroise($month, 2) ), $year, $month); 324 324 } 325 325 } … … 349 349 $daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink); 350 350 $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink); 351 return apply_filters('day_link', get_option('home') . user_trailingslashit($daylink, 'day'), $year, $month, $day);351 return apply_filters('day_link', home_url( user_trailingslashit($daylink, 'day') ), $year, $month, $day); 352 352 } else { 353 return apply_filters('day_link', trailingslashit(get_option('home')) . '?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day);353 return apply_filters('day_link', home_url( '?m=' . $year . zeroise($month, 2) . zeroise($day, 2) ), $year, $month, $day); 354 354 } 355 355 } … … 378 378 $permalink = str_replace('%feed%', $feed, $permalink); 379 379 $permalink = preg_replace('#/+#', '/', "/$permalink"); 380 $output = get_option('home') . user_trailingslashit($permalink, 'feed');380 $output = home_url( user_trailingslashit($permalink, 'feed') ); 381 381 } else { 382 382 if ( empty($feed) ) … … 386 386 $feed = str_replace('comments_', 'comments-', $feed); 387 387 388 $output = trailingslashit(get_option('home')) . "?feed={$feed}";388 $output = home_url("?feed={$feed}"); 389 389 } 390 390 … … 418 418 $type = get_post_field('post_type', $post_id); 419 419 if ( 'page' == $type ) 420 $url = trailingslashit(get_option('home')) . "?feed=$feed&page_id=$post_id";420 $url = home_url("?feed=$feed&page_id=$post_id"); 421 421 else 422 $url = trailingslashit(get_option('home')) . "?feed=$feed&p=$post_id";422 $url = home_url("?feed=$feed&p=$post_id"); 423 423 } 424 424 … … 472 472 473 473 if ( '' == $permalink_structure ) { 474 $link = trailingslashit(get_option('home')) . "?feed=$feed&author=" . $author_id;474 $link = home_url("?feed=$feed&author=" . $author_id); 475 475 } else { 476 476 $link = get_author_posts_url($author_id); … … 516 516 517 517 if ( '' == $permalink_structure ) { 518 $link = trailingslashit(get_option('home')) . "?feed=$feed&cat=" . $cat_id;518 $link = home_url("?feed=$feed&cat=" . $cat_id); 519 519 } else { 520 520 $link = get_category_link($cat_id); … … 555 555 556 556 if ( '' == $permalink_structure ) { 557 $link = trailingslashit(get_option('home')) . "?feed=$feed&tag=" . $tag->slug;557 $link = home_url("?feed=$feed&tag=" . $tag->slug); 558 558 } else { 559 559 $link = get_tag_link($tag->term_id); … … 630 630 $feed = get_default_feed(); 631 631 632 $link = trailingslashit(get_option('home')) . "?s=$search&feed=$feed";632 $link = home_url("?s=$search&feed=$feed"); 633 633 634 634 $link = apply_filters('search_feed_link', $link); … … 655 655 $feed = get_default_feed(); 656 656 657 $link = trailingslashit(get_option('home')) . "?s=$search&feed=comments-$feed";657 $link = home_url("?s=$search&feed=comments-$feed"); 658 658 659 659 $link = apply_filters('search_feed_link', $link); … … 1276 1276 $request = remove_query_arg( 'paged' ); 1277 1277 1278 $home_root = parse_url( get_option('home'));1278 $home_root = parse_url(home_url()); 1279 1279 $home_root = ( isset($home_root['path']) ) ? $home_root['path'] : ''; 1280 1280 $home_root = preg_quote( trailingslashit( $home_root ), '|' ); … … 1707 1707 1708 1708 return apply_filters('shortcut_link', $link); 1709 } 1710 1711 /** 1712 * Retrieve the home url. 1713 * 1714 * Returns the 'home' option with the appropriate protocol, 'https' if 1715 * is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is 1716 * overridden. 1717 * 1718 * @package WordPress 1719 * @since 3.0 1720 * 1721 * @param string $path (optional) Path relative to the home url. 1722 * @param string $scheme (optional) Scheme to give the home url context. Currently 'http','https' 1723 * @return string Home url link with optional path appended. 1724 */ 1725 function home_url( $path = '', $scheme = null ) { 1726 $orig_scheme = $scheme; 1727 $scheme = is_ssl() && !is_admin() ? 'https' : 'http'; 1728 $url = str_replace( 'http://', "$scheme://", get_option('home') ); 1729 1730 if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false ) 1731 $url .= '/' . ltrim( $path, '/' ); 1732 1733 return apply_filters( 'home_url', $url, $path, $orig_scheme ); 1709 1734 } 1710 1735 -
trunk/wp-includes/pluggable.php
r12408 r12598 945 945 946 946 $lp = parse_url($test); 947 $wpp = parse_url( get_option('home'));947 $wpp = parse_url(home_url()); 948 948 949 949 $allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : ''); -
trunk/wp-includes/post-template.php
r12584 r12598 823 823 if ( is_front_page() && !is_paged() ) 824 824 $class = 'class="current_page_item"'; 825 $menu .= '<li ' . $class . '><a href="' . get_option('home') . '" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';825 $menu .= '<li ' . $class . '><a href="' . home_url() . '" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>'; 826 826 // If the front page is a page, add it to the exclude list 827 827 if (get_option('show_on_front') == 'page') { -
trunk/wp-includes/rewrite.php
r12520 r12598 257 257 258 258 // 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.') ) 260 260 $url = str_replace('://', '://www.', $url); 261 261 262 262 // 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.') ) 264 264 $url = str_replace('://www.', '://', $url); 265 265 … … 268 268 $url = str_replace('index.php/', '', $url); 269 269 270 if ( false !== strpos($url, get_option('home')) ) {270 if ( false !== strpos($url, home_url()) ) { 271 271 // Chop off http://domain.com 272 $url = str_replace( get_option('home'), '', $url);272 $url = str_replace(home_url(), '', $url); 273 273 } else { 274 274 // Chop off /path/to/blog 275 $home_path = parse_url( get_option('home'));275 $home_path = parse_url(home_url()); 276 276 $home_path = $home_path['path']; 277 277 $url = str_replace($home_path, '', $url); … … 1646 1646 } 1647 1647 1648 $home_root = parse_url( get_option('home'));1648 $home_root = parse_url(home_url()); 1649 1649 if ( isset( $home_root['path'] ) ) { 1650 1650 $home_root = trailingslashit($home_root['path']); -
trunk/wp-includes/taxonomy.php
r12597 r12598 2247 2247 2248 2248 if ( empty($termlink) ) { 2249 $file = trailingslashit( get_option('home') );2250 2249 $t = get_taxonomy($taxonomy); 2251 2250 if ( $t->query_var ) 2252 $termlink = " $file?$t->query_var=$slug";2251 $termlink = "?$t->query_var=$slug"; 2253 2252 else 2254 $termlink = "$file?taxonomy=$taxonomy&term=$slug"; 2253 $termlink = "?taxonomy=$taxonomy&term=$slug"; 2254 $termlink = home_url($termlink); 2255 2255 } else { 2256 2256 $termlink = str_replace("%$taxonomy%", $slug, $termlink); 2257 $termlink = get_option('home') . user_trailingslashit($termlink, 'category');2257 $termlink = home_url( user_trailingslashit($termlink, 'category') ); 2258 2258 } 2259 2259 return apply_filters('term_link', $termlink, $term, $taxonomy); -
trunk/wp-includes/theme.php
r12434 r12598 1099 1099 ( false !== strpos($matches[3], '/wp-admin/') ) 1100 1100 || 1101 ( false !== strpos( $matches[3], '://') && 0 !== strpos($matches[3], get_option('home')) )1101 ( false !== strpos( $matches[3], '://' ) && 0 !== strpos( $matches[3], home_url() ) ) 1102 1102 || 1103 1103 ( false !== strpos($matches[3], '/feed/') )
Note: See TracChangeset
for help on using the changeset viewer.