Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation
AdditionalFields::render_content
This renders the content of the block within the wrapper.
Метод класса: AdditionalFields{}
Хуков нет.
Возвращает
Строку.
Использование
// 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.
По умолчанию: ''
Код AdditionalFields::render_content() AdditionalFields::render content WC 10.4.3
protected function render_content( $order, $permission = false, $attributes = [], $content = '' ) {
if ( ! $permission ) {
return $content;
}
/**
* Service class managing checkout fields and its related extensibility points.
*
* @var CheckoutFields $controller
*/
$controller = Package::container()->get( CheckoutFields::class );
$content .= $this->render_additional_fields(
$controller->filter_fields_for_order_confirmation(
array_merge(
$controller->get_order_additional_fields_with_values( $order, 'contact', 'other', 'view' ),
$controller->get_order_additional_fields_with_values( $order, 'order', 'other', 'view' ),
),
array(
'caller' => 'AdditionalFields::render_content',
'order' => $order,
'permission' => $permission,
'attributes' => $attributes,
)
)
);
return $content;
}