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

Filters the id of the last order from a given customer.

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

add_filter( 'woocommerce_customer_get_last_order', 'wp_kama_woocommerce_customer_get_last_order_filter', 10, 2 );

/**
 * Function for `woocommerce_customer_get_last_order` filter-hook.
 * 
 * @param string      $user_meta @last_order_id The last order id as retrieved from the database.
 * @param WC_Customer $customer  The customer whose last order id is being retrieved.
 *
 * @return string
 */
function wp_kama_woocommerce_customer_get_last_order_filter( $user_meta, $customer ){

	// filter...
	return $user_meta;
}
$user_meta(строка)
@last_order_id The last order id as retrieved from the database.
$customer(WC_Customer)
The customer whose last order id is being retrieved.

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

WC_Customer_Data_Store::get_last_order()
woocommerce_customer_get_last_order
woocommerce/includes/data-stores/class-wc-customer-data-store.php 351-355
$last_order_id = apply_filters(
	'woocommerce_customer_get_last_order',
	get_user_meta( $customer->get_id(), '_last_order', true ),
	$customer
);

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

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