array( $this, 'render_counter_block' ), 'attributes' => array( 'showText' => array( 'type' => 'boolean', 'default' => false, ), 'icon' => array( 'type' => 'string', 'default' => 'heart', ), ), ) ); } } /** * Render counter block for Gutenberg * * @param array $attributes Block attributes. * @return string Rendered block HTML. */ public function render_counter_block( $attributes ) { $show_text = isset( $attributes['showText'] ) && $attributes['showText'] ? 'yes' : 'no'; $icon = isset( $attributes['icon'] ) ? $attributes['icon'] : 'heart'; return do_shortcode( '[airy_wishlist_counter show_text="' . $show_text . '" icon="' . $icon . '"]' ); } }