Automattic\WooCommerce\Blocks\BlockTypes
Checkout::render() protected WC 1.0
Append frontend scripts when rendering the block.
{} Это метод класса: Checkout{}
Хуков нет.
Возвращает
Строку
. Rendered block type output.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->render( $attributes, $content );
- $attributes(массив) (обязательный)
- Block attributes.
- $content(строка) (обязательный)
- Block content.
Код Checkout::render() Checkout::render WC 5.2.2
protected function render( $attributes, $content ) {
if ( $this->is_checkout_endpoint() ) {
// Note: Currently the block only takes care of the main checkout form -- if an endpoint is set, refer to the
// legacy shortcode instead and do not render block.
return '[woocommerce_checkout]';
}
// Deregister core checkout scripts and styles.
wp_deregister_script( 'wc-checkout' );
wp_deregister_script( 'wc-password-strength-meter' );
wp_deregister_script( 'selectWoo' );
wp_deregister_style( 'select2' );
return $this->inject_html_data_attributes( $content . $this->get_skeleton(), $attributes );
}