Actually, i asked a bad question previously and that question already there is Stackoverflow, so I'm editing it to a new question,
I want list of available contact form name and id to use in another plugin, How can fetch contact form name to some other plugin please give me solution,
I have a solution for fetching cf7 form-id, i want name also along with form id
//code to fetch cf7 form-id
$cf7_id_array = array();
if (post_type_exists('wpcf7_contact_form')) {
$args = array('post_type' => 'wpcf7_contact_form', 'post_per_page' => -1);
$the_query = new WP_Query($args);
if ($the_query->have_posts()) {
while ($the_query->have_posts()) {
$the_query->the_post();
$cf7_id_array[] = get_the_ID();
}
wp_reset_postdata();
}
}
return $cf7_id_array;