Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation
Downloads::render_content()
This renders the content of the block within the wrapper.
Method of the class: Downloads{}
No Hooks.
Return
String
.
Usage
// protected - for code of main (parent) or child class $result = $this->render_content( $order, $permission, $attributes, $content );
- $order(\WC_Order) (required)
- Order object.
- $permission(string|false)
- If the current user can view the order details or not.
Default: false - $attributes(array)
- Block attributes.
Default: [] - $content(string)
- Original block content.
Default: ''
Downloads::render_content() Downloads::render content code WC 9.6.1
protected function render_content( $order, $permission = false, $attributes = [], $content = '' ) { $show_downloads = $order && $order->has_downloadable_item() && $order->is_download_permitted(); $downloads = $order ? $order->get_downloadable_items() : []; if ( ! $permission || ! $show_downloads ) { return $this->render_content_fallback(); } $classes_and_styles = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes, [ 'border_color', 'border_radius', 'border_width', 'border_style', 'background_color', 'text_color' ] ); return ' <table cellspacing="0" class="wc-block-order-confirmation-downloads__table ' . esc_attr( $classes_and_styles['classes'] ) . '" style="' . esc_attr( $classes_and_styles['styles'] ) . '"> <thead> <tr> ' . $this->render_order_downloads_column_headers( $order ) . ' </td> </thead> <tbody> ' . $this->render_order_downloads( $order, $downloads ) . ' </tbody> </table> '; }