Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_WCCOM_Site_Installer::get_wporg_plugin_main_file( string $dir )
Get WP.org plugin’s main file.
Description Description
Parameters Parameters
- $dir
-
(Required) Directory name of the plugin.
Return Return
(bool|string)
Source Source
File: includes/wccom-site/class-wc-wccom-site-installer.php
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; }
Changelog Changelog
Version | Description |
---|---|
3.7.0 | Introduced. |