Support

Account

Home Forums General Issues Looking to display 5 ACF fields' values in one field, while adding a post. Reply To: Looking to display 5 ACF fields' values in one field, while adding a post.

  • Hi John,

    Thanks for the reply. I am working on it, and can you take a look? Something is missing i think.

    Also is $field[‘message’] what i use to get the field to show on the page?

    <?php
    function my_acf_prepare_field( $field ) {
    
        // Lock-in the value "Example".
        // if( $field['value'] === 'Example' ) {
        //     $field['readonly'] = true;
        // };
        // return $field;
        $buy_or_sell = get_field('buy_or_sell');
        $pair = get_field('pair');
    }
    
    // Apply to fields named "example_field".
    add_filter('acf/prepare_field/name=buy_or_sell', 'my_acf_prepare_field');
    add_filter('acf/prepare_field/name=pair', 'my_acf_prepare_field');