Automattic\WooCommerce\Api\Attributes
Internal{}└─ Metadata
[Attribute( Attribute::TARGET_CLASS | Attribute::TARGET_PROPERTY | Attribute::TARGET_CLASS_CONSTANT )]No Hooks.
Usage
$Internal = new Internal(); // use class methods
Methods
- public __construct()
- public transform_description( string $description )
Internal{} Internal{} code WC 10.9.1
class Internal extends Metadata {
/**
* Construct an `internal` metadata entry with value `true`.
*/
public function __construct() {
parent::__construct( 'internal', true );
}
/**
* Prepend `[Internal] ` 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 = 'For WooCommerce core internal usage only.';
}
return '[Internal] ' . $description;
}
}