Created
July 15, 2013 14:08
-
-
Save thadallender/6000212 to your computer and use it in GitHub Desktop.
Derive version number from WordPress theme style.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get theme version number from WP_Theme object (cached) | |
*/ | |
function gpp_get_theme_version() { | |
$theme_file = get_template_directory() . '/style.css'; | |
$theme = new WP_Theme( basename( dirname( $theme_file ) ), dirname( dirname( $theme_file ) ) ); | |
return $theme->get( 'Version' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment