Automattic\WooCommerce\Utilities

PluginUtil::get_plugin_name()publicWC 1.0

Get the printable name of a plugin.

{} It's a 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).

Code of PluginUtil::get_plugin_name() WC 7.1.0

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 ArrayUtil::get_value_or_default( $plugin_data, 'Name', $plugin_id );
}