PluginProbe
SureDonation – Donation Forms, Fundraising Campaigns & Donor Management / 1.5.1
SureDonation – Donation Forms, Fundraising Campaigns & Donor Management v1.5.1
1.6.1 1.6.0 1.5.1 1.5.0 1.4.0 1.3.0 trunk 0.0.1 1.0.0 1.1.0 1.1.1 1.1.2 1.2.0
suredonation / inc / page-builders / elementor / widgets / campaign-donate-button-widget.php

campaign-donate-button-widget.php in SureDonation – Donation Forms, Fundraising Campaigns & Donor Management 1.5.1, at inc/page-builders/elementor/widgets/campaign-donate-button-widget.php

91 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Elementor widget: Campaign Donate Button.
4 *
5 * @package SureDonation
6 * @since 1.2.0
7 */
8
9 namespace SureDonation\Inc\Page_Builders\Elementor\Widgets;
10
11 use Elementor\Controls_Manager;
12 use SureDonation\Inc\Page_Builders\Elementor\Base_Widget;
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit; // Exit if accessed directly.
16 }
17
18 /**
19 * Campaign_Donate_Button_Widget class.
20 *
21 * @since 1.2.0
22 */
23 class Campaign_Donate_Button_Widget extends Base_Widget {
24 /**
25 * {@inheritDoc}
26 */
27 public function get_name() {
28 return 'suredonation-campaign-donate-button';
29 }
30
31 /**
32 * {@inheritDoc}
33 */
34 public function get_title() {
35 return esc_html__( 'Campaign Donate Button', 'suredonation' );
36 }
37
38 /**
39 * {@inheritDoc}
40 */
41 public function get_icon() {
42 return 'eicon-button';
43 }
44
45 /**
46 * {@inheritDoc}
47 */
48 protected function block_name() {
49 return 'suredonation/campaign-donate-button';
50 }
51
52 /**
53 * Register the widget controls.
54 *
55 * @since 1.2.0
56 * @return void
57 */
58 protected function register_controls() {
59 $this->start_controls_section(
60 'content',
61 [ 'label' => esc_html__( 'Campaign Donate Button', 'suredonation' ) ]
62 );
63
64 $this->add_campaign_control();
65
66 $this->add_control(
67 'button_text',
68 [
69 'label' => esc_html__( 'Button text', 'suredonation' ),
70 'type' => Controls_Manager::TEXT,
71 'default' => esc_html__( 'Donate', 'suredonation' ),
72 ]
73 );
74
75 $this->end_controls_section();
76 }
77
78 /**
79 * Map the widget settings to the block attributes.
80 *
81 * @since 1.2.0
82 * @param array<string, mixed> $settings Widget settings.
83 * @return array<string, mixed>
84 */
85 protected function get_block_attrs( $settings ) {
86 return [
87 'buttonText' => $this->setting_string( $settings, 'button_text', __( 'Donate', 'suredonation' ) ),
88 ];
89 }
90 }
91