Automattic\WooCommerce\Internal\Admin\Settings
Utils::generate_testing_plugin_slugs
Generate a list of testing plugin slugs from a standard/official plugin slug.
Метод класса: Utils{}
Хуков нет.
Возвращает
Строку[]. The list of testing plugin slugs generated from the standard/official plugin slug.
Использование
$result = Utils::generate_testing_plugin_slugs( $slug, $include_original ): array;
- $slug(строка) (обязательный)
- The standard/official plugin slug. Most likely the WPORG slug.
- $include_original(true|false)
- Whether to include the original slug in the list. If true, the original slug will be the first item in the list.
По умолчанию:false
Код Utils::generate_testing_plugin_slugs() Utils::generate testing plugin slugs WC 10.5.0
public static function generate_testing_plugin_slugs( string $slug, bool $include_original = false ): array {
$slugs = array();
if ( $include_original ) {
$slugs[] = $slug;
}
foreach ( self::get_testing_plugin_slug_suffixes() as $suffix ) {
$slugs[] = $slug . $suffix;
}
return $slugs;
}