WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Admin

CategoryLookup::get_term_insert_values() protected WC 1.0

Used to construct insert query recursively.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_term_insert_values( $inserts, $terms, $parents );
$inserts(array) (required) (passed by reference — &)
Array of data to insert.
$terms(array) (required)
Terms to insert.
$parents(array)
Parent IDs the terms belong to.
Default: array()

Code of CategoryLookup::get_term_insert_values() WC 5.8.0

protected function get_term_insert_values( &$inserts, $terms, $parents = array() ) {
	foreach ( $terms as $term ) {
		$insert_parents = array_merge( array( $term['term_id'] ), $parents );

		foreach ( $insert_parents as $parent ) {
			$inserts[] = array(
				$parent,
				$term['term_id'],
			);
		}

		$this->get_term_insert_values( $inserts, $term['descendants'], $insert_parents );
	}
}