Title: WP_Plugin_Dependencies::get_dependent_names
Published: April 3, 2024
Last modified: February 24, 2026

---

# WP_Plugin_Dependencies::get_dependent_names( string $plugin_file ): array

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_dependent_names/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_dependent_names/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_dependent_names/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_dependent_names/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_dependent_names/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_dependent_names/?output_format=md#wp--skip-link--target)

Gets the names of plugins that require the plugin.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_dependent_names/?output_format=md#parameters)󠁿

 `$plugin_file`stringrequired

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

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_dependent_names/?output_format=md#return)󠁿

 array An array of dependent names.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_dependent_names/?output_format=md#source)󠁿

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

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-plugin-dependencies.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-plugin-dependencies.php#L283)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-plugin-dependencies.php#L283-L294)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_dependent_names/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_Plugin_Dependencies::convert_to_slug()](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/convert_to_slug/)`wp-includes/class-wp-plugin-dependencies.php` |

Converts a plugin filepath to a slug.

  | 
| [WP_Plugin_Dependencies::get_plugins()](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_plugins/)`wp-includes/class-wp-plugin-dependencies.php` |

Gets data for installed plugins.

  | 
| [WP_Plugin_Dependencies::get_dependents()](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_dependents/)`wp-includes/class-wp-plugin-dependencies.php` |

Gets filepaths of plugins that require the dependency.

  |

| Used by | Description | 
| [WP_Plugins_List_Table::add_dependents_to_dependency_plugin_row()](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/add_dependents_to_dependency_plugin_row/)`wp-admin/includes/class-wp-plugins-list-table.php` |

Prints a list of other plugins that depend on the plugin.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/get_dependent_names/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.5.0](https://developer.wordpress.org/reference/since/6.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_plugin_dependencies%2Fget_dependent_names%2F)
before being able to contribute a note or feedback.