WP_Plugin_Dependencies::has_circular_dependency( string $plugin_file ): bool

In this article

Determines whether the plugin has a circular dependency.

Parameters

$plugin_filestringrequired
The plugin’s filepath, relative to the plugins directory.

Return

bool Whether the plugin has a circular dependency.

Source

public static function has_circular_dependency( $plugin_file ) {
	if ( ! is_array( self::$circular_dependencies_slugs ) ) {
		self::get_circular_dependencies();
	}

	if ( ! empty( self::$circular_dependencies_slugs ) ) {
		$slug = self::convert_to_slug( $plugin_file );

		if ( in_array( $slug, self::$circular_dependencies_slugs, true ) ) {
			return true;
		}
	}

	return false;
}

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

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