Is there any way to change version of plugin in comment automatically

49 Views Asked by At
/**
 * CART-DISCOUNT
 *
 * @package           CART-DISCOUNT
 * @author            Nymul Islam Moon
 * @copyright         2023 Nymul Islam
 * @license           GPL-2.0-or-later
 *
 * @wordpress-plugin
 *
 * Version:           1.0.0
**/

$version = '1.0.0';

Here I wanted to use the version variable in the version comment that will automatically change in my code. Is there any way to do that?

I know that there is no way to add variable in comment but for just to make sure I have asked the question.

1

There are 1 best solutions below

0
On

For what it's worth you can read the contents of the standardized plugin comment block with get_plugin_data( $file, false, false );

You might be able to go from there to displaying an altered version number. But as you mentioned, to update that version in the plugin would require writing the plugin code file. That's not a great idea in a production web site, as it might be exploitable by a cybercreep.