Home › Forums › Add-ons › Options Page › Can\'t translate options pages › Reply To: Can\'t translate options pages
Hey,
I think the easier way is to do it like ACF does in the api_helpers.php File. Just add a filter like:
add_filter('acf/validate_post_id', function( $post_id ){
if( $post_id === 'POST_ID' ){
$dl = acf_get_setting('default_language');
$cl = acf_get_setting('current_language');
if( $cl && $cl !== $dl ) {
$post_id .= '_' . $cl;
}
}
return $post_id;
});
Where POST_ID
is your options page post_id. This way you can just use the post_id in your theme and don’t have to add the ICL_LANGUAGE_CODE
anywhere.
I hope this helps.
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.