Automattic\WooCommerce\Blocks\BlockTypes
PaymentMethodIcons::render
Render the block.
Method of the class: PaymentMethodIcons{}
No Hooks.
Returns
String. Rendered block type output.
Usage
// protected - for code of main (parent) or child class $result = $this->render( $attributes, $content, $block );
- $attributes(array) (required)
- Block attributes.
- $content(string) (required)
- Block content.
- $block(WP_Block) (required)
- Block instance.
PaymentMethodIcons::render() PaymentMethodIcons::render code WC 10.3.6
protected function render( $attributes, $content, $block ) {
$payment_methods = $this->get_available_payment_methods();
if ( empty( $payment_methods ) ) {
return '';
}
$classes_and_styles = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes );
$wrapper_attributes = get_block_wrapper_attributes(
array(
'class' => esc_attr( $classes_and_styles['classes'] ),
'style' => esc_attr( $classes_and_styles['styles'] ),
)
);
$output = '<div ' . $wrapper_attributes . '>';
$output .= '<div class="wc-block-payment-method-icons">';
$output .= $this->render_payment_method_icons( $attributes );
$output .= '</div>';
$output .= '</div>';
return $output;
}