Automattic\WooCommerce\Utilities
PluginUtil::get_plugin_name()
Get the printable name of a plugin.
Method of the class: PluginUtil{}
No Hooks.
Return
String
. Printable plugin name, or the plugin id itself if printable name is not available.
Usage
$PluginUtil = new PluginUtil(); $PluginUtil->get_plugin_name( $plugin_id ): string;
- $plugin_id(string) (required)
- Plugin id (path/file.php).
PluginUtil::get_plugin_name() PluginUtil::get plugin name code WC 9.4.2
public function get_plugin_name( string $plugin_id ): string { $plugin_data = $this->proxy->call_function( 'get_plugin_data', WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $plugin_id ); return $plugin_data['Name'] ?? $plugin_id; }