attribute['st_panel_position'] ) ? esc_attr( $this->attribute['st_panel_position'] ) : 'right'; $toggle_type = esc_attr( $this->attribute['sg_setting_open_type'] ); $close_icon = $this->render_icon_element( $this->attribute['sg_setting_close_icon'] ); $template = Plugin::$instance->frontend->get_builder_content( $this->attribute['sg_setting_template'], true ); $link_attr = array( 'url' => '#', 'is_external' => '', 'nofollow' => '', 'custom_attributes' => 'aria-label|Off Canvas Button', ); if ( 'icon' === $toggle_type ) { $icon = $this->render_icon_element( $this->attribute['sg_setting_open_icon'] ); if ( ! empty( $icon ) ) { $toggle_item = $icon; } } else { $toggle_item = esc_attr( $this->attribute['sg_setting_open_text'] ); } if ( 'gradient' === $this->attribute['st_open_normal_background_background_background'] || 'gradient' === $this->attribute['st_open_hover_background_background_background'] ) { $class_toggle .= ' hover-gradient'; $toggle_item = '' . $toggle_item . ''; } $toggle = $this->render_url_element( $link_attr, null, $class_toggle, $toggle_item ); if ( ! empty( $close_icon ) ) { $class_close_button = 'offcanvas-close-button'; if ( 'gradient' === $this->attribute['st_close_normal_background_background_background'] || 'gradient' === $this->attribute['st_close_hover_background_background_background'] ) { $class_close_button .= ' hover-gradient'; $close_icon = '' . $close_icon . ''; } $close_icon = $this->render_url_element( $link_attr, null, $class_close_button, $close_icon ); } $content = '
' . $toggle . '
'; return $this->render_wrapper( 'off-canvas', $content ); } }