Plugin data
The PluginData service is used to retrieve the header data of the main plugin file. The service provides methods to get the name, version, description, and other header data of the plugin.
TIP
The service is automatically registered with the container and can be accessed by injecting it into your classes. The service is an instance of the PluginData class.
Getting the plugin name
To get the name of the plugin, you can use the get_name() method of the PluginData service.
php
$name = $plugin_data->get_name();Getting the plugin version
To get the version of the plugin, you can use the get_version() method of the PluginData service.
php
$version = $plugin_data->get_version();