get_prefixed_hook( 'controllers/starts' ), [ & $this ] ); $this->start_controls_section( 'section_content', [ 'label' => __( 'Template', 'absolute-addons' ), ] ); $counter_styles = apply_filters( $this->get_prefixed_hook( 'styles' ), [ 'one' => esc_html__( 'Style One', 'absolute-addons' ), 'two' => esc_html__( 'Style Two', 'absolute-addons' ), 'three-pro' => esc_html__( 'Style Three (Pro)', 'absolute-addons' ), 'four-pro' => esc_html__( 'Style Four (Pro)', 'absolute-addons' ), 'five' => esc_html__( 'Style Five', 'absolute-addons' ), 'six' => esc_html__( 'Style Six', 'absolute-addons' ), 'seven' => esc_html__( 'Style Seven', 'absolute-addons' ), 'eight-pro' => esc_html__( 'Style Eight (Pro)', 'absolute-addons' ), 'nine' => esc_html__( 'Style Nine', 'absolute-addons' ), ] ); $this->add_control( 'absolute_counter', [ 'label' => esc_html__( 'Counter Style', 'absolute-addons' ), 'label_block' => true, 'type' => Absp_Control_Styles::TYPE, 'options' => $counter_styles, 'default' => 'one', ] ); $this->init_pro_alert( [ 'three-pro', 'four-pro', 'eight-pro', ] ); $this->end_controls_section(); $this->start_controls_section( 'content_section', [ 'label' => __( 'Content Section', 'absolute-addons' ), 'condition' => [ 'absolute_counter' => [ 'one', 'two', 'four' ], ], ] ); $this->add_control( 'counter_title', [ 'label' => esc_html__( 'Counter Title', 'absolute-addons' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => esc_html__( 'Loved by', 'absolute-addons' ), 'condition' => [ 'absolute_counter' => [ 'one', 'two', 'four' ], ], ] ); $this->add_control( 'counter_sub_title', [ 'label' => esc_html__( 'Counter Secondary Title', 'absolute-addons' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => esc_html__( 'Completed', 'absolute-addons' ), 'condition' => [ 'absolute_counter' => [ 'four' ], ], ] ); $this->add_control( 'counter_number', [ 'label' => esc_html__( 'Counter Number', 'absolute-addons' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( '169', 'absolute-addons' ), 'condition' => [ 'absolute_counter' => [ 'one', 'two', 'four' ], ], ] ); $this->add_control( 'counter_number_speed', [ 'label' => esc_html__( 'Counter Number Speed', 'absolute-addons' ), 'type' => Controls_Manager::NUMBER, 'default' => esc_html__( '1500', 'absolute-addons' ), 'condition' => [ 'absolute_counter' => [ 'one', 'two', 'four' ], ], ] ); $this->add_control( 'counter_suffix', [ 'label' => esc_html__( 'Counter Suffix', 'absolute-addons' ), 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'Plus', 'absolute-addons' ), 'default' => '', 'condition' => [ 'absolute_counter' => [ 'one', 'two', 'four' ], ], ] ); $this->add_control( 'counter_icon_select', [ 'label' => esc_html__( 'Select Icon', 'absolute-addons' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'true' => esc_html__( 'Yes', 'absolute-addons' ), 'false' => esc_html__( 'No', 'absolute-addons' ), ], 'default' => 'true', 'condition' => [ 'absolute_counter' => 'one', ], ] ); $this->add_control( 'counter_icon', [ 'label' => esc_html__( 'Icon', 'absolute-addons' ), 'type' => Controls_Manager::ICONS, 'fa4compatibility' => 'absolute-addons', 'default' => [ 'value' => 'fa fa-heart', 'library' => 'solid', ], 'condition' => [ 'counter_icon_select' => 'true', 'absolute_counter' => 'one', ], ] ); $this->add_control( 'counter_link_select', [ 'label' => esc_html__( 'Link Select', 'absolute-addons' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'true' => esc_html__( 'Yes', 'absolute-addons' ), 'false' => esc_html__( 'No', 'absolute-addons' ), ], 'default' => 'true', 'condition' => [ 'absolute_counter' => 'two', ], ] ); $this->add_control( 'link_text', [ 'label' => __( 'Link Text', 'absolute-addons' ), 'type' => Controls_Manager::TEXT, 'default' => 'READ MORE', 'condition' => [ 'counter_link_select' => 'true', 'absolute_counter' => 'two', ], ] ); $this->add_control( 'link', [ 'label' => __( 'Link', 'absolute-addons' ), 'type' => Controls_Manager::URL, 'placeholder' => __( 'https://your-link.com', 'absolute-addons' ), 'condition' => [ 'counter_link_select' => 'true', 'absolute_counter' => 'two', ], 'show_label' => false, ] ); $this->end_controls_section(); $this->render_controller( 'three' ); $this->render_controller( 'five' ); $this->render_controller( 'six' ); $this->render_controller( 'seven' ); $this->render_controller( 'eight' ); $this->render_controller( 'nine' ); $this->render_controller( 'template-counter-style' ); /** * Fires after controllers are registered. * * @param Absoluteaddons_Style_Counter $this Current instance of WP_Network_Query (passed by reference). * * @since 1.0.0 * */ do_action_ref_array( $this->get_prefixed_hook( 'controllers/ends' ), [ & $this ] ); } /** * Render the widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.1.0 * * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $style = $settings['absolute_counter']; $this->add_render_attribute( [ 'absp-counterup' => [ 'class' => 'count count-number', 'data-delay' => '10', 'data-time' => $settings['counter_number_speed'], ], ] ); ?>