WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/30/2009 05:05:02 PM (11 years ago)
Author:
westi
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r12514 r12587  
    274274 *
    275275 * Some show parameter values are deprecated and will be removed in future
    276  * versions. Care should be taken to check the function contents and know what
    277  * the deprecated blog info options are. Options without "// DEPRECATED" are
    278  * the preferred and recommended ways to get the information.
     276 * versions. These options will trigger the _deprecated_argument() function.
     277 * The deprecated blog info options are listed in the function contents.
    279278 *
    280279 * The possible values for the 'show' parameter are listed below.
     
    290289 * feed) or 'comments_rss2_url' (RSS 2.0 comment feed).
    291290 *
    292  * There are many other options and you should check the function contents:
    293  * {@source 32 37}
    294  *
    295291 * @since 0.71
    296292 *
     
    299295 * @return string Mostly string values, might be empty.
    300296 */
    301 function get_bloginfo($show = '', $filter = 'raw') {
    302 
    303     switch($show) {
    304         case 'url' :
     297function get_bloginfo( $show = '', $filter = 'raw' ) {
     298
     299    switch( $show ) {
    305300        case 'home' : // DEPRECATED
    306301        case 'siteurl' : // DEPRECATED
     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        case 'url' :
    307304            $output = get_option('home');
    308305            break;
Note: See TracChangeset for help on using the changeset viewer.