Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation
AdditionalFieldsWrapper::render_content()
This renders the content of the downloads wrapper.
Метод класса: AdditionalFieldsWrapper{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->render_content( $order, $permission, $attributes, $content );
- $order(\WC_Order) (обязательный)
- Order object.
- $permission(строка|false)
- If the current user can view the order details or not.
По умолчанию: false - $attributes(массив)
- Block attributes.
По умолчанию: [] - $content(строка)
- Original block content.
По умолчанию: ''
Код AdditionalFieldsWrapper::render_content() AdditionalFieldsWrapper::render content WC 9.4.2
protected function render_content( $order, $permission = false, $attributes = [], $content = '' ) { if ( ! $permission ) { return ''; } // Contact and additional fields are currently grouped in this section. // If none of the additional fields for contact or order have values then the "Additional fields' section should // not show in the order confirmation. $additional_field_values = array_merge( Package::container()->get( CheckoutFields::class )->get_order_additional_fields_with_values( $order, 'contact' ), Package::container()->get( CheckoutFields::class )->get_order_additional_fields_with_values( $order, 'order' ) ); return empty( $additional_field_values ) ? '' : $content; }