Automattic\WooCommerce\Internal\Orders
OrderActionsRestController::get_default_preferred_template_ids
Get the default preferred template IDs for auto-selection based on order status.
Метод класса: OrderActionsRestController{}
Хуков нет.
Возвращает
Строку[].
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_default_preferred_template_ids( $order ): array;
- $order(WC_Order) (обязательный)
- The order.
Код OrderActionsRestController::get_default_preferred_template_ids() OrderActionsRestController::get default preferred template ids WC 10.8.1
private function get_default_preferred_template_ids( WC_Order $order ): array {
$status = $order->get_status( 'edit' );
$preferred_template_ids = array();
// Status-specific template.
if ( isset( self::STATUS_TEMPLATE_MAP[ $status ] ) ) {
$preferred_template_ids[] = self::STATUS_TEMPLATE_MAP[ $status ]['id'];
}
// Generic fallback.
$preferred_template_ids[] = 'customer_invoice';
return $preferred_template_ids;
}