Restore the 'extra_theme_headers' filter in the deprecated get_theme_data function so that plugins/themes using this function can still access their extra headers.

Fixes #20897 props nacin, georgestephanis, SergeyBiryukov.


git-svn-id: http://core.svn.wordpress.org/trunk@21050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2012-06-11 17:30:57 +00:00
parent 7351bce967
commit cd8c0e74ab
2 changed files with 7 additions and 2 deletions

View File

@ -563,7 +563,7 @@ final class WP_Theme implements ArrayAccess {
public function display( $header, $markup = true, $translate = true ) {
$value = $this->get( $header );
if ( empty( $value ) || ! $this->load_textdomain() )
if ( $translate && ( empty( $value ) || ! $this->load_textdomain() ) )
$translate = false;
if ( $translate )

View File

@ -3111,9 +3111,14 @@ function get_theme_data( $theme_file ) {
'Status' => $theme->get('Status'),
'Tags' => $theme->get('Tags'),
'Title' => $theme->get('Name'),
'AuthorName' => $theme->display('Author', false, false),
'AuthorName' => $theme->get('Author'),
);
foreach ( apply_filters( 'extra_theme_headers', array() ) as $extra_header ) {
if ( ! isset( $theme_data[ $extra_header ] ) )
$theme_data[ $extra_header ] = $theme->get( $extra_header );
}
return $theme_data;
}