From 43c09c9587871f538b5ea9501ac4afbc549ea94a Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 15 May 2010 06:28:35 +0000 Subject: [PATCH] Also return raw author name and URI from get_theme_data and get_themes. props blepoxp, fixes #12275. git-svn-id: https://develop.svn.wordpress.org/trunk@14658 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/theme.php | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 3fb49b5df2..3034ace073 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -233,12 +233,13 @@ function get_theme_data( $theme_file ) { $theme_data['Tags'] = array_map( 'trim', explode( ',', wp_kses( $theme_data['Tags'], array() ) ) ); if ( $theme_data['Author'] == '' ) { - $theme_data['Author'] = __('Anonymous'); + $theme_data['Author'] = $theme_data['AuthorName'] = __('Anonymous'); } else { + $theme_data['AuthorName'] = wp_kses( $theme_data['Author'], $themes_allowed_tags ); if ( empty( $theme_data['AuthorURI'] ) ) { - $theme_data['Author'] = wp_kses( $theme_data['Author'], $themes_allowed_tags ); + $theme_data['Author'] = $theme_data['AuthorName']; } else { - $theme_data['Author'] = sprintf( '%3$s', $theme_data['AuthorURI'], __( 'Visit author homepage' ), wp_kses( $theme_data['Author'], $themes_allowed_tags ) ); + $theme_data['Author'] = sprintf( '%3$s', $theme_data['AuthorURI'], __( 'Visit author homepage' ), $theme_data['AuthorName'] ); } } @@ -414,7 +415,26 @@ function get_themes() { } $theme_roots[$stylesheet] = str_replace( WP_CONTENT_DIR, '', $theme_root ); - $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 ) ); + $wp_themes[$name] = array( + 'Name' => $name, + 'Title' => $title, + 'Description' => $description, + 'Author' => $author, + 'Author Name' => $theme_data['AuthorName'], + 'Author URI' => $theme_data['AuthorURI'], + '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 ), + ); } unset($theme_files);