Automattic\WooCommerce\Api\Attributes
Experimental{}└─ Metadata
[Attribute( Attribute::TARGET_CLASS | Attribute::TARGET_PROPERTY | Attribute::TARGET_CLASS_CONSTANT )]No Hooks.
Usage
$Experimental = new Experimental(); // use class methods
Methods
- public __construct()
- public transform_description( string $description )
Experimental{} Experimental{} code WC 10.9.1
class Experimental extends Metadata {
/**
* Construct an `experimental` metadata entry with value `true`.
*/
public function __construct() {
parent::__construct( 'experimental', true );
}
/**
* Prepend `[Experimental] ` to the description, supplying a default body
* when the element has no `#[Description]` of its own. See
* {@see Metadata::transform_description()} for the contract.
*
* @param string $description Incoming description (empty when no `#[Description]`).
*/
public function transform_description( string $description ): string {
if ( '' === $description ) {
$description = 'Not to be used in production environments.';
}
return '[Experimental] ' . $description;
}
}