Plugin Directory

Changeset 2849626


Ignore:
Timestamp:
01/17/2023 08:37:29 AM (3 years ago)
Author:
piotnetdotcom
Message:

Update 2.4.22

Location:
piotnet-addons-for-elementor
Files:
80 added
4 edited

Legend:

Unmodified
Added
Removed
  • piotnet-addons-for-elementor/trunk/piotnet-addons-for-elementor.php

    r2814823 r2849626  
    44 * Description: Piotnet Addons For Elementor (PAFE) adds many new features for Elementor
    55 * Plugin URI:  https://pafe.piotnet.com/
    6  * Version:     2.4.21
     6 * Version:     2.4.22
    77 * Author:      Piotnet
    88 * Author URI:  https://piotnet.com/
    99 * Text Domain: pafe
    10  * Elementor tested up to: 3.8.0
    11  * Elementor Pro tested up to: 3.8.1
     10 * Elementor tested up to: 3.10.0
     11 * Elementor Pro tested up to: 3.10.1
    1212 */
    1313
    1414if ( ! defined( 'ABSPATH' ) ) { exit; }
    1515
    16 define( 'PAFE_VERSION', '2.4.21' );
     16define( 'PAFE_VERSION', '2.4.22' );
    1717
    1818define( 'PAFE_DIR', plugin_dir_path(__FILE__));
     
    8888            require_once( __DIR__ . '/inc/ajax-posts-list.php' );
    8989        }
     90        if ( defined('ELEMENTOR_VERSION') ) {
     91            add_action( 'init', [ $this, 'add_wpml_support' ] );
     92        }
    9093           
    9194        add_filter( 'deprecated_function_trigger_error', [ $this, 'remove_deprecated_function_trigger_error' ], 10, 1 );
     
    479482        }
    480483
    481     }
    482 
     484    }
     485
     486    public function add_wpml_support()
     487    {
     488        require_once(__DIR__ . '/widgets/pafe-video-playlist.php');
     489        $widget = new PAFE_Video_Playlist();
     490        $widget->add_wpml_support();
     491
     492        require_once(__DIR__ . '/widgets/pafe-switch-content.php');
     493        $widget = new PAFE_Switch_Content();
     494        $widget->add_wpml_support();
     495    }
    483496}
    484497
  • piotnet-addons-for-elementor/trunk/readme.txt

    r2814823 r2849626  
    55Tested up to: 6.1
    66Requires PHP: 5.4
    7 Stable tag: 2.4.21
     7Stable tag: 2.4.22
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    120120
    121121== Changelog ==
     122= 2.4.22 =
     123* Integrate with WPML.
     124* Update Elementor tested up to: 3.10.0
     125* Update Elementor Pro tested up to: 3.10.1
    122126= 2.4.21 =
    123127* Update Elementor tested up to: 3.8.0
  • piotnet-addons-for-elementor/trunk/widgets/pafe-switch-content.php

    r2527727 r2849626  
    627627    </div>     
    628628        <?php
    629     }   
     629    }
     630    public function add_wpml_support() {
     631        add_filter( 'wpml_elementor_widgets_to_translate', [ $this, 'wpml_widgets_to_translate_filter' ] );
     632    }
     633
     634    public function wpml_widgets_to_translate_filter( $widgets ) {
     635        $widgets[ $this->get_name() ] = [
     636            'conditions' => [ 'widgetType' => $this->get_name() ],
     637            'fields'     => [
     638                [
     639                    'field'       => 'pafe_switch_content_primary_label',
     640                    'label' => __( 'Title', 'pafe' ),
     641                    'editor_type' => 'LINE'
     642                ],
     643                [
     644                    'field'       => 'pafe_switch_content_secondary_label',
     645                    'label' => __( 'Title', 'pafe' ),
     646                    'editor_type' => 'LINE'
     647                ],
     648            ],
     649        ];
     650
     651        return $widgets;
     652    }
    630653}
  • piotnet-addons-for-elementor/trunk/widgets/pafe-video-playlist.php

    r2604694 r2849626  
    359359                </div>
    360360            <?php
    361         }
     361        }
     362        public function add_wpml_support() {
     363            add_filter( 'wpml_elementor_widgets_to_translate', [ $this, 'wpml_widgets_to_translate_filter' ] );
     364        }
     365
     366        public function wpml_widgets_to_translate_filter( $widgets ) {
     367            $widgets[ $this->get_name() ] = [
     368                'conditions' => [ 'widgetType' => $this->get_name() ],
     369                'fields'     => [
     370                    [
     371                        'field'       => 'pafe_video_playlist_title',
     372                        'label' => __( 'Video List Title', 'pafe' ),
     373                        'editor_type' => 'LINE'
     374                    ],
     375                ],
     376            ];
     377
     378            return $widgets;
     379        }
    362380}       
Note: See TracChangeset for help on using the changeset viewer.