Use _deprecated_argument() in get_bloginfo() and then don't pass deprecated argument to get_bloginfo(). Fixes #11652 props nacin.

git-svn-id: http://svn.automattic.com/wordpress/trunk@12587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2009-12-30 17:05:02 +00:00
parent 0163da57c4
commit 9105b46360
5 changed files with 11 additions and 14 deletions

View File

@ -371,7 +371,7 @@ EOD;
if( !current_user_can( 'edit_posts' ) )
$this->auth_required( __( 'Sorry, you do not have the right to access this blog.' ) );
$home = esc_attr(get_bloginfo_rss('home'));
$home = esc_attr(get_bloginfo_rss('url'));
$categories = "";
$cats = get_categories(array('hierarchical' => 0, 'hide_empty' => 0));

View File

@ -36,7 +36,7 @@ echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '" ?' . '>'
<link rel="self" type="application/atom+xml" href="<?php echo get_search_comments_feed_link('', 'atom'); ?>" />
<id><?php echo get_search_comments_feed_link('', 'atom'); ?></id>
<?php } else { ?>
<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php bloginfo_rss('home'); ?>" />
<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php bloginfo_rss('url'); ?>" />
<link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('comments_atom_url'); ?>" />
<id><?php bloginfo_rss('comments_atom_url'); ?></id>
<?php } ?>

View File

@ -13,7 +13,7 @@ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
xmlns="http://www.w3.org/2005/Atom"
xmlns:thr="http://purl.org/syndication/thread/1.0"
xml:lang="<?php echo get_option('rss_language'); ?>"
xml:base="<?php bloginfo_rss('home') ?>/wp-atom.php"
xml:base="<?php bloginfo_rss('url') ?>/wp-atom.php"
<?php do_action('atom_ns'); ?>
>
<title type="text"><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
@ -22,7 +22,7 @@ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
<updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></updated>
<?php the_generator( 'atom' ); ?>
<link rel="alternate" type="text/html" href="<?php bloginfo_rss('home') ?>" />
<link rel="alternate" type="text/html" href="<?php bloginfo_rss('url') ?>" />
<id><?php bloginfo('atom_url'); ?></id>
<link rel="self" type="application/atom+xml" href="<?php self_link(); ?>" />

View File

@ -273,9 +273,8 @@ function bloginfo($show='') {
* Retrieve information about the blog.
*
* Some show parameter values are deprecated and will be removed in future
* versions. Care should be taken to check the function contents and know what
* the deprecated blog info options are. Options without "// DEPRECATED" are
* the preferred and recommended ways to get the information.
* versions. These options will trigger the _deprecated_argument() function.
* The deprecated blog info options are listed in the function contents.
*
* The possible values for the 'show' parameter are listed below.
* <ol>
@ -289,21 +288,19 @@ function bloginfo($show='') {
* comment feeds can be retrieved from the 'comments_atom_url' (Atom comment
* feed) or 'comments_rss2_url' (RSS 2.0 comment feed).
*
* There are many other options and you should check the function contents:
* {@source 32 37}
*
* @since 0.71
*
* @param string $show Blog info to retrieve.
* @param string $filter How to filter what is retrieved.
* @return string Mostly string values, might be empty.
*/
function get_bloginfo($show = '', $filter = 'raw') {
function get_bloginfo( $show = '', $filter = 'raw' ) {
switch($show) {
case 'url' :
switch( $show ) {
case 'home' : // DEPRECATED
case 'siteurl' : // DEPRECATED
_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' ) );
case 'url' :
$output = get_option('home');
break;
case 'wpurl' :

View File

@ -1304,7 +1304,7 @@ function get_pagenum_link($pagenum = 1) {
$request = preg_replace('|^/+|', '', $request);
if ( !$wp_rewrite->using_permalinks() || is_admin() ) {
$base = trailingslashit( get_bloginfo( 'home' ) );
$base = trailingslashit( get_bloginfo( 'url' ) );
if ( $pagenum > 1 ) {
$result = add_query_arg( 'paged', $pagenum, $base . $request );