woocommerce_order_item_name хук-фильтрWC 2.1.0

Email Order Item Name hook.

Использование

add_filter( 'woocommerce_order_item_name', 'wp_kama_woocommerce_order_item_name_filter', 10, 3 );

/**
 * Function for `woocommerce_order_item_name` filter-hook.
 * 
 * @param string        $product_name Product name.
 * @param WC_Order_Item $item         Order item object.
 * @param bool          $is_visible   Is item visible.
 *
 * @return string
 */
function wp_kama_woocommerce_order_item_name_filter( $product_name, $item, $is_visible ){

	// filter...
	return $product_name;
}
$product_name(строка)
Product name.
$item(WC_Order_Item)
Order item object.
$is_visible(true|false)
Is item visible.

Список изменений

С версии 2.1.0 Введена.
С версии 2.4.0 Added $is_visible parameter.

Где вызывается хук

В файле: /templates/emails/plain/email-fulfillment-items.php
woocommerce_order_item_name
woocommerce/templates/emails/plain/email-fulfillment-items.php 55
$product_name = apply_filters( 'woocommerce_order_item_name', $item->item->get_name(), $item->item, false );
woocommerce/src/Blocks/BlockTypes/OrderConfirmation/Totals.php 135-140
$item_name    = apply_filters(
	'woocommerce_order_item_name',
	$product_permalink ? sprintf( '<a href="%s">%s</a>', $product_permalink, $item->get_name() ) : $item->get_name(),
	$item,
	$is_visible
);
woocommerce/templates/emails/email-fulfillment-items.php 84
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->item->get_name(), $item->item, false ) );
woocommerce/templates/emails/plain/email-order-items.php 47
$product_name = apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false );
woocommerce/templates/emails/plain/email-order-items.php 73
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) );
woocommerce/templates/emails/email-order-items.php 71
$order_item_name = apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false );
woocommerce/templates/emails/email-order-items.php 155
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) );
woocommerce/templates/order/order-details-fulfillment-item.php 35
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $product_permalink ? sprintf( '<a href="%s">%s</a>', $product_permalink, $item->get_name() ) : $item->get_name(), $item, $is_visible ) );
woocommerce/templates/order/order-details-item.php 33
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $product_permalink ? sprintf( '<a href="%s">%s</a>', $product_permalink, $item->get_name() ) : $item->get_name(), $item, $is_visible ) );
woocommerce/templates/checkout/form-pay.php 43
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) );
woocommerce/includes/admin/meta-boxes/views/html-order-item.php 29
$item_name = apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, $is_visible );
woocommerce/includes/class-wc-structured-data.php 622
'name'  => wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, $is_visible ) ),

Где используется хук в WooCommerce

Использование не найдено.