WordPress.org

Make WordPress Core

Ticket #12275: 12275.diff

File 12275.diff, 2.2 KB (added by blepoxp, 4 years ago)

Adds AuthorName to array of theme_data available. Differs from author in that it doesn't have the Author URI link wrapped around it.

  • theme.php

     
    222222                $theme_data['Tags'] = array_map( 'trim', explode( ',', wp_kses( $theme_data['Tags'], array() ) ) ); 
    223223 
    224224        if ( $theme_data['Author'] == '' ) { 
    225                 $theme_data['Author'] = __('Anonymous'); 
     225                $theme_data['Author'] = $theme_data['AuthorName'] = __('Anonymous'); 
    226226        } else { 
     227                $theme_data['AuthorName'] = wp_kses( $theme_data['Author'], $themes_allowed_tags ); 
    227228                if ( empty( $theme_data['AuthorURI'] ) ) { 
    228229                        $theme_data['Author'] = wp_kses( $theme_data['Author'], $themes_allowed_tags ); 
    229230                } else { 
     
    281282                $description = wptexturize($theme_data['Description']); 
    282283                $version     = $theme_data['Version']; 
    283284                $author      = $theme_data['Author']; 
     285                $authorname      = $theme_data['AuthorName']; 
    284286                $template    = $theme_data['Template']; 
    285287                $stylesheet  = dirname($theme_file); 
    286288 
     
    403405                } 
    404406 
    405407                $theme_roots[$stylesheet] = str_replace( WP_CONTENT_DIR, '', $theme_root ); 
    406                 $wp_themes[$name] = array( 'Name' => $name, 'Title' => $title, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Stylesheet' => $stylesheet, 'Template Files' => $template_files, 'Stylesheet Files' => $stylesheet_files, 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Status' => $theme_data['Status'], 'Screenshot' => $screenshot, 'Tags' => $theme_data['Tags'], 'Theme Root' => $theme_root, 'Theme Root URI' => str_replace( WP_CONTENT_DIR, content_url(), $theme_root ) ); 
     408                $wp_themes[$name] = array( 'Name' => $name, 'Title' => $title, 'Description' => $description, 'Author' => $author, 'AuthorName' => $authorname, 'Version' => $version, 'Template' => $template, 'Stylesheet' => $stylesheet, 'Template Files' => $template_files, 'Stylesheet Files' => $stylesheet_files, 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Status' => $theme_data['Status'], 'Screenshot' => $screenshot, 'Tags' => $theme_data['Tags'], 'Theme Root' => $theme_root, 'Theme Root URI' => str_replace( WP_CONTENT_DIR, content_url(), $theme_root ) ); 
    407409        } 
    408410 
    409411        unset($theme_files);