Automattic\WooCommerce\Api\Attributes

Internal{}WC 1.0└─ Metadata

[Attribute( Attribute::TARGET_CLASS | Attribute::TARGET_PROPERTY | Attribute::TARGET_CLASS_CONSTANT )]

No Hooks.

Usage

$Internal = new Internal();
// use class methods

Methods

  1. public __construct()
  2. public transform_description( string $description )

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