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

#31600
Ernest MarcinkoErnest Marcinko
Keymaster

Oh, I understand, so somehow the wrong translation is pulled there. Okay, I think I can suggest a custom code to maybe force the correct translation during the post process.

Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

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 = apply_filters( "the_author_display_name", get_the_author_meta('display_name', $r->id), $r->id );
			$r->content = apply_filters( "the_author_description", get_the_author_meta('description', $r->id), $r->id );
		}
	}

	return $results;
}

Please be careful, I could not test this.