WC_Admin_List_Table_Products::render_product_cat_column()protectedWC 1.0

Render column: product_cat.

Method of the class: WC_Admin_List_Table_Products{}

Hooks from the method

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->render_product_cat_column();

WC_Admin_List_Table_Products::render_product_cat_column() code WC 9.3.3

protected function render_product_cat_column() {
	$terms = get_the_terms( $this->object->get_id(), 'product_cat' );
	if ( ! $terms ) {
		echo '<span class="na">&ndash;</span>';
	} else {
		$termlist = array();
		foreach ( $terms as $term ) {
			$termlist[] = '<a href="' . esc_url( admin_url( 'edit.php?product_cat=' . $term->slug . '&post_type=product' ) ) . ' ">' . esc_html( $term->name ) . '</a>';
		}

		echo apply_filters( 'woocommerce_admin_product_term_list', implode( ', ', $termlist ), 'product_cat', $this->object->get_id(), $termlist, $terms ); // WPCS: XSS ok.
	}
}