Make WordPress Core


Ignore:
Timestamp:
03/23/2012 10:21:24 AM (13 years ago)
Author:
nacin
Message:

Deprecate get_theme_data(). Use wp_get_theme() instead. see #20103.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/deprecated.php

    r20265 r20269  
    30583058    return remove_theme_support( 'custom-background' );
    30593059}
     3060
     3061/**
     3062 * Retrieve theme data from parsed theme file.
     3063 *
     3064 * @since 1.5.0
     3065 * @deprecated @3.4.0
     3066 * @deprecated Use wp_get_theme()
     3067 * @see wp_get_theme()
     3068 *
     3069 * @param string $theme_file Theme file path.
     3070 * @return array Theme data.
     3071 */
     3072function get_theme_data( $theme_file ) {
     3073    _deprecated_function( __FUNCTION__, 3.4, 'wp_get_theme()' );
     3074    $theme = new WP_Theme( basename( dirname( $theme_file ) ), dirname( dirname( $theme_file ) ) );
     3075
     3076    $theme_data = array(
     3077        'Name' => $theme->get('Name'),
     3078        'URI' => $theme->display('ThemeURI', true, false),
     3079        'Description' => $theme->display('Description', true, false),
     3080        'Author' => $theme->display('Author', true, false),
     3081        'AuthorURI' => $theme->display('AuthorURI', true, false),
     3082        'Version' => $theme->get('Version'),
     3083        'Template' => $theme->get('Template'),
     3084        'Status' => $theme->get('Status'),
     3085        'Tags' => $theme->get('Tags'),
     3086        'Title' => $theme->get('Name'),
     3087        'AuthorName' => $theme->display('Author', false, false),
     3088    );
     3089
     3090    return $theme_data;
     3091}
Note: See TracChangeset for help on using the changeset viewer.