WP_Plugin_Dependencies::get_circular_dependencies(): array[]

In this article

Gets circular dependency data.

Return

array[] An array of circular dependency pairings.

Source

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

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

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