Inventory_Presser_REST::add_inventory_type_slugs_to_posts()

Adds an attribute inventory_type_slugs to the response of the /wp-json/wp/v2/inventory_vehicle route.

On This Page


Return Return

(void)


Top ↑

Source Source

File: includes/class-rest.php

	public function add_inventory_type_slugs_to_posts() {
		register_rest_field(
			INVP::POST_TYPE,
			'inventory_type_slugs',
			array(
				'get_callback' => array( $this, 'get_the_type_slugs' ),
				'schema'       => array(
					'description' => __( 'The type taxonomy term slugs.', 'inventory-presser' ),
					'type'        => 'string',
				),
			)
		);
	}