From 0ec0c40c0a630f58ad9eafc4a8b2fc3c4f1c5d32 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Mon, 11 Jun 2012 17:30:57 +0000 Subject: [PATCH] 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: https://develop.svn.wordpress.org/trunk@21050 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/class-wp-theme.php | 2 +- wp-includes/deprecated.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index e63429a009..b07e0b5fbd 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -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 ) diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 24034f9946..43523ca698 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -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; }