Skip to content

Commit a7f8802

Browse files
authored
Fix notice from $_GET (#97)
* Fix notice from $_GET
1 parent 6391b8c commit a7f8802

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

classes/class-cpt-wplf-form.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,9 @@ function strip_form_tags( $content ) {
587587
*/
588588
function wplf_form( $id, $content = '', $xclass = '', $attributes = [] ) {
589589
global $post;
590+
$preview = ! empty( $_GET['preview'] ) ? $_GET['preview'] : false;
590591

591-
if ( 'publish' === get_post_status( $id ) || 'true' === $_GET['preview'] ) {
592+
if ( 'publish' === get_post_status( $id ) || $preview ) {
592593
$form = get_post( $id );
593594
if ( empty( $content ) ) {
594595
// you can override the content via parameter

0 commit comments

Comments
 (0)