我有 2 个由联系表单 7 创建的联系表单。如何列出通过简码创建的所有联系表单?请检查图像,谢谢。


更新: 这是我的代码,可以工作!
$args = array('post_type' => 'wpcf7_contact_form', 'posts_per_page' => -1);
$rs = array();
if( $data = get_posts($args)){
foreach($data as $key){
$rs[$key->ID] = $key->post_title;
}
}else{
$rs['0'] = esc_html__('No Contact Form found', 'text-domanin');
}
Run Code Online (Sandbox Code Playgroud)