Make WordPress Core


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.