I'm able to get certain info about the active theme using wp_get_theme()
. For example:
$theme = wp_get_theme();
echo $theme->get( 'TextDomain' ); // twentyfifteen
echo $theme->get( 'ThemeURI' ); // https://wordpress.org/themes/twentyfifteen/
Is there a way to get the theme's slug? In this case it'd be twentyfifteen. Please note the theme's slug isn't always the same as the theme's text domain. I'd also like to avoid performing string replacement on the theme's URL if possible.
Ref: https://codex.wordpress.org/Function_Reference/wp_get_theme