How to not translate specific ajax action

Below 2 examples of how you can filter ajax action no translate :

// On this example we say weglot to not translate a specific ajax action
add_filter('weglot_ajax_no_translate', 'custom_ajax_no_translate', 10, 1);
function custom_ajax_no_translate($ajax_action){
	$ajax_action[] = 'loadmore';
	return $ajax_action;
}

//You can customize this filter, for example if you want to no translate this action only on original language
add_filter('weglot_ajax_no_translate', 'custom_ajax_no_translate', 10, 1);
function custom_ajax_no_translate($ajax_action){
	if( weglot_get_original_language() == weglot_get_current_language()){
		$ajax_action[] = 'loadmore';
	}
	return $ajax_action;
}

Last updated