Support

Account

Home Forums Front-end Issues Get Value from another post for Repeater Field

Unread

Get Value from another post for Repeater Field

  • I have a Custom Post Type called Course and Class Repeater field group.

    User need to add Course first before can add Class Repeater.

    I create course and class repeater in single page.

    I want to display the trainer_name field from CPT Course into Class Repeater group.

    I trying make this for Class Repeater, it works for create new class repeater but I dont know how to make trainer_name appear in t_first_name field in class repeater group:

    acf_form (array(
                            'field_groups' => array(375), // Same ID(s) used before
                            'form' => true,
                            'return' => '%post_url%',
                            'submit_value' => 'Save Changes',
                            'post_title' => false,
                            'post_content' => false,
                            )); 

    I’m try to make trainer_name appear:

    $post_object = get_field('trainer_name');
    
                    if( $post_object ): ?>
    
                    <div>
                    <h4><?php echo get_the_title($post_object->ID); ?></h4>
                    <span>Post Object Custom Field: <?php the_field('trainer_name', $post_object->ID); ?></span>
                </div>
                <?php wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly ?>

    How can I make trainer_name appear in acf_form?

Viewing 1 post (of 1 total)

The topic ‘Get Value from another post for Repeater Field’ is closed to new replies.