Saltar navegación

Waiting for author

Topic Tags: Compatibility

Overview of the issue

If you are using FacetWP plugin, you may encounter an issue where the labels of checkbox fields, created with ACF and utilized in FacetWP facets, do not display their translations when inserted into pages using Elementor shortcodes.

Workaround

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

  • Open your theme’s functions.php file.
  • Add the following code:
    Add the following code to the functions.php file
    // WPML Workaround for compsupp-6751
    function wpml_compsupp6751_translate_facet_display_value( $label, $args ) {
    	if ( class_exists('Sitepress') ) {
    		$wpml_default_lang = apply_filters('wpml_default_language', NULL );
    		$wpml_current_lang = apply_filters( 'wpml_current_language', NULL );
    
    		if ($wpml_default_lang == $wpml_current_lang ) {
    			do_action( 'wpml_register_single_string', 'FacetWP', 'Facet Display Value : '.substr($label, 0, 10), $label );
    		}	
    		// Apply the translation to the string
    		$label = apply_filters('wpml_translate_single_string', $label , 'FacetWP', 'Facet Display Value : '.substr($label, 0, 10) );
    	}
        return $label;
    }
    add_filter( 'facetwp_facet_display_value', 'wpml_compsupp6751_translate_facet_display_value', 10, 2 );
    
  • Visit the page on front-end original language to register the strings
  • Go to WPML > String Translation and translate the strings (FacetWP textdomain / Facet Display Value : * name)

Deje una respuesta

Por favor, mantente dentro del tema y sé respetuoso con los demás. Si necesitas ayuda con cuestiones no relacionadas con este post, utiliza nuestro Foro de soporte para iniciar un chat o enviar un ticket.

Puede utilizar estas etiquetas:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>