WordPress at a glance
function is not described


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.


Array. Nothing.


// 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

protected function get_ancestors( $category_id ) {
	global $wpdb;

	return wp_parse_id_list(
				"SELECT category_tree_id FROM $wpdb->wc_category_lookup WHERE category_id = %d",