[wp-trac] [WordPress Trac] #30819: Getting info on default theme(s)
WordPress Trac
noreply at wordpress.org
Mon Dec 22 22:41:21 UTC 2014
#30819: Getting info on default theme(s)
-------------------------+-----------------------------
Reporter: donutz | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
I was looking for an array of default WP themes, but found that
`$default_themes` in the WP_Theme class is private. Easy access to info on
default themes seems a bit lacking, so I wrote this little method for
WP_Theme (named `get_default()`, in analogy to existing `get_allowed()`)
which returns info based on a `$key` provided:
* `theme`: returns default theme object
* `stylesheet`: returns default theme "slug"
* `installed`: returns array of installed default themes
* `active`: returns theme object if a default theme is active, otherwise
false
* `themes` (or default): returns the $default_themes array
I attached a .diff file for your consideration.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30819>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list