WC_Admin_List_Table_Products::render_product_tag_column
Render column: product_tag.
Метод класса: WC_Admin_List_Table_Products{}
Хуки из метода
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->render_product_tag_column();
Код WC_Admin_List_Table_Products::render_product_tag_column() WC Admin List Table Products::render product tag column WC 11.2.2
protected function render_product_tag_column() {
$terms = get_the_terms( $this->object->get_id(), 'product_tag' );
if ( ! $terms ) {
echo '<span class="na">–</span>';
} else {
$termlist = array();
foreach ( $terms as $term ) {
$termlist[] = '<a href="' . esc_url( admin_url( 'edit.php?product_tag=' . $term->slug . '&post_type=product' ) ) . '">' . esc_html( $term->name ) . '</a>';
}
/**
* Filters the term list rendered in the products list table taxonomy column.
*
* @since 3.3.0
*
* @param string $term_list Comma separated list of escaped term links.
* @param string $taxonomy Taxonomy the terms belong to.
* @param int $product_id ID of the product the terms are rendered for.
* @param string[] $termlist Individual escaped term links.
* @param WP_Term[]|WP_Error $terms Term objects assigned to the product, or the WP_Error returned by get_the_terms().
*/
echo apply_filters( 'woocommerce_admin_product_term_list', implode( ', ', $termlist ), 'product_tag', $this->object->get_id(), $termlist, $terms ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Term names and links are escaped above; the filter returns extension-controlled markup by design.
}
}