[wp-trac] [WordPress Trac] #23040: Expand use of WP_Theme object
WordPress Trac
noreply at wordpress.org
Fri Dec 21 20:11:55 UTC 2012
#23040: Expand use of WP_Theme object
--------------------------------------+--------------------------
Reporter: wpsmith | Type: defect (bug)
Status: new | Priority: normal
Milestone: Awaiting Review | Component: Themes
Version: | Severity: normal
Keywords: 2nd-opinion dev-feedback |
--------------------------------------+--------------------------
Currently, a user can do the following:
{{{
$theme = wp_get_theme();
$version = $theme->Version;
$name = $theme->Name;
$author = $theme->Author;
$version = $theme->Version;
}}}
So, when I tried to get the other data in the same method, I was getting
nothing. However, to get the other data, one must do this:
{{{
$theme->{'Author URI'}; // per Codex;
$theme->get( 'AuthorURI' ); // $theme->AuthorURI doesn't work
$theme->get( 'ThemeURI' ); // $theme->ThemeURI & $theme->{'Theme URI'};
doesn't work
$theme->get( 'TextDomain' ); // $theme->TextDomain & $theme->{'Text
Domain'}; doesn't work
}}}
get() is a great method to get the other data; however, shouldn't we make
this consistent for developers?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23040>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list