W3cubDocs

/WordPress

WP_Plugin_Dependencies::get_dependency_filepath( string $slug ): string|false

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

Parameters

$slugstringrequired
The dependency’s slug.

Return

string|false If installed, the dependency’s filepath relative to the plugins directory, otherwise false.

Source

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

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

	return $dependency_filepaths[ $slug ];
}

Changelog

Version Description
6.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_dependency_filepath