/home/altere25/infinet.finance/wp-content/plugins/th-widget-pack/elements
Edit: /home/altere25/infinet.finance/wp-content/plugins/th-widget-pack/elements/testimonial.php (15525B)
get_name();
}
protected function _register_controls() {
$this->start_controls_section(
'section_testimonial',
[
'label' => __( 'Testimonial', 'th-widget-pack' ),
]
);
$this->add_control(
'testimonial_content',
[
'label' => __( 'Content', 'th-widget-pack' ),
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'rows' => '10',
'default' => __( '“Pellentesque vel purus vestibulum, commodo tellus iaculis, molestie nisi. Cras auctor, sapien eu ullamcorper tincidunt, eros felis congue arcu, id finibus libero neque ut tellus. Phasellus bibendum nibh tortor. Nam malesuada quam lorem, eu.”', 'th-widget-pack' ),
'placeholder' => __( '“Pellentesque vel purus vestibulum, commodo tellus iaculis, molestie nisi. Cras auctor, sapien eu ullamcorper tincidunt, eros felis congue arcu, id finibus libero neque ut tellus. Phasellus bibendum nibh tortor. Nam malesuada quam lorem, eu.”', 'th-widget-pack' ),
]
);
$this->add_control(
'text_size',
[
'label' => __( 'Content Size', 'th-widget-pack' ),
'type' => Controls_Manager::SELECT,
'options' => [
'sm' => __( 'Small', 'th-widget-pack' ),
'md' => __( 'Medium', 'th-widget-pack' ),
'lg' => __( 'Large', 'th-widget-pack' ),
],
'default' => 'md',
]
);
$this->add_control(
'star_rating',
[
'label' => __( 'Star Rating', 'th-widget-pack' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Yes', 'th-widget-pack' ),
'label_off' => __( 'No', 'th-widget-pack' ),
'return_value' => 'yes',
]
);
$this->add_control(
'rating',
[
'type' => Controls_Manager::SLIDER,
'default' => [
'size' => 5,
],
'range' => [
'px' => [
'min' => .5,
'max' => 5,
'step' => .5,
],
],
'condition' => [
'star_rating' => 'yes',
],
'dynamic' => [
'active' => true,
],
'separator' => 'none',
]
);
$this->add_control(
'star_rating_position',
[
'label' => __( 'Star Rating Position', 'th-widget-pack' ),
'type' => Controls_Manager::SELECT,
'options' => [
'top' => __( 'Top', 'th-widget-pack' ),
'bottom' => __( 'Bottom', 'th-widget-pack' ),
],
'default' => 'bottom',
'condition' => [
'star_rating' => 'yes',
],
]
);
$this->add_control(
'testimonial_image',
[
'label' => __( 'Add Image', 'th-widget-pack' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'testimonial_name',
[
'label' => __( 'Name', 'th-widget-pack' ),
'type' => Controls_Manager::TEXT,
'default' => 'Doug Martin',
'placeholder' => 'Doug Martin',
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'testimonial_job',
[
'label' => __( 'Job', 'th-widget-pack' ),
'type' => Controls_Manager::TEXT,
'default' => 'Customer',
'placeholder' => 'Customer',
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'testimonial_image_position',
[
'label' => __( 'Image Position', 'th-widget-pack' ),
'type' => Controls_Manager::SELECT,
'default' => 'aside',
'options' => [
'aside' => __( 'Aside', 'th-widget-pack' ),
'top' => __( 'Top', 'th-widget-pack' ),
],
'condition' => [
'testimonial_image[url]!' => '',
],
'separator' => 'before',
]
);
$this->add_control(
'testimonial_alignment',
[
'label' => __( 'Alignment', 'th-widget-pack' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'center',
'options' => [
'left' => [
'title' => __( 'Left', 'th-widget-pack' ),
'icon' => 'fa fa-align-left',
],
'center' => [
'title' => __( 'Center', 'th-widget-pack' ),
'icon' => 'fa fa-align-center',
],
'right' => [
'title' => __( 'Right', 'th-widget-pack' ),
'icon' => 'fa fa-align-right',
],
],
'selectors' => [
'{{WRAPPER}} .elementor-testimonial-wrapper' => 'text-align: {{VALUE}}',
],
]
);
$this->add_control(
'view',
[
'label' => __( 'View', 'th-widget-pack' ),
'type' => Controls_Manager::HIDDEN,
'default' => 'traditional',
]
);
$this->end_controls_section();
// Content
$this->start_controls_section(
'section_style_testimonial_content',
[
'label' => __( 'Content', 'th-widget-pack' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'section_text_heading',
[
'label' => __( 'Text', 'elementor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'content_content_color',
[
'label' => __( 'Color', 'th-widget-pack' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-testimonial-content' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'label' => __( 'Typography', 'elementor' ),
'name' => 'section_text_typography',
'selector' => '{{WRAPPER}} .elementor-testimonial-content',
]
);
$this->add_control(
'section_name_heading',
[
'label' => __( 'Name', 'elementor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'name_text_color',
[
'label' => __( 'Color', 'th-widget-pack' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-testimonial-name' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'label' => __( 'Typography', 'elementor' ),
'name' => 'section_name_text_typography',
'selector' => '{{WRAPPER}} .elementor-testimonial-name',
]
);
$this->add_control(
'section_job_heading',
[
'label' => __( 'Job', 'elementor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'job_text_color',
[
'label' => __( 'Color', 'th-widget-pack' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-testimonial-job' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'label' => __( 'Typography', 'elementor' ),
'name' => 'section_job_typography',
'selector' => '{{WRAPPER}} .elementor-testimonial-job',
]
);
$this->add_control(
'section_star_heading',
[
'label' => __( 'Star Rating', 'elementor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'star_rating_color',
[
'label' => __( 'Color', 'th-widget-pack' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .th-star-rating' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'section_image_heading',
[
'label' => __( 'Photo', 'elementor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Css_Filter::get_type(),
[
'name' => 'css_filters',
'label' => __( 'CSS Filters', 'elementor' ),
'selector' => '{{WRAPPER}} .th-team-member-image',
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
$settings = $this->get_settings_for_display();
$this->add_render_attribute( 'wrapper', 'class', 'elementor-testimonial-wrapper' );
$this->add_render_attribute( 'wrapper', 'class', 'th-testimonial-w' );
$this->add_render_attribute( 'wrapper', 'class', 'th-txt-'.esc_attr( $settings['text_size'] ) );
if ( $settings['testimonial_alignment'] ) {
$this->add_render_attribute( 'wrapper', 'class', 'elementor-testimonial-text-align-' . esc_attr( $settings['testimonial_alignment'] ) );
}
$this->add_render_attribute( 'meta', 'class', 'elementor-testimonial-meta' );
/*if ( $settings['testimonial_image']['url'] ) {
$this->add_render_attribute( 'meta', 'class', 'elementor-has-image' );
}*/
if ( isset( $settings['testimonial_image']['id']) && $settings['testimonial_image']['id'] > "" ) {
if ( $settings['testimonial_image']['id'] ) $image = wp_get_attachment_image( $settings['testimonial_image']['id'], 'th_img_sm_square', false, array( 'class' => 'th-team-member-image' ) );
}elseif ( ! empty( $settings['testimonial_image']['url'] ) ) {
$this->add_render_attribute( 'image', 'src', esc_url( $settings['testimonial_image']['url'] ) );
$this->add_render_attribute( 'image', 'alt', esc_attr( Control_Media::get_image_alt( $settings['testimonial_image'] ) ) );
$this->add_render_attribute( 'image', 'title', esc_attr( Control_Media::get_image_title( $settings['testimonial_image'] ) ) );
$this->add_render_attribute( 'image', 'class', 'th-team-member-image' );
$image = '
![]()
get_render_attribute_string( 'image' ) . '>';
}
if ( $settings['testimonial_image_position'] ) {
$this->add_render_attribute( 'meta', 'class', 'elementor-testimonial-image-position-' . esc_attr( $settings['testimonial_image_position'] ) );
}
$has_content = ! ! $settings['testimonial_content'];
$has_image = ! ! $settings['testimonial_image']['url'];
$has_name = ! ! $settings['testimonial_name'];
$has_job = ! ! $settings['testimonial_job'];
if ( ! $has_content && ! $has_image && ! $has_name && ! $has_job ) {
return;
}
if (isset( $settings['rating']) && isset($settings['rating']['size']) ) {
$th_rating = $settings['rating']['size'];
$th_rating = $th_rating*10;
$th_rating = sprintf("%02d", $th_rating);
$this->add_render_attribute( 'star-rating', 'class', 'th-star-rating th-star-' . esc_attr( $th_rating ) );
}
if ( $settings['star_rating_position'] == 'top' ) {
$this->add_render_attribute( 'star-rating', 'class', 'th-star-rating-top');
}
?>
get_render_attribute_string( 'star-rating' );
$th_rating_markup = "
get_render_attribute_string( 'star-rating' ) . ">\n";
$th_rating_markup .= "\n";
$th_rating_markup .= "\n";
$th_rating_markup .= "\n";
$th_rating_markup .= "\n";
$th_rating_markup .= "\n";
$th_rating_markup .= "
";
endif; ?>
get_render_attribute_string( 'wrapper' ); ?>>
get_render_attribute_string( 'meta' ); ?>>
get_name() ] = [
'conditions' => [ 'widgetType' => $this->get_name() ],
'fields' => [
[
'field' => 'testimonial_content',
'type' => __( 'Content', 'th-widget-pack' ),
'editor_type' => 'AREA'
],
[
'field' => 'testimonial_name',
'type' => __( 'Name', 'th-widget-pack' ),
'editor_type' => 'LINE'
],
[
'field' => 'testimonial_job',
'type' => __( 'Job', 'th-widget-pack' ),
'editor_type' => 'LINE'
],
],
];
return $widgets;
}
}
Plugin::instance()->widgets_manager->register_widget_type( new Themo_Widget_Testimonial() );