1

I want to get a specific plugin version number on my theme area. For example, I want to show the currently active WooCommerce plugin version number. How can I get it?

Thanks

Sumon Hasan
  • 310
  • 3
  • 14

2 Answers2

2

You need something like this

$plugin_dir = WP_PLUGIN_DIR . '/woocommerce/woocommerce.php';

$plugin_data = get_plugin_data($plugin_dir);

echo $plugin_data['Version'];
Mohammad Yousefi
  • 513
  • 3
  • 12
0

Yes, it's working. But the array 'version' word would be capital word 'Version'. Otherwise, it's showing Notice: Undefined index.

$plugin_dir = WP_PLUGIN_DIR . '/woocommerce/woocommerce.php';

$plugin_data = get_plugin_data($plugin_dir);

echo $plugin_data['Version'];

Sumon Hasan
  • 310
  • 3
  • 14