Automattic\WooCommerce\Api\Attributes

Metadata::shows_in_metadata_querypublicWC 1.0

Whether the element carrying this attribute should appear in the _apiMetadata discovery query.

Returning false removes the element's row entirely from _apiMetadata — neither this metadata entry nor any other descriptor on the same target surfaces. The runtime gates and any description transforms are unaffected. Useful for plugins that attach internal routing or feature hints they prefer not to broadcast through the discovery channel.

Despite the colloquial naming around it, this has nothing to do with native GraphQL introspection (__schema / __type); those queries continue to expose the schema's shape as usual.

Because this is an instance method, subclasses can decide conditionally based on their own constructor arguments.

Method of the class: Metadata{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Metadata = new Metadata();
$Metadata->shows_in_metadata_query(): bool;

Metadata::shows_in_metadata_query() code WC 10.9.1

public function shows_in_metadata_query(): bool {
	return true;
}