Skip to content

Instantly share code, notes, and snippets.

@julienbourdeau
Created January 25, 2014 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julienbourdeau/8614161 to your computer and use it in GitHub Desktop.
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).
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