Support

Account

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.