Automattic\WooCommerce\Api\Attributes

Deprecated{}finalWC 1.0#[Attribute]

Marks a field or enum value as deprecated in the GraphQL schema.

Deprecated elements remain functional but are flagged with a deprecation reason in introspection, signaling to API consumers that they should migrate to an alternative.

No Hooks.

Usage

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

Methods

  1. public __construct(
  2. ERROR: no method name found on line ``

Deprecated{} code WC 10.9.1

final class Deprecated {
	/**
	 * Constructor.
	 *
	 * @param string $reason A human-readable explanation of why the element is
	 *                       deprecated and what to use instead.
	 */
	public function __construct(
		public readonly string $reason,
	) {
	}
}