WC_REST_Terms_Controller::get_terms_for_product( array $prepared_args, WP_REST_Request $request )

Get the terms attached to a product.


Description Description

This is an alternative to get_terms() that uses get_the_terms() instead, which hits the object cache. There are a few things not supported, notably include, exclude. In self::get_items() these are instead treated as a full query.


Parameters Parameters

$prepared_args

(Required) Arguments for get_terms().

$request

(Required) Full details about the request.


Top ↑

Return Return

(array) List of term objects. (Total count in $this->total_terms).


Top ↑

Source Source

File: includes/rest-api/Controllers/Version3/class-wc-rest-terms-controller.php


			


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.