WP_Plugin_Dependencies::get_dependent_names( string $plugin_file ): array

In this article

Gets the names of plugins that require the plugin.

Parameters

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

Return

array An array of dependent names.

Source

public static function get_dependent_names( $plugin_file ) {
	$dependent_names = array();
	$plugins         = self::get_plugins();
	$slug            = self::convert_to_slug( $plugin_file );

	foreach ( self::get_dependents( $slug ) as $dependent ) {
		$dependent_names[ $dependent ] = $plugins[ $dependent ]['Name'];
	}
	sort( $dependent_names );

	return $dependent_names;
}

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

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