Skip to content

Commit 385a1e2

Browse files
authored
Merge pull request #221 from BoldGrid/issue-220
Check if a post is actually a form before trying to render it
2 parents 558ca20 + 53cee8f commit 385a1e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/class-frontend-form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function render_shortcode( $atts, $contents = '' ) {
3939

4040
$form = weforms()->form->get( $id );
4141

42-
if ( !$form->id ) {
42+
if ( !$form->id || 'wpuf_contact_form' !== $form->data->post_type ) {
4343
return $this->show_error( __( 'The form couldn\'t be found.', 'weforms' ) );
4444
}
4545

0 commit comments

Comments
 (0)