woocommerce_order_class хук-фильтрWC 1.0

Filter classname so that the class can be overridden if extended.

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

add_filter( 'woocommerce_order_class', 'wp_kama_woocommerce_order_class_filter', 10, 3 );

/**
 * Function for `woocommerce_order_class` filter-hook.
 * 
 * @param $classname  $classname  Order classname.
 * @param $order_type $order_type Order type.
 * @param $order_id   $order_id   Order ID.
 *
 * @return $classname
 */
function wp_kama_woocommerce_order_class_filter( $classname, $order_type, $order_id ){

	// filter...
	return $classname;
}
$classname($classname)
Order classname.
$order_type($order_type)
Order type.
$order_id($order_id)
Order ID.

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

WC_Order_Factory::get_class_name_for_order_id()
woocommerce_order_class
woocommerce/includes/class-wc-order-factory.php 194
$classname = apply_filters( 'woocommerce_order_class', $classname, $order_type, $order_id );

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

woocommerce/src/Admin/Overrides/Order.php 82
add_filter( 'woocommerce_order_class', array( __CLASS__, 'order_class_name' ), 10, 3 );
woocommerce/src/Admin/Overrides/OrderRefund.php 34
add_filter( 'woocommerce_order_class', array( __CLASS__, 'order_class_name' ), 10, 3 );