Created
January 25, 2014 09:50
-
-
Save julienbourdeau/8614161 to your computer and use it in GitHub Desktop.
This PHP function will return your wordpress version. It uses grep to search in /wp-includes/version.php since the wordpress version is not stored in the database (only the db_version is).
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
function get_wp_version( $wp_folder ) { | |
preg_match("/'(.*?)'/", exec( "grep wp_version ".$wp_folder."/wp-includes/version.php" ), $matches); | |
return $matches[1]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment