W3cubDocs

/WordPress

WP_Plugin_Dependencies::get_dependents( string $slug ): array

Gets filepaths of plugins that require the dependency.

Parameters

$slugstringrequired
The dependency’s slug.

Return

array An array of dependent plugin filepaths, relative to the plugins directory.

Source

public static function get_dependents( $slug ) {
	$dependents = array();

	foreach ( (array) self::$dependencies as $dependent => $dependencies ) {
		if ( in_array( $slug, $dependencies, true ) ) {
			$dependents[] = $dependent;
		}
	}

	return $dependents;
}

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_dependents