Home › Forums › ACF PRO › acf_form field instructions translations › Reply To: acf_form field instructions translations
Hi, my solution:
In the instructions texts I removed the colons of the qtranslate shorttags and add them dynamically with a string replace function in the load field filter followed by the apply_filters function to get the translation.
[en] English text [de] German text []
function qtrans_acf_load_field( $field )
{
// exclude acf-field-group page
if(get_post_type() != 'acf-field-group'){
$instructions = str_replace('[', '[:', $field['instructions']);
$field['instructions'] = apply_filters('the_title', $instructions);
}
return $field;
}
add_filter('acf/load_field', 'qtrans_acf_load_field', 10,3);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.