W3cubDocs

/WordPress

WP_Plugin_Dependencies::get_dependencies( string $plugin_file ): array

Gets the slugs of plugins that the dependent requires.

Parameters

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

Return

array An array of dependency plugin slugs.

Source

public static function get_dependencies( $plugin_file ) {
	if ( isset( self::$dependencies[ $plugin_file ] ) ) {
		return self::$dependencies[ $plugin_file ];
	}

	return array();
}

Changelog

Version Description
6.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_dependencies