Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation
DownloadsWrapper::render_content
This renders the content of the downloads wrapper.
Method of the class: DownloadsWrapper{}
No Hooks.
Returns
null. Nothing (null).
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:''
DownloadsWrapper::render_content() DownloadsWrapper::render content code WC 10.5.0
protected function render_content( $order, $permission = false, $attributes = [], $content = '' ) {
$show_downloads = $order && $order->has_downloadable_item() && $order->is_download_permitted();
if ( ! $show_downloads || ! $permission ) {
return '';
}
return $content;
}