WP_Plugin_Dependencies::get_dependency_filepathpublic staticWP 6.5.0

Gets the filepath for a dependency, relative to the plugin's directory.

Method of the class: WP_Plugin_Dependencies{}

No Hooks.

Returns

String|false. If installed, the dependency's filepath relative to the plugins directory, otherwise false.

Usage

$result = WP_Plugin_Dependencies::get_dependency_filepath( $slug );
$slug(string) (required)
The dependency's slug.

Changelog

Since 6.5.0 Introduced.

WP_Plugin_Dependencies::get_dependency_filepath() code WP 6.9

public static function get_dependency_filepath( $slug ) {
	$dependency_filepaths = self::get_dependency_filepaths();

	if ( ! isset( $dependency_filepaths[ $slug ] ) ) {
		return false;
	}

	return $dependency_filepaths[ $slug ];
}