Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * WPML Translate
- */
- /** Add JKIT Widgets to WPML Translate */
- function add_jkit_widgets_to_translate( $widgets ) {
- /** JKIT - Testimonials Widget */
- $widgets['jkit_testimonials'] = array(
- 'conditions' => array( 'widgetType' => 'jkit_testimonials' ),
- 'fields' => array(),
- 'integration-class' => 'WPML_JKIT_Testimonials_Custom',
- );
- return $widgets;
- }
- add_filter( 'wpml_elementor_widgets_to_translate', 'add_jkit_widgets_to_translate' );
- /** Add custom class for JKIT Testimonials widget translation*/
- add_action(
- 'init',
- function() {
- /** class JKIT Testimonials Translation */
- class WPML_JKIT_Testimonials_Custom extends WPML_Elementor_Module_With_Items {
- /**
- * @return string
- */
- public function get_items_field() {
- return 'sg_testimonials_list';
- }
- /**
- * @return array
- */
- public function get_fields() {
- return array( 'sg_testimonials_list_client_name', 'sg_testimonials_list_designation', 'sg_testimonials_list_review' );
- }
- /**
- * @param string $field
- *
- * @return string
- */
- protected function get_title( $field ) {
- switch ( $field ) {
- case 'sg_testimonials_list_client_name':
- return esc_html__( 'JKIT Testimonials: Testimonials: Client Name', 'jeg-elementor-kit' );
- case 'sg_testimonials_list_designation':
- return esc_html__( 'JKIT Testimonials: Testimonials: Designation', 'jeg-elementor-kit' );
- case 'sg_testimonials_list_review':
- return esc_html__( 'JKIT Testimonials: Testimonials: Review', 'jeg-elementor-kit' );
- default:
- return '';
- }
- }
- /**
- * @param string $field
- *
- * @return string
- */
- protected function get_editor_type( $field ) {
- switch ( $field ) {
- case 'sg_testimonials_list_client_name':
- return 'LINE';
- case 'sg_testimonials_list_designation':
- return 'LINE';
- case 'sg_testimonials_list_review':
- return 'LINE';
- default:
- return '';
- }
- }
- }
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement