Standardize on 'url' for fetching the blog's url. Props rob1n. fixes #3623

git-svn-id: http://svn.automattic.com/wordpress/trunk@4983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-03-07 03:05:41 +00:00
parent ab79f95e5f
commit 8d7839b14c
8 changed files with 29 additions and 22 deletions

View File

@ -26,7 +26,7 @@ require_once('admin-header.php');
<?php if ( ! validate_current_theme() ) : ?> <?php if ( ! validate_current_theme() ) : ?>
<div id="message1" class="updated fade"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div> <div id="message1" class="updated fade"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div>
<?php elseif ( isset($_GET['activated']) ) : ?> <?php elseif ( isset($_GET['activated']) ) : ?>
<div id="message2" class="updated fade"><p><?php printf(__('New theme activated. <a href="%s">View site &raquo;</a>'), get_bloginfo('home') . '/'); ?></p></div> <div id="message2" class="updated fade"><p><?php printf(__('New theme activated. <a href="%s">View site &raquo;</a>'), get_bloginfo('url') . '/'); ?></p></div>
<?php endif; ?> <?php endif; ?>
<?php <?php

View File

@ -1,4 +1,4 @@
<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/"> <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
<div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" /> <div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" /> <input type="submit" id="searchsubmit" value="Search" />
</div> </div>

View File

@ -17,23 +17,23 @@
<p>You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p> <p>You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p>
<?php /* If this is a yearly archive */ } elseif (is_day()) { ?> <?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives <p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for the day <?php the_time('l, F jS, Y'); ?>.</p> for the day <?php the_time('l, F jS, Y'); ?>.</p>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?> <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives <p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for <?php the_time('F, Y'); ?>.</p> for <?php the_time('F, Y'); ?>.</p>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?> <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives <p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for the year <?php the_time('Y'); ?>.</p> for the year <?php the_time('Y'); ?>.</p>
<?php /* If this is a monthly archive */ } elseif (is_search()) { ?> <?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
<p>You have searched the <a href="<?php echo bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives <p>You have searched the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p> for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>
<?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> <?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<p>You are currently browsing the <a href="<?php echo bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives.</p> <p>You are currently browsing the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives.</p>
<?php } ?> <?php } ?>
</li> </li>

View File

@ -60,9 +60,11 @@ function wp_meta() {
function bloginfo($show='') { function bloginfo($show='') {
$info = get_bloginfo($show); $info = get_bloginfo($show);
if (!strstr($show, 'url') && //don't filter URLs
!strstr($show, 'directory') && // Don't filter URL's.
!strstr($show, 'home')) { if (strpos($show, 'url') === false ||
strpos($show, 'directory') === false ||
strpos($show, 'home') === false) {
$info = apply_filters('bloginfo', $info, $show); $info = apply_filters('bloginfo', $info, $show);
$info = convert_chars($info); $info = convert_chars($info);
} else { } else {
@ -72,13 +74,18 @@ function bloginfo($show='') {
echo $info; echo $info;
} }
/**
* Note: some of these values are DEPRECATED. Meaning they could be
* taken out at any time and shouldn't be relied upon. Options
* without "// DEPRECATED" are the preferred and recommended ways
* to get the information.
*/
function get_bloginfo($show='') { function get_bloginfo($show='') {
switch($show) { switch($show) {
case 'url' : case 'url' :
case 'home' : case 'home' : // DEPRECATED
case 'siteurl' : case 'siteurl' : // DEPRECATED
$output = get_option('home'); $output = get_option('home');
break; break;
case 'wpurl' : case 'wpurl' :

View File

@ -167,7 +167,7 @@ header('Content-Type: text/html; charset=' . get_bloginfo('charset'));
<div id="content4" class="hidden"> <div id="content4" class="hidden">
<h2><?php _e('About TinyMCE'); ?></h2> <h2><?php _e('About TinyMCE'); ?></h2>
<p><?php printf(__('Version: %s'), '2.0.9') ?></p> <p><?php printf(__('Version: %s'), '2.0.9') ?></p>
<p><?php printf(__('TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under %sLGPL</a> by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.'), '<a href="'.get_bloginfo('home').'/wp-includes/js/tinymce/license.txt" target="_blank" title="'.__('GNU Library General Public Licence').'">') ?></p> <p><?php printf(__('TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under %sLGPL</a> by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.'), '<a href="'.get_bloginfo('url').'/wp-includes/js/tinymce/license.txt" target="_blank" title="'.__('GNU Library General Public Licence').'">') ?></p>
<p><?php _e('Copyright &copy; 2005, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.') ?></p> <p><?php _e('Copyright &copy; 2005, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.') ?></p>
<p><?php _e('For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.') ?></p> <p><?php _e('For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.') ?></p>

View File

@ -163,7 +163,7 @@ function get_attachment_link($id = false) {
} }
if (! $link ) { if (! $link ) {
$link = get_bloginfo('home') . "/?attachment_id=$id"; $link = get_bloginfo('url') . "/?attachment_id=$id";
} }
return apply_filters('attachment_link', $link, $id); return apply_filters('attachment_link', $link, $id);

View File

@ -1198,9 +1198,9 @@ function generate_page_uri_index() {
// //
function is_local_attachment($url) { function is_local_attachment($url) {
if ( !strstr($url, get_bloginfo('home') ) ) if ( !strstr($url, get_bloginfo('url') ) )
return false; return false;
if ( strstr($url, get_bloginfo('home') . '/?attachment_id=') ) if ( strstr($url, get_bloginfo('url') . '/?attachment_id=') )
return true; return true;
if ( $id = url_to_postid($url) ) { if ( $id = url_to_postid($url) ) {
$post = & get_post($id); $post = & get_post($id);

View File

@ -153,9 +153,9 @@ case 'retrievepassword' :
<?php if (get_option('users_can_register')) : ?> <?php if (get_option('users_can_register')) : ?>
<li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Login') ?></a></li> <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Login') ?></a></li>
<li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=register"><?php _e('Register') ?></a></li> <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=register"><?php _e('Register') ?></a></li>
<li><a href="<?php bloginfo('home'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title')); ?></a></li> <li><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title')); ?></a></li>
<?php else : ?> <?php else : ?>
<li><a href="<?php bloginfo('home'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title')); ?></a></li> <li><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title')); ?></a></li>
<li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Login') ?></a></li> <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Login') ?></a></li>
<?php endif; ?> <?php endif; ?>
</ul> </ul>
@ -275,7 +275,7 @@ case 'register' :
<ul> <ul>
<li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Login') ?></a></li> <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Login') ?></a></li>
<li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a></li> <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a></li>
<li><a href="<?php bloginfo('home'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title')); ?></a></li> <li><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title')); ?></a></li>
</ul> </ul>
</body> </body>
@ -366,9 +366,9 @@ default:
<?php if (get_option('users_can_register')) : ?> <?php if (get_option('users_can_register')) : ?>
<li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=register"><?php _e('Register') ?></a></li> <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=register"><?php _e('Register') ?></a></li>
<li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a></li> <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a></li>
<li><a href="<?php bloginfo('home'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title')); ?></a></li> <li><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title')); ?></a></li>
<?php else : ?> <?php else : ?>
<li><a href="<?php bloginfo('home'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title')); ?></a></li> <li><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title')); ?></a></li>
<li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a></li> <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a></li>
<?php endif; ?> <?php endif; ?>
</ul> </ul>