Salta la navigazione

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)

Lasciare una risposta

Ti preghiamo di rimanere in tema e di essere rispettoso nei confronti degli altri. Se hai bisogno di aiuto per questioni non correlate a questo post, utilizza il nostro Forum di supporto per avviare una chat o inviare un ticket.

Potete usare questi tag:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>