Automattic\WooCommerce\Internal\Abilities\Domain

ProductCreate::get_registration_argspublic staticWC 10.9.0

Get the ability registration arguments.

Method of the class: ProductCreate{}

No Hooks.

Returns

Array.

Usage

$result = ProductCreate::get_registration_args(): array;

Changelog

Since 10.9.0 Introduced.

ProductCreate::get_registration_args() code WC 11.0.1

public static function get_registration_args(): array {
	return array(
		'label'               => __( 'Create product', 'woocommerce' ),
		'description'         => __(
			'Create a product using supported catalog fields.',
			'woocommerce'
		),
		'category'            => 'woocommerce',
		'input_schema'        => self::get_input_schema(),
		'output_schema'       => self::get_entity_output_schema( 'product', self::get_product_output_schema() ),
		'execute_callback'    => array( __CLASS__, 'execute' ),
		'permission_callback' => array( __CLASS__, 'can_create_product' ),
		'meta'                => array(
			'show_in_rest' => true,
			'mcp'          => array(
				'public' => true,
				'type'   => 'tool',
			),
			'annotations'  => array(
				'readonly'    => false,
				'idempotent'  => false,
				'destructive' => false,
			),
		),
	);
}