use Elementor\Includes\Widgets\Traits\Button_Trait;
use Elementor\Modules\Promotions\Controls\Promotion_Control;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
* Elementor button widget.
* Elementor widget that displays a button with the ability to control every
* aspect of the button design.
class Widget_Button extends Widget_Base {
* Retrieve button widget name.
* @return string Widget name.
public function get_name() {
* Retrieve button widget title.
* @return string Widget title.
public function get_title() {
return esc_html__( 'Button', 'elementor' );
* Retrieve button widget icon.
* @return string Widget icon.
public function get_icon() {
* Retrieve the list of categories the button widget belongs to.
* Used to determine where to display the widget in the editor.
* @return array Widget categories.
public function get_categories() {
protected function is_dynamic_content(): bool {
public function has_widget_inner_wrapper(): bool {
return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
* Get widget upsale data.
* Retrieve the widget promotion data.
* @return array Widget promotion data.
protected function get_upsale_data() {
'condition' => ! Utils::has_pro(),
'image' => esc_url( ELEMENTOR_ASSETS_URL . 'images/go-pro.svg' ),
'image_alt' => esc_attr__( 'Upgrade', 'elementor' ),
'title' => esc_html__( 'Convert visitors into customers', 'elementor' ),
'description' => esc_html__( 'Get the Call to Action widget and grow your toolbox with Elementor Pro.', 'elementor' ),
'upgrade_url' => esc_url( 'https://go.elementor.com/go-pro-button-widget/' ),
'upgrade_text' => esc_html__( 'Upgrade Now', 'elementor' ),
protected function register_controls() {
$this->start_controls_section(
'label' => esc_html__( 'Button', 'elementor' ),
$this->register_button_content_controls();
$this->end_controls_section();
$this->start_controls_section(
'label' => esc_html__( 'Button', 'elementor' ),
'tab' => Controls_Manager::TAB_STYLE,
$this->register_button_style_controls();
$this->end_controls_section();
* Render button widget output on the frontend.
* Written in PHP and used to generate the final HTML.
protected function render() {