From 6b8fb5af0c57d76151e2c4fbd4cd94e423cfeaaa Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Fri, 27 Jan 2023 14:28:56 +0100 Subject: [PATCH] Fix accessing post properties --- includes/model/class-post.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/model/class-post.php b/includes/model/class-post.php index 422e26b..c8ee85d 100644 --- a/includes/model/class-post.php +++ b/includes/model/class-post.php @@ -108,6 +108,9 @@ class Post { $var = \strtolower( \substr( $method, 4 ) ); if ( \strncasecmp( $method, 'get', 3 ) === 0 ) { + if ( empty( $this->$var ) && ! empty( $this->post->$var ) ) { + return $this->post->$var; + } return $this->$var; }