Support

Account

Home Forums ACF PRO Get value of another field in same group as current field Reply To: Get value of another field in same group as current field

  • Hi James

    Thank you for the reply!

    I think I’m “OK” with the clone field side of things, actually. I was mentioning for context, but I think you’re completely right – it’s irrelevant in this context.

    One crucial thing I somehow didn’t mention is that the value I’m trying to get is inside a flexible content layout, nested inside a repeater.

    The fields look like:

    
    - Repeater (columns) - attached to a CPT single
    
    	- Flex layout blocks (inside columns)
    
    		- Text field (inside Flex layout)
    		- Highlight field (inside Flex layout)
    

    For this reason, get_field('highlight_color', $post_id) can’t retrieve the correct value.

    Through the acf/format_value/type=text filter, I am able to get the info as per my initial post, including the parent ID and the parent_layout key.

    So in this case, the current field ID is 2126 and it’s parent is 2123.

    What I’m therefore trying to do (in pseudo code) is:

    Get the value of a field who's parent is 2123 and name is highlight_color

    Thanks again