start_controls_section(
'funfacts',
[
'label' => esc_html__( 'Thinkai Funfacts', 'thinkai' ),
]
);
//Layout
$this->add_control(
'layout_control',
[
'label' => esc_html__( 'Layout Style', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => '1',
'options' => array(
'1' => esc_html__( 'Style One ', 'thinkai'),
'2' => esc_html__( 'Style Two ', 'thinkai'),
),
]
);
//Banner Carousel Repeater
$repeater = new Repeater();
$repeater->add_control(
'counter_value',
[
'label' => __( 'Counter Value', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Counter Value', 'thinkai' ),
]
);
$repeater->add_control(
'currency_unit',
[
'label' => __( 'Currency Unit', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Counter Value', 'thinkai' ),
]
);
//Text
$repeater->add_control(
'text',
[
'label' => __( 'Description', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Description', 'thinkai' ),
]
);
//Title
$repeater->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
$this->add_control(
'funfact',
[
'label' => __('Add Funfact Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'condition' => [
'layout_control' => '1'
],
'title_field' => '{{{ title }}}',
'default' => [
[
'counter_value' => esc_html__( '4.8', 'thinkai' ),
'currency_unit' => esc_html__( 'Million', 'thinkai' ),
'text' => esc_html__( 'Worldwide Users of
ThinkAi', 'thinkai' ),
'title' => esc_html__( 'Fun Numbers', 'thinkai' ),
],
[
'counter_value' => esc_html__( '174', 'thinkai' ),
'currency_unit' => esc_html__( 'User Territory', 'thinkai' ),
'text' => esc_html__( 'Worldwide Users of
ThinkAi', 'thinkai' ),
'title' => esc_html__( 'Fun Numbers', 'thinkai' ),
],
[
'counter_value' => esc_html__( '236', 'thinkai' ),
'currency_unit' => esc_html__( 'Million', 'thinkai' ),
'text' => esc_html__( 'Images Generated in
Last Year', 'thinkai' ),
'title' => esc_html__( 'Fun Numbers', 'thinkai' ),
],
],
]
);
//Banner Carousel Repeater
$repeater = new Repeater();
//Title
$repeater->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
//Text
$repeater->add_control(
'text',
[
'label' => __( 'Description', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Description', 'thinkai' ),
]
);
$repeater->add_control(
'counter_value',
[
'label' => __( 'Counter Value', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Counter Value', 'thinkai' ),
]
);
$repeater->add_control(
'currency_unit',
[
'label' => __( 'Currency Unit', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Counter Value', 'thinkai' ),
]
);
//Select Box
$repeater->add_control(
'style_two',
[
'label' => esc_html__( 'Choose Style', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'two',
'options' => array(
'one' => esc_html__( 'Sec Style ', 'thinkai'),
'two' => esc_html__( 'Percent Style ', 'thinkai'),
),
]
);
$this->add_control(
'funfact_v2',
[
'label' => __('Add Funfact Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'condition' => [
'layout_control' => '2'
],
'title_field' => '{{{ title }}}',
'default' => [
[
'title' => esc_html__( 'Savings Potential', 'thinkai' ),
'text' => esc_html__( 'We can help businesses reduce customer
service costs.', 'thinkai' ),
'counter_value' => esc_html__( '25', 'thinkai' ),
'currency_unit' => esc_html__( '%', 'thinkai' ),
],
[
'title' => esc_html__( 'Quick Responses', 'thinkai' ),
'text' => esc_html__( 'ThinkAi Provide immediate responses to
customer queries.', 'thinkai' ),
'counter_value' => esc_html__( '0.4', 'thinkai' ),
'currency_unit' => esc_html__( 'Sec', 'thinkai' ),
],
[
'title' => esc_html__( 'Business Adoption', 'thinkai' ),
'text' => esc_html__( 'Businesses are projected to use ThinkAi
in some capacity.', 'thinkai' ),
'counter_value' => esc_html__( '80', 'thinkai' ),
'currency_unit' => esc_html__( '%', 'thinkai' ),
],
],
]
);
$this->end_controls_section();
}
/**
* Render button widget output on the frontend.
* Written in PHP and used to generate the final HTML.
*
* @since 1.0.0
* @access protected
*/
protected function render() {
$settings = $this->get_settings_for_display();
$allowed_tags = wp_kses_allowed_html('post');
?>
$items):
if($count % 2) {
?>
-
-