Make WordPress Core

Changeset 20039


Ignore:
Timestamp:
02/29/2012 07:27:54 PM (15 years ago)
Author:
nacin
Message:

(string) WP_Theme is now the theme name, translated. Good replacement for get_current_theme(); better than wp_get_theme()->display('Name'). see #20103, see #20138.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyeleven/inc/theme-options.php

    r19580 r20039  
    315315        <div class="wrap">
    316316                <?php screen_icon(); ?>
    317                 <h2><?php printf( __( '%s Theme Options', 'twentyeleven' ), get_current_theme() ); ?></h2>
     317                <h2><?php printf( __( '%s Theme Options', 'twentyeleven' ), wp_get_theme() ); ?></h2>
    318318                <?php settings_errors(); ?>
    319319
  • trunk/wp-includes/class-wp-theme.php

    r20029 r20039  
    237237                        $this->cache_add( 'theme', $cache );
    238238                }
     239        }
     240
     241        /**
     242         * When converting the object to a string, the theme name is returned.
     243         *
     244         * @return string Theme name, ready for display (translated)
     245         */
     246        function __toString() {
     247                return (string) $this->display('Name');
    239248        }
    240249
Note: See TracChangeset for help on using the changeset viewer.