From bb536e10b487927b43e176be438bb6727dd459e5 Mon Sep 17 00:00:00 2001 From: DumbergerL Date: Wed, 19 Apr 2023 20:55:47 +0200 Subject: [PATCH] fix(warning): Attempt to read property "ID" on null #303 Fix Issue #303 --- includes/sm-template-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/sm-template-functions.php b/includes/sm-template-functions.php index 16700b7..cdf8625 100755 --- a/includes/sm-template-functions.php +++ b/includes/sm-template-functions.php @@ -231,7 +231,7 @@ function get_wpfc_sermon_meta( $meta_key = '', $post = null ) { global $post; } - $data = get_post_meta( $post->ID, $meta_key, true ); + $data = get_post_meta( $post?->ID, $meta_key, true ); if ( '' !== $data ) { return $data; }