I think I figured it out already.
function dynamic_select($choices, $args = array()) {
$args = array(
‘post_type’ => ‘properties’,
‘post_status’ => ‘publish’,
‘posts_per_page’ => 3,
);
$the_query = new WP_Query( $args );
while ( $the_query->have_posts() ) :
$the_query->the_post();
$output[get_the_title()] = get_the_title();
endwhile;
return $output;
}
add_filter(‘wpcf7_dynamic_select’, ‘dynamic_select’, 10, 2);
Im trying to rebuild this solution, but I cant get it work. According the example above, how does the tag in cf7 has to look like?
[dynamicselect wpcf7_dynamic_select]
This tag stays blank and Ive didnt found any example how the tag should look like.