Turn ACF(Advanced Custom Fields) compatible with qTranslate

Today i was fighting ACF Advanced Custom Fields to work with qTranslate at all and after couple of hours i found the solution

just add this code in the function.php of the theme


add_filter('acf/format_value_for_api', 'theme_format_value_for_api');
function theme_format_value_for_api($value) {
return is_string($value) ? __($value) : $value;
}

and then in the custom field add [:en] the text in english [:ar] the text in arabic

and it will work fine

here is the site i was working on http://baqermohebi.com/

Advertisements

One thought on “Turn ACF(Advanced Custom Fields) compatible with qTranslate

Leave a Reply :)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s