WPML

Overview of the Issue

When you use Enfold’s cookie pop-up, it opens up every time you switch the language.

Workaround

This issue is fixed. Updating to the latest version solves it on your site, so you only need this workaround if you can’t update yet.

We’re working with the theme developers to implement a permanent fix for this issue. In the meantime, you can use the following workaround.

  1. Backup your website files and database.
  2. Add this code snippet in the theme’s functions.php file:
    add_filter('avf_cookie_consent_for_md5', function ($cookie_contents){
    
    	$default_lang = apply_filters( 'wpml_default_language', null );
    
    	$message = avia_wpml_get_options('cookie_content');
    	$message = do_shortcode( (array) $message[$default_lang] );
    	$buttons = avia_wpml_get_options( 'msg_bar_buttons' ) ? avia_wpml_get_options( 'msg_bar_buttons' ) : [];
    	$cookie_contents = $message;
    
    	foreach( $buttons as $button ) {
    		$cookie_contents .= $button['msg_bar_button_label'];
    	}
    
    	return $cookie_contents;
    });

Still Seeing This Issue?

If updating doesn’t fix it, ask a support question and we’ll look into it with you.

Ask a support question

All known issues