Getting info on default theme(s)
|Reported by:||donutz||Owned by:|
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.