WordPress at Your Fingertips
function is not described

WC_WCCOM_Site_Installer::get_wporg_plugin_main_file() private WC 3.7.0

Get WP.org plugin's main file.

{} It's a method of the class: WC_WCCOM_Site_Installer{}

No Hooks.

Return

true|false|String.

Usage

$result = WC_WCCOM_Site_Installer::get_wporg_plugin_main_file( $dir );
$dir(string) (required)
Directory name of the plugin.

Changelog

Since 3.7.0 Introduced.

Code of WC_WCCOM_Site_Installer::get_wporg_plugin_main_file() WC 6.1.1

private static function get_wporg_plugin_main_file( $dir ) {
	// Ensure that exact dir name is used.
	$dir = trailingslashit( $dir );

	if ( ! function_exists( 'get_plugins' ) ) {
		require_once ABSPATH . 'wp-admin/includes/plugin.php';
	}

	$plugins = get_plugins();
	foreach ( $plugins as $path => $plugin ) {
		if ( 0 === strpos( $path, $dir ) ) {
			return $path;
		}
	}

	return false;
}