WordPress.org

Make WordPress Core

Ticket #9392: 9392.2.patch

File 9392.2.patch, 1.7 KB (added by hakre, 8 years ago)
  • wp-admin/includes/theme.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress-trunk
     
    1111 *
    1212 * @since unknown
    1313 *
    14  * @return unknown
     14 * @return object theme info object
    1515 */
    16 function current_theme_info() {
    17         $themes = get_themes();
     16function &current_theme_info() {
     17        $themes        = get_themes();
    1818        $current_theme = get_current_theme();
    19         $ct->name = $current_theme;
    20         $ct->title = $themes[$current_theme]['Title'];
    21         $ct->version = $themes[$current_theme]['Version'];
    22         $ct->parent_theme = $themes[$current_theme]['Parent Theme'];
    23         $ct->template_dir = $themes[$current_theme]['Template Dir'];
    24         $ct->stylesheet_dir = $themes[$current_theme]['Stylesheet Dir'];
    25         $ct->template = $themes[$current_theme]['Template'];
    26         $ct->stylesheet = $themes[$current_theme]['Stylesheet'];
    27         $ct->screenshot = $themes[$current_theme]['Screenshot'];
    28         $ct->description = $themes[$current_theme]['Description'];
    29         $ct->author = $themes[$current_theme]['Author'];
    30         $ct->tags = $themes[$current_theme]['Tags'];
    31         $ct->theme_root = $themes[$current_theme]['Theme Root'];
    32         $ct->theme_root_uri = $themes[$current_theme]['Theme Root URI'];
     19        $transpose     = array(
     20                'Title', 'Version', 'Parent Theme', 'Template Dir',
     21                'Stylesheet Dir', 'Template', 'Stylesheet', 'Screenshot',
     22                'Description', 'Author', 'Tags', 'Theme Root', 'Theme Root URI',
     23        );
     24        $ct =& new StdClass;
     25        $ct->name = $current_theme;     
     26        foreach ($transpose as $from) {
     27                $key      = str_replace( ' ', '_', strtolower($from) );
     28                $ct->$key = $themes[$current_theme][$from];                             
     29        }       
    3330        return $ct;
    3431}
    3532