Zum Inhalt springen Zur Seitenleiste springen

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.

Hinterlasse eine Antwort

Bitte bleibe beim Thema und sei respektvoll zu anderen. Wenn du Hilfe bei Problemen benötigst, die nicht mit diesem Beitrag zusammenhängen, nutze unser Support-Forum, um einen Chat zu starten oder ein Ticket einzureichen.

Du kannst diese Tags verwenden:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>