Skip to content

Commit 6b93a46

Browse files
committed
Prevent notice from displaying on new forms and other post types
1 parent 0f3b4e5 commit 6b93a46

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

classes/class-cpt-wplf-form.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ public function admin_post_scripts_cpt( $hook ) {
183183

184184
public function print_notices() {
185185
$post_id = ! empty( $_GET['post'] ) ? (int) $_GET['post'] : false;
186+
$type = get_post_type( $post_id );
187+
188+
if ( $type !== 'wplf-form' || ! $post_id ) {
189+
return false;
190+
}
191+
186192
$version_created_at = get_post_meta( $post_id, '_wplf_plugin_version', true );
187193
$version_created_at = $version_created_at ? $version_created_at : '< 1.5';
188194

0 commit comments

Comments
 (0)