There is a function called get_plugin_data()
. Try calling this from within the main plugin file if you need to:
1 2 | $plugin_data = get_plugin_data( __FILE__ ); $plugin_version = $plugin_data['Version']; |
But as is said in the answers to the other question, its better for performance to just define a PHP variable as you’re doing.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.