Skip Navigation

Waiting for author

Topic Tags: Compatibility

Overview of the issue

If you are using the Motors theme, you may encounter an issue where certain input filter types do not display their translated versions on the ‘Add a Car’ page, despite being translated in WPML.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open the …/wp-content/themes/motors-child/listings/add_car/step_1.php file
  • Look for line 122.
  • Replace:
    <div class="stm-form-1-quarter">
    	<?php if ( ! empty( $data_unit['numeric'] ) ) : ?>
    
    		<?php
    		$value = '';
    		if ( ! empty( $id ) ) {
    			$value = get_post_meta( $id, $data_unit['slug'], true );
    		}
    		?>
    
  • With:
    <div class="stm-form-1-quarter">
    	<?php if ( ! empty( $data_unit['numeric'] ) ) : ?>
    
    		<?php
    		$value = '';
    		if ( ! empty( $id ) ) {
    			$value = get_post_meta( $id, $data_unit['slug'], true );
    		}
    		
    		// WPMl Workaround for compsupp-7500
    		if ( class_exists('Sitepress') ) {
    
    			$string = $data_unit['single_name'];
    			$textdomain = 'motors';
    			$string_name = 'Motors String: '.substr($string, 0, 20);
    		
    			if ( apply_filters('wpml_default_language', NULL ) == apply_filters( 'wpml_current_language', NULL )) {
    				do_action( 'wpml_register_single_string', $textdomain, $string_name, $string );
    			}	
    			// Apply the translation to the string
    			$data_unit['single_name'] = apply_filters('wpml_translate_single_string', $string , $textdomain, $string_name);
    		}
    
    		?>
    
  • Visit the page with the issue in the original language, this action will register the string.
  • Go to WPML > String Translation page and translate the string. It should be under motors 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>