Created
November 18, 2019 04:09
-
-
Save shaddam/2cdda171ac6159d951765209142f22db to your computer and use it in GitHub Desktop.
How to get Contact form 7 list for elementor addons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Contact form list | |
| * return array | |
| */ | |
| function themename_contact_form_seven(){ | |
| $countactform = array(); | |
| $themename_forms_args = array( 'posts_per_page' => -1, 'post_type'=> 'wpcf7_contact_form' ); | |
| $themename_forms = get_posts( $themename_forms_args ); | |
| if( $themename_forms ){ | |
| foreach ( $themename_forms as $themename_form ){ | |
| $countactform[$themename_form->ID] = $themename_form->post_title; | |
| } | |
| }else{ | |
| $countactform[ esc_html__( 'No contact form found', 'text-domain' ) ] = 0; | |
| } | |
| return $countactform; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment