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
This commit is contained in:
Andrew Nacin 2010-05-15 06:28:35 +00:00
parent 4861bebf05
commit 43c09c9587
1 changed files with 24 additions and 4 deletions

View File

@ -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( '<a href="%1$s" title="%2$s">%3$s</a>', $theme_data['AuthorURI'], __( 'Visit author homepage' ), wp_kses( $theme_data['Author'], $themes_allowed_tags ) );
$theme_data['Author'] = sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $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);