Automattic\WooCommerce\Internal\Admin\Settings

Utils::generate_testing_plugin_slugspublic staticWC 1.0

Generate a list of testing plugin slugs from a standard/official plugin slug.

Method of the class: Utils{}

No Hooks.

Returns

String[]. The list of testing plugin slugs generated from the standard/official plugin slug.

Usage

$result = Utils::generate_testing_plugin_slugs( $slug, $include_original ): array;
$slug(string) (required)
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.
Default: false

Utils::generate_testing_plugin_slugs() code WC 9.9.3

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