-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
Sites built with elementor save their content with shortcode resolved as HTML code.
Indeed, post_content do not contains the contact form 7 short code but the HTML code of the form, and cf7a do not initialize.
I have modified the function cf7_shortcode_exists to make it working with elementor. I made the assumption that pages with forms have an hidden field named "_wpcf7_version". Maybe their is an other method or regex to be more specific :
private function cf7_shortcode_exists() {
global $post;
return is_a( $post, 'WP_Post' ) && (has_shortcode( $post->post_content, 'contact-form-7' ) || preg_match('/_wpcf7_version/', $post->post_content));
}
Metadata
Metadata
Assignees
Labels
No labels