I would like to have my plugin detect the current "activated" theme. If my starter theme or the correct child theme is not loaded, then alert the administrator from wp-admin with an alert notification.
I can figure out the latter, but it's the former I have a question about...are their hooks or conditional tags already built into WordPress that allows me to do this easily, or do most professional wp coders have their own custom logic of doing this?
I'm ultimately building a plugin to assist & extend a specific starter theme.
I want the plugin to detect this for the existing theme, and if a theme in the future is activated.
Many thanks for the education!
I would like to have my plugin detect the current "activated" theme. If my starter theme or the correct child theme is not loaded, then alert the administrator from wp-admin with an alert notification.
I can figure out the latter, but it's the former I have a question about...are their hooks or conditional tags already built into WordPress that allows me to do this easily, or do most professional wp coders have their own custom logic of doing this?
I'm ultimately building a plugin to assist & extend a specific starter theme.
I want the plugin to detect this for the existing theme, and if a theme in the future is activated.
Many thanks for the education!
You can use wp_get_theme
to get current theme object.
$current_theme = wp_get_theme();
And it will return WP_Theme object.