Skip Navigation

Waiting for author

Topic Tags: Compatibility

Overview of the issue

When using the Make Column Clickable Elementor plugin with Elementor, it’s not possible to translate the links that are added to the columns.

Workaround

  • Open the wp-content/plugins/make-column-clickable-elementor/includes/class-column-clickable.php file.
  • Replace the following snippet (around line 52):
    public function before_render_options( $element ) {
          $settings  = $element->get_settings_for_display();
    
          if ( isset( $settings['column_link'], $settings['column_link']['url'] ) && ! empty( $settings['column_link']['url'] ) ) {
            wp_enqueue_script( 'make-column-clickable-elementor' );
    
            $element->add_render_attribute( '_wrapper', 'class', 'make-column-clickable-elementor' );
            $element->add_render_attribute( '_wrapper', 'style', 'cursor: pointer;' );
            $element->add_render_attribute( '_wrapper', 'data-column-clickable', $settings['column_link']['url'] );
            $element->add_render_attribute( '_wrapper', 'data-column-clickable-blank', $settings['column_link']['is_external'] ? '_blank' : '_self' );
          }
        }
    
  • With this:
    public function before_render_options( $element ) {
          $settings  = $element->get_settings_for_display();
    
          if ( isset( $settings['column_link'], $settings['column_link']['url'] ) && ! empty( $settings['column_link']['url'] ) ) {
            wp_enqueue_script( 'make-column-clickable-elementor' );
    
            //WPML - Workaround (ticket ID: compsupp-6157)
            do_action( 'wpml_register_single_string', 'Make Column Clickable Elementor', 'Link - '.$settings['column_link']['url'], $settings['column_link']['url'] );
            $settings['column_link']['url'] = apply_filters('wpml_translate_single_string', $settings['column_link']['url'], 'Make Column Clickable Elementor', 'Link - '.$settings['column_link']['url'] );
    
            $element->add_render_attribute( '_wrapper', 'class', 'make-column-clickable-elementor' );
            $element->add_render_attribute( '_wrapper', 'style', 'cursor: pointer;' );
            $element->add_render_attribute( '_wrapper', 'data-column-clickable', $settings['column_link']['url'] );
            $element->add_render_attribute( '_wrapper', 'data-column-clickable-blank', $settings['column_link']['is_external'] ? '_blank' : '_self' );
          }
        }
    
  • Visit the page on front-end, to register the strings.
  • Translate those links on WPML > String Translation, under the “Make Column Clickable Elementor” textdomain.

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>