WP_Plugin_Dependencies::get_dependency_filepaths()protected staticWP 6.5.0

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

Метод класса: WP_Plugin_Dependencies{}

Хуков нет.

Возвращает

Массив. An array of install dependencies filepaths, relative to the plugins directory.

Использование

$result = WP_Plugin_Dependencies::get_dependency_filepaths();

Список изменений

С версии 6.5.0 Введена.

Код WP_Plugin_Dependencies::get_dependency_filepaths() WP 6.6.2

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;
}