Aperçu de l’anomalie
Lorsque vous utilisez PublishPress Authors avec WPML, vous pourriez rencontrer le problème suivant : vous traduisez la biographie d’un auteur dans Traduction de chaînes, mais les articles traduits affichent toujours la biographie dans la langue par défaut.
Solution de contournement
Ajoutez ce code au fichier functions.php de votre thème ou à une extension d’extraits de code, puis traduisez la biographie dans WPMLTraduction de chaînes (domaine PublishPress Authors) :
PHP
add_filter( 'publishpress_authors_author_attribute', function ( $value, $term_id, $attribute ) {
if ( 'description' !== $attribute || ! is_string( $value ) || '' === $value ) {
return $value;
}
return apply_filters( 'wpml_translate_single_string', $value, 'PublishPress Authors', '#' . (int) $term_id . ' Biographical Info' );
}, 10, 3 );