From c38846defd5ef50e555adfcfdd8c8e83088be961 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Wed, 30 Dec 2009 17:05:02 +0000 Subject: [PATCH] Use _deprecated_argument() in get_bloginfo() and then don't pass deprecated argument to get_bloginfo(). Fixes #11652 props nacin. git-svn-id: https://develop.svn.wordpress.org/trunk@12587 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-app.php | 2 +- wp-includes/feed-atom-comments.php | 2 +- wp-includes/feed-atom.php | 4 ++-- wp-includes/general-template.php | 15 ++++++--------- wp-includes/link-template.php | 2 +- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/wp-app.php b/wp-app.php index d012026834..0e639b8996 100644 --- a/wp-app.php +++ b/wp-app.php @@ -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)); diff --git a/wp-includes/feed-atom-comments.php b/wp-includes/feed-atom-comments.php index 7f7e6f511a..c4cd9751cf 100644 --- a/wp-includes/feed-atom-comments.php +++ b/wp-includes/feed-atom-comments.php @@ -36,7 +36,7 @@ echo '' - + diff --git a/wp-includes/feed-atom.php b/wp-includes/feed-atom.php index da3eeb467d..e08ba658f4 100644 --- a/wp-includes/feed-atom.php +++ b/wp-includes/feed-atom.php @@ -13,7 +13,7 @@ echo ''; ?> xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xml:lang="" - xml:base="/wp-atom.php" + xml:base="/wp-atom.php" > <?php bloginfo_rss('name'); wp_title_rss(); ?> @@ -22,7 +22,7 @@ echo ''; ?> - + diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index a214d6a5e7..8405c510bd 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -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. *
    @@ -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' : diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 5e0c14bcf4..895e3b71da 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -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 );