WordPress.org

Make WordPress Core

Ticket #20189: 20189.diff

File 20189.diff, 3.5 KB (added by benbalter, 10 years ago)

Patch to deprecate bloginfo() in favor of siteinfo()

  • wp-includes/general-template.php

     
    361361}
    362362
    363363/**
    364  * Display information about the blog.
     364 * Display information about the site.
    365365 *
    366  * @see get_bloginfo() For possible values for the parameter.
     366 * @see get_siteinfo() For possible values for the parameter.
    367367 * @since 0.71
    368368 *
    369369 * @param string $show What to display.
    370370 */
    371 function bloginfo( $show='' ) {
    372         echo get_bloginfo( $show, 'display' );
     371function siteinfo( $show='' ) {
     372        echo get_siteinfo( $show, 'display' );
    373373}
    374374
    375375/**
    376  * Retrieve information about the blog.
     376 * Retrieve information about the site.
    377377 *
    378378 * Some show parameter values are deprecated and will be removed in future
    379379 * versions. These options will trigger the _deprecated_argument() function.
     
    381381 *
    382382 * The possible values for the 'show' parameter are listed below.
    383383 * <ol>
    384  * <li><strong>url</strong> - Blog URI to homepage.</li>
    385  * <li><strong>wpurl</strong> - Blog URI path to WordPress.</li>
     384 * <li><strong>url</strong> - Site URI to homepage.</li>
     385 * <li><strong>wpurl</strong> - Site URI path to WordPress.</li>
    386386 * <li><strong>description</strong> - Secondary title</li>
    387387 * </ol>
    388388 *
     
    393393 *
    394394 * @since 0.71
    395395 *
    396  * @param string $show Blog info to retrieve.
     396 * @param string $show site info to retrieve.
    397397 * @param string $filter How to filter what is retrieved.
    398398 * @return string Mostly string values, might be empty.
    399399 */
    400 function get_bloginfo( $show = '', $filter = 'raw' ) {
     400function get_siteinfo( $show = '', $filter = 'raw' ) {
    401401
    402402        switch( $show ) {
    403403                case 'home' : // DEPRECATED
  • wp-includes/deprecated.php

     
    29522952        if ( is_array( $themes ) && array_key_exists( $theme, $themes ) )
    29532953                return $themes[$theme];
    29542954        return null;
     2955}
     2956
     2957/**
     2958 * Display information about the site.
     2959 *
     2960 * @see get_siteinfo() For possible values for the parameter.
     2961 * @since 0.71
     2962 *
     2963 * @param string $show What to display.
     2964 */
     2965function bloginfo( $show='' ) {
     2966        _deprecated_function( __FUNCTION__, '3.4', 'siteinfo' );
     2967        siteinfo( $show );
     2968}
     2969
     2970/**
     2971 * Retrieve information about the site.
     2972 *
     2973 * Some show parameter values are deprecated and will be removed in future
     2974 * versions. These options will trigger the _deprecated_argument() function.
     2975 * The deprecated blog info options are listed in the function contents.
     2976 *
     2977 * The possible values for the 'show' parameter are listed below.
     2978 * <ol>
     2979 * <li><strong>url</strong> - Site URI to homepage.</li>
     2980 * <li><strong>wpurl</strong> - Site URI path to WordPress.</li>
     2981 * <li><strong>description</strong> - Secondary title</li>
     2982 * </ol>
     2983 *
     2984 * The feed URL options can be retrieved from 'rdf_url' (RSS 0.91),
     2985 * 'rss_url' (RSS 1.0), 'rss2_url' (RSS 2.0), or 'atom_url' (Atom feed). The
     2986 * comment feeds can be retrieved from the 'comments_atom_url' (Atom comment
     2987 * feed) or 'comments_rss2_url' (RSS 2.0 comment feed).
     2988 *
     2989 * @since 0.71
     2990 *
     2991 * @param string $show site info to retrieve.
     2992 * @param string $filter How to filter what is retrieved.
     2993 * @return string Mostly string values, might be empty.
     2994 */
     2995function get_bloginfo( $show = '', $filter = 'raw' ) {
     2996        _deprecated_function( __FUNCTION__, '3.4', 'siteinfo()' );
     2997        return get_siteinfo( $show, $filter );
    29552998}
     2999 No newline at end of file