WP_Plugin_Dependencies::get_dependent_names()
Gets the names of plugins that require the plugin.
Метод класса: WP_Plugin_Dependencies{}
Хуков нет.
Возвращает
Массив
. An array of dependent names.
Использование
$result = WP_Plugin_Dependencies::get_dependent_names( $plugin_file );
- $plugin_file(строка) (обязательный)
- The plugin's filepath, relative to the plugins directory.
Список изменений
С версии 6.5.0 | Введена. |
Код WP_Plugin_Dependencies::get_dependent_names() WP Plugin Dependencies::get dependent names WP 6.8
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; }