I consider that many of developers out there will face this kind of request sometime, so I will post here how I made this work.
So basically I queried for all Wash Programs first and then for each wash program I created new field on Washes field group
Here is the code
<?php
// Check if function exists
if( function_exists('acf_add_local_field_group') ):
// Query the wash_program posts
$posts = get_posts(array(
'posts_per_page' => -1,
'post_type' => 'wash_program'
));
// Initialize empty array for filling later
$arr = [];
// Just a number to add on the 'key'
$c = 0;
if($posts) :
// For each wash_program post
foreach($posts as $post):
setup_postdata($post);
// Prepare the array
array_push($arr, array(
'key' => 'field_777'. $c, # key used by acf
'label' => get_field("wp_name"), # label
'name' => 'sub_title_' . $c,
'type' => 'number'
));
$c++;
endforeach;
wp_reset_postdata();
endif;
// Add new fields on 'wash' post type
acf_add_local_field_group(
array(
'key' => 'group_1',
'title' => 'Washes Numbers',
'fields' => $arr,
'location' =>
array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'wash',
),
),
),
));
endif;
?>
And the result was exactly what I wanted
Automatically added Wash Programs to Washes Post Type