Sauter la navigation

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)

Laisser une réponse

Veuillez rester dans le sujet et respecter les autres. Si vous avez besoin d'aide pour des questions qui ne sont pas liées à ce message, utilisez notre Forum d'assistance pour entamer une discussion ou soumettre un ticket.

Vous pouvez utiliser ces balises :
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>