WordPress at a glance
function is not described

Automattic\WooCommerce\Admin

CategoryLookup::get_ancestors() protected WC 1.0

Return all ancestor category ids for a category.

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

No Hooks.

Return

Array. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_ancestors( $category_id );
$category_id(int) (required)
The category ID to lookup.

Code of CategoryLookup::get_ancestors() WC 5.3.0

<?php
protected function get_ancestors( $category_id ) {
	global $wpdb;

	return wp_parse_id_list(
		$wpdb->get_col(
			$wpdb->prepare(
				"SELECT category_tree_id FROM $wpdb->wc_category_lookup WHERE category_id = %d",
				$category_id
			)
		)
	);
}