Support

Account

Home Forums ACF PRO acf add local field to flexible content Reply To: acf add local field to flexible content

  • here is the full output of flexible content. i guess i just cant do what i wanted as i have tried specifying the parent as ‘subfields’ i also tried ‘field_subfields’ and neither worked. Its a real shame that we can import simple single fields into other simple field structures but cant do the same with flexible content.

    the reason i am trying to do this is I want to manage and reuse parts of flexible content arrays more effectively. Are there any other methods you would suggest?

    Array
    (
        [ID] => 0
        [key] => field_subfields
        [label] => flexible content
        [name] => flexible_content
        [prefix] => 
        [type] => flexible_content
        [value] => 
        [menu_order] => 0
        [instructions] => 
        [required] => 0
        [id] => 
        [class] => 
        [conditional_logic] => 0
        [parent] => group_56ff5b11d1775
        [wrapper] => Array
            (
                [width] => 
                [class] => 
                [id] => 
            )
    
        [_name] => flexible_content
        [_input] => 
        [_valid] => 1
        [button_label] => Add Row
        [min] => 
        [max] => 
        [layouts] => Array
            (
                [0] => Array
                    (
                        [key] => subfields
                        [name] => sample_label
                        [label] => sample label
                        [display] => block
                        [sub_fields] => Array
                            (
                                [0] => Array
                                    (
                                        [ID] => 0
                                        [key] => field_to_import
                                        [label] => Repeatable image with optional link
                                        [name] => repeatable_imgs
                                        [prefix] => 
                                        [type] => repeater
                                        [value] => 
                                        [menu_order] => 0
                                        [instructions] => 
                                        [required] => 0
                                        [id] => 
                                        [class] => 
                                        [conditional_logic] => 0
                                        [parent] => field_subfields
                                        [wrapper] => Array
                                            (
                                                [width] => 
                                                [class] => 
                                                [id] => 
                                            )
    
                                        [_name] => repeatable_imgs
                                        [_input] => 
                                        [_valid] => 1
                                        [row_min] => 0
                                        [row_limit] => 
                                        [layout] => table
                                        [button_label] => Add image
                                        [parent_layout] => subfields
                                        [sub_fields] => Array
                                            (
                                                [0] => Array
                                                    (
                                                        [ID] => 0
                                                        [key] => field_5237950f6c6e4
                                                        [label] => url
                                                        [name] => img_link_url
                                                        [prefix] => 
                                                        [type] => text
                                                        [value] => 
                                                        [menu_order] => 0
                                                        [instructions] => leave blank if link is not required
                                                        [required] => 0
                                                        [id] => 
                                                        [class] => 
                                                        [conditional_logic] => 0
                                                        [parent] => field_to_import
                                                        [wrapper] => Array
                                                            (
                                                                [width] => 
                                                                [class] => 
                                                                [id] => 
                                                            )
    
                                                        [_name] => img_link_url
                                                        [_input] => 
                                                        [_valid] => 1
                                                        [formatting] => html
                                                        [default_value] => 
                                                        [maxlength] => 
                                                        [placeholder] => 
                                                        [prepend] => 
                                                        [append] => 
                                                        [readonly] => 0
                                                        [disabled] => 0
                                                    )
    
                                            )
    
                                        [min] => 0
                                        [max] => 0
                                    )
    
                            )
    
                        [min] => 
                        [max] => 
                    )
    
            )
    
    )