';
}
/**
* Get heading
*
* @return string
*/
public function get_heading(): string {
$html = '';
$slide_heading = $this->get_prop( 'slide_heading' );
if ( empty( $slide_heading ) ) {
return $html;
}
$styles = [
'--cs-heading-font-size' => (int) $this->get_prop( 'heading_font_size', 40 ) . 'px',
'--cs-heading-gutter' => $this->get_prop( 'heading_gutter', '30px' ),
'--cs-heading-color' => $this->get_prop( 'heading_color', '#ffffff' ),
];
$html .= '
';
$html .= wp_kses_post( $slide_heading );
$html .= '
';
return $html;
}
/**
* Get slide description
*
* @return string
*/
public function get_description(): string {
$html = '';
$slide_description = $this->get_prop( 'slide_description' );
if ( empty( $slide_description ) ) {
return $html;
}
$styles = [
'--cs-description-font-size' => (int) $this->get_prop( 'description_font_size', 20 ) . 'px',
'--cs-description-gutter' => $this->get_prop( 'description_gutter', '30px' ),
'--cs-description-color' => $this->get_prop( 'description_color', '#ffffff' ),
];
$html .= '
';
$html .= wp_kses_post( $slide_description );
$html .= '
';
return $html;
}
/**
* Button one content
*
* @return string
*/
public function get_button_one(): string {
$html = '';
$url = $this->get_prop( 'button_one_url' );
if ( ! Validate::url( $url ) ) {
return $html;
}
$btn_text = $this->get_prop( 'button_one_text' );
$target = $this->get_prop( 'button_one_target', '_self' );
$classes = 'button cs-hero-button';
$classes .= ' cs-hero-button-' . $this->get_item_id() . '-1';
$classes .= ' cs-hero-button-' . $this->get_prop( 'button_one_type', 'normal' );
$classes .= ' cs-hero-button-' . $this->get_prop( 'button_one_size', 'medium' );
$style = [
'--cs-button-bg-color' => $this->get_prop( 'button_one_bg_color', '#00d1b2' ),
'--cs-button-color' => $this->get_prop( 'button_one_color', '#ffffff' ),
'--cs-button-border-width' => $this->get_prop( 'button_one_border_width', '0px' ),
'--cs-button-border-radius' => $this->get_prop( 'button_one_border_radius', '3px' ),
];
$html .= '
';
$html .= '' . esc_html( $btn_text ) . '';
$html .= '';
return $html;
}
/**
* Button two content
*
* @return string
*/
public function get_button_two(): string {
$html = '';
$url = $this->get_prop( 'button_two_url' );
if ( ! Validate::url( $url ) ) {
return $html;
}
$text = $this->get_prop( 'button_two_text' );
$target = $this->get_prop( 'button_two_target', '_self' );
$classes = 'button cs-hero-button';
$classes .= ' cs-hero-button-' . $this->get_item_id() . '-2';
$classes .= ' cs-hero-button-' . $this->get_prop( 'button_two_type', 'normal' );
$classes .= ' cs-hero-button-' . $this->get_prop( 'button_two_size', 'medium' );
$style = [
'--cs-button-bg-color' => $this->get_prop( 'button_two_bg_color', '#00d1b2' ),
'--cs-button-color' => $this->get_prop( 'button_two_color', '#ffffff' ),
'--cs-button-border-width' => $this->get_prop( 'button_two_border_width', '0px' ),
'--cs-button-border-radius' => $this->get_prop( 'button_two_border_radius', '3px' ),
];
$html .= '
';
$html .= '' . esc_html( $text ) . '';
$html .= '';
return $html;
}
/**
* Get cell start html
*
* @return string
*/
public function get_cell_start(): string {
$link_type = $this->get_link_type();
$slide_link = $this->get_prop( 'slide_link' );
$link_target = $this->get_prop( 'link_target', '_self' );
$is_full_link = 'full' === $link_type && Validate::url( $slide_link );
$cell_attr = [
'class' => 'carousel-slider-hero__cell hero__cell-' . $this->get_item_id(),
'style' => '--cell-height: ' . $this->get_slide_height(),
];
if ( $is_full_link ) {
$cell_attr = array_merge(
$cell_attr,
[
'href' => $slide_link,
'target' => $link_target,
]
);
}
return '<' . ( $is_full_link ? 'a' : 'div' ) . ' ' . join(
' ',
Helper::array_to_attribute( $cell_attr )
) . '>';
}
/**
* Get cell end html
*
* @return string
*/
public function get_cell_end(): string {
$is_full_link = 'full' === $this->get_link_type() && Validate::url( $this->get_prop( 'slide_link' ) );
return $is_full_link ? '' : '
'; // .carousel-slider-hero__cell
}
}