• Resolved alexndlm

    (@alexndlm)


    Hello.
    Add please WPML support.
    I do not know how to use SVN.

    gradient-button-for-elementor/modules/button/module.php

    <?php
    namespace GradientButtonElementor\Modules\Button;

    use GradientButtonElementor\Base\Module_Base;

    class Module extends Module_Base {

    public function __construct() {
    parent::__construct();

    // This is here for extensibility purposes – go to town and make things happen!

    add_filter( ‘wpml_elementor_widgets_to_translate’, [ $this, ‘wpml_widgets_to_translate_filter’ ] );
    }

    public function get_name() {
    return ‘bloompixel-gradient-button’;
    }

    public function get_widgets() {
    return [
    ‘Gradient_Button’, // What is it goes here. This should match the widget/element class – the file name should also match but in small caps!
    ];
    }

    public function wpml_widgets_to_translate_filter( $widgets ) {
    $widgets[ $this->get_name() ] = [
    ‘conditions’ => [ ‘widgetType’ => $this->get_name() ],
    ‘fields’ => [
    [
    ‘field’ => ‘text’,
    ‘type’ => __( ‘Gradient Button Text’, ‘gradient-button-for-elementor’ ),
    ‘editor_type’ => ‘LINE’
    ],
    ],
    ];

    return $widgets;
    }

    }

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add WPML support’ is closed to new replies.