This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: canot find users in translated language

Home Forums Product Support Forums Ajax Search Pro for WordPress Support canot find users in translated language Reply To: canot find users in translated language

#31623
Ernest MarcinkoErnest Marcinko
Keymaster

I really don’t know why it does not translate, WPML should do it automatically, this is how it should actually work by their documentation. Maybe try this last version:

add_filter( 'asp_results', 'asp_get_author_data', 10, 1 );
function asp_get_author_data( $results ) {
	
	// Parse through each result item
	foreach ($results as $k=>&$r) {
		if ( $r->content_type == 'user' ) {
			$r->title = icl_t('Authors', 'display_name_'.$r->id, get_the_author_meta('display_name', $r->id)); 
			$r->content = icl_t('Authors', 'description_'.$r->id, get_the_author_meta('description', $r->id));
		}
	}

	return $results;
}