Hello,
Thanks for the feedback!
It looks like the problem come from the ACFML plugin. In fact you’ll see those PHP notices, without ACF Extended, when trying to register local PHP field groups with a Flexible Content.
Here is a code example that will trigger those notices on a blank WordPress 5.8 install, with ACF Pro 5.10.2 + WPML 4.4.12 + ACFML 1.9.0:
add_action('acf/init', 'my_acf_init');
function my_acf_init(){
acf_add_local_field_group(array(
'key' => 'group_6138ad2c18c60',
'title' => 'Flexible Content',
'fields' => array(
array(
'key' => 'field_6138ad2f4fb45',
'label' => 'Flexible Content',
'name' => 'flexible_content',
'type' => 'flexible_content',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'layouts' => array(
'layout_6138ad3456061' => array(
'key' => 'layout_6138ad3456061',
'name' => 'layout',
'label' => 'layout',
'display' => 'block',
'sub_fields' => array(
array(
'key' => 'field_6138ad374fb46',
'label' => 'Test',
'name' => 'test',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
),
'min' => '',
'max' => '',
),
),
'button_label' => 'Add Row',
'min' => '',
'max' => '',
),
),
'location' => array(
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'post',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => true,
'description' => '',
));
}
This code will register a simple local Field Group with a Flexible Content using the acf/init
hook recommended by ACF in the official documentation (section: “Add within an action”).
Add within an action
The functions above can be used in the root of the functions.php file or within the acf/init action. This action was added in ACF v5.2.7 and is recommended.
The benefit of using this action is that the function is guaranteed to exist, and won’t run unless ACF is active.
It looks like WPML & ACFML have troubles to handle local PHP Flexible Content. I would suggest to open a bug report on their support platform.
Hope it helps!
Have a nice day!
Regards.