Skip Navigation
Updated
February 12, 2025

Discover the complete list of ACF Multilingual (ACFML) constants and hooks, with examples for using them in your code.

ACF Multilingual (ACFML) Hooks

acfml_should_translate_acf_entity

This hook allows you to determine whether ACF fields or field groups should be translated. By using this filter, you can skip translating specific fields or groups based on your custom logic.

Type: Filter

Availability: ACFML 2.1.4

Parameters:

$shouldTranslate
(bool) (Required) Whether the field or field group should be translated. Defaults to true.

$entity
(array) (Required) The entity being translated, which is either a field array or a group array.

$entityType
(string) (Optional) The type of the entity being translated. It can be either ‘field’ or ‘group’.

Hook Example Usage:

add_filter( 'acfml_should_translate_acf_entity', function( $shouldTranslate, $entity, $entityType ) {
	if ( 'field' === $entityType ) {
		return false;
	}

	return $shouldTranslate;
} );

ACF Multilingual (ACFML) Constants

ACFML_EXCLUDE_FIELD_GROUP_STRINGS_IN_POST_JOBS

Starting with ACFML 2.1.5, you can use this constant to include field group strings in the post translation job.

To enable this, add the following line to your wp-config.php file:

define( 'ACFML_EXCLUDE_FIELD_GROUP_STRINGS_IN_POST_JOBS', false );

Notes:

  • If you created a translation job before adding this code to your wp-config.php file, cancel it and create a new one.
  • You can send field labels and choices for translation via the Translation Management dashboard if needed.

ACFML_HIDE_FIELD_ANNOTATIONS

To each translated field, ACF Multilingual adds information about the value in the original language. 

To remove this information from translated fields, you can add the following line to your site’s wp-config.php file:

define( 'ACFML_HIDE_FIELD_ANNOTATIONS', true );

ACFML_REPEATER_SYNC_DEFAULT

You can use this constant to set the default value of the Repeater field sync feature. It is set to true by default. This means that the Repeater fields are automatically synced across translations. If you set this constant to false, the Repeater field sync will be disabled.

You can override the default value of ACFML_REPEATER_SYNC_DEFAULT in your theme’s functions.php file:

define('ACFML_REPEATER_SYNC_DEFAULT', false);

ACFML_SCAN_LOCAL_FIELDS

Setting this constant to false disables scanning of JSON files for local fields.

This means that if you change the translation preference in local fields, it won’t sync to the database. You need to set the translation preference manually for fields. 

For more information check out the official ACF documentation about using local JSON.