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' ) ) if( !current_user_can( 'edit_posts' ) )
$this->auth_required( __( 'Sorry, you do not have the right to access this blog.' ) ); $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 = ""; $categories = "";
$cats = get_categories(array('hierarchical' => 0, 'hide_empty' => 0)); $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'); ?>" /> <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> <id><?php echo get_search_comments_feed_link('', 'atom'); ?></id>
<?php } else { ?> <?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'); ?>" /> <link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('comments_atom_url'); ?>" />
<id><?php bloginfo_rss('comments_atom_url'); ?></id> <id><?php bloginfo_rss('comments_atom_url'); ?></id>
<?php } ?> <?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="http://www.w3.org/2005/Atom"
xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:thr="http://purl.org/syndication/thread/1.0"
xml:lang="<?php echo get_option('rss_language'); ?>" 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'); ?> <?php do_action('atom_ns'); ?>
> >
<title type="text"><?php bloginfo_rss('name'); wp_title_rss(); ?></title> <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> <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></updated>
<?php the_generator( 'atom' ); ?> <?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> <id><?php bloginfo('atom_url'); ?></id>
<link rel="self" type="application/atom+xml" href="<?php self_link(); ?>" /> <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. * Retrieve information about the blog.
* *
* Some show parameter values are deprecated and will be removed in future * 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 * versions. These options will trigger the _deprecated_argument() function.
* the deprecated blog info options are. Options without "// DEPRECATED" are * The deprecated blog info options are listed in the function contents.
* the preferred and recommended ways to get the information.
* *
* The possible values for the 'show' parameter are listed below. * The possible values for the 'show' parameter are listed below.
* <ol> * <ol>
@ -289,21 +288,19 @@ function bloginfo($show='') {
* comment feeds can be retrieved from the 'comments_atom_url' (Atom comment * comment feeds can be retrieved from the 'comments_atom_url' (Atom comment
* feed) or 'comments_rss2_url' (RSS 2.0 comment feed). * 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 * @since 0.71
* *
* @param string $show Blog info to retrieve. * @param string $show Blog info to retrieve.
* @param string $filter How to filter what is retrieved. * @param string $filter How to filter what is retrieved.
* @return string Mostly string values, might be empty. * @return string Mostly string values, might be empty.
*/ */
function get_bloginfo($show = '', $filter = 'raw') { function get_bloginfo( $show = '', $filter = 'raw' ) {
switch($show) { switch( $show ) {
case 'url' :
case 'home' : // DEPRECATED case 'home' : // DEPRECATED
case 'siteurl' : // 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'); $output = get_option('home');
break; break;
case 'wpurl' : case 'wpurl' :

View File

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