attribute['sg_setting_html_tag'] ) && ! empty( $this->attribute['sg_setting_html_tag'] ) ? \Elementor\Utils::validate_html_tag( $this->attribute['sg_setting_html_tag'] ) : 'h2'; $title = esc_attr( $this->attribute['sg_content_title'] ); $alignment = esc_attr( $this->attribute['sg_setting_alignment'] ); $hover_direction = esc_attr( $this->attribute['st_background_hover_direction'] ); $hover_animation = esc_attr( $this->attribute['st_background_hover_animation'] ); $icon_hover_animation = esc_attr( $this->attribute['st_icon_hover_animation'] ); $icon_type = esc_attr( $this->attribute['sg_icon_type'] ); $icon = 'none' !== $icon_type ? '
' . $this->render_icon() . '
' : ''; $output = '
' . $icon . '
' . $this->render_number() . '
<' . $title_tag . ' class="title">' . $title . '
' . $this->render_border_bottom(); return $this->render_wrapper( 'fun-fact', $output, array( 'align-' . $alignment, 'hover-from-' . $hover_direction, 'elementor-animation-' . $hover_animation ) ); } /** * Render Icon * * @return mixed */ private function render_icon() { $icon = null; if ( 'icon' === $this->attribute['sg_icon_type'] ) { $icon = $this->render_icon_element( $this->attribute['sg_icon_choose'] ); } elseif ( 'image' === $this->attribute['sg_icon_type'] ) { $image_size = $this->attribute['sg_icon_image_size_imagesize_size']; $icon = $this->render_image_element( $this->attribute['sg_icon_image'], $image_size ); } return $icon; } /** * Render Number * * @return string */ private function render_number() { $animation_duration = isset( $this->attribute['sg_setting_number_aniamtion_duration']['size'] ) ? esc_attr( $this->attribute['sg_setting_number_aniamtion_duration']['size'] ) : 3500; $super = 'yes' === $this->attribute['sg_setting_enable_super'] ? '' . esc_attr( $this->attribute['sg_content_super'] ) . '' : ''; $prefix = '' . $this->attribute['sg_content_number_prefix'] . ''; $suffix = '' . $this->attribute['sg_content_number_suffix'] . ''; return $prefix . ' 0 ' . $suffix . $super; } /** * Render Border Bottom * * @return mixed */ private function render_border_bottom() { $border_bottom = null; if ( 'yes' === $this->attribute['sg_setting_enable_hover_border_bottom'] ) { $border_bottom = '
'; } return $border_bottom; } }