Support

Account

Home Forums ACF PRO Get all Fields and Subfields from a page (pageID) Reply To: Get all Fields and Subfields from a page (pageID)

  • acf get_fields() does get the field names and values of repeaters and flex fields. For Example it returns this for a repeater

    
    [repeater] => Array
            (
                [0] => Array
                    (
                        [field_1] => value 1
                        [field_2] => value 2
                    )
    
                [1] => Array
                    (
                        [field_1] => value 1
                        [field_2] => value 2
                    )
    
            )
    

    Each sub array represents a row and the values are in field name => value pairs just like the top level fields.

    A flex field is returned like this

    
    [flex] => Array
            (
                [0] => Array
                    (
                        [acf_fc_layout] => layout_1
                        [field_1] => value 1
                        [field_2] => value 2
                    )
    
                [1] => Array
                    (
                        [acf_fc_layout] => layout_2
                        [field_1] => value 1
                        [field_2] => value 2
                    )
    
            )
    

    again, of the values of the array is a row of the flex field.

    maybe I’m missing what it is you’re really looking for. I think the real difficulty will be in telling the difference between flex fields, repeaters and other field types that store array values like select and checkbox fields.