Automattic\WooCommerce\Internal\Admin

CategoryLookup::get_descendants()protectedWC 1.0

Get category descendants.

Method of the class: CategoryLookup{}

No Hooks.

Return

Array.

Usage

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

CategoryLookup::get_descendants() code WC 8.7.0

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

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