WordPress at Your Fingertips
function is not described

WC_Data_Store_WP::get_term_ids() protected WC 3.0.0

Get and store terms from a taxonomy.

{} It's a method of the class: WC_Data_Store_WP{}

No Hooks.

Return

Array. of terms

Usage

// protected - for code of main (parent) or child class
$result = $this->get_term_ids( $object, $taxonomy );
$object(WC_Data|int) (required)
WC_Data object or object ID.
$taxonomy(string) (required)
Taxonomy name e.g. product_cat.

Changelog

Since 3.0.0 Introduced.

Code of WC_Data_Store_WP::get_term_ids() WC 5.8.0

protected function get_term_ids( $object, $taxonomy ) {
	if ( is_numeric( $object ) ) {
		$object_id = $object;
	} else {
		$object_id = $object->get_id();
	}
	$terms = get_the_terms( $object_id, $taxonomy );
	if ( false === $terms || is_wp_error( $terms ) ) {
		return array();
	}
	return wp_list_pluck( $terms, 'term_id' );
}