WP_Plugin_Dependencies::get_dependency_filepaths(): array

In this article

Gets the filepath of installed dependencies.

Description

If a dependency is not installed, the filepath defaults to false.

Return

array An array of install dependencies filepaths, relative to the plugins directory.

Source

protected static function get_dependency_filepaths() {
	if ( is_array( self::$dependency_filepaths ) ) {
		return self::$dependency_filepaths;
	}

	if ( null === self::$dependency_slugs ) {
		return array();
	}

	self::$dependency_filepaths = array();

	$plugin_dirnames = self::get_plugin_dirnames();
	foreach ( self::$dependency_slugs as $slug ) {
		if ( isset( $plugin_dirnames[ $slug ] ) ) {
			self::$dependency_filepaths[ $slug ] = $plugin_dirnames[ $slug ];
			continue;
		}

		self::$dependency_filepaths[ $slug ] = false;
	}

	return self::$dependency_filepaths;
}

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.