WP_Plugin_Dependencies::get_circular_dependencies()protected staticWP 6.5.0

Gets circular dependency data.

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

Хуков нет.

Возвращает

Массив[]. An array of circular dependency pairings.

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

$result = WP_Plugin_Dependencies::get_circular_dependencies();

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

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

Код WP_Plugin_Dependencies::get_circular_dependencies() WP 6.6.2

protected static function get_circular_dependencies() {
	if ( is_array( self::$circular_dependencies_pairs ) ) {
		return self::$circular_dependencies_pairs;
	}

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

	self::$circular_dependencies_slugs = array();

	self::$circular_dependencies_pairs = array();
	foreach ( self::$dependencies as $dependent => $dependencies ) {
		/*
		 * $dependent is in 'a/a.php' format. Dependencies are stored as slugs, i.e. 'a'.
		 *
		 * Convert $dependent to slug format for checking.
		 */
		$dependent_slug = self::convert_to_slug( $dependent );

		self::$circular_dependencies_pairs = array_merge(
			self::$circular_dependencies_pairs,
			self::check_for_circular_dependencies( array( $dependent_slug ), $dependencies )
		);
	}

	return self::$circular_dependencies_pairs;
}