WP_Plugin_Dependencies::get_dependentspublic staticWP 6.5.0

Gets filepaths of plugins that require the dependency.

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

Хуков нет.

Возвращает

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

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

$result = WP_Plugin_Dependencies::get_dependents( $slug );
$slug(строка) (обязательный)
The dependency's slug.

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

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

Код WP_Plugin_Dependencies::get_dependents() WP 6.8.1

public static function get_dependents( $slug ) {
	$dependents = array();

	foreach ( (array) self::$dependencies as $dependent => $dependencies ) {
		if ( in_array( $slug, $dependencies, true ) ) {
			$dependents[] = $dependent;
		}
	}

	return $dependents;
}