From f0f37853ca20e6b6b821434596f343aad670a20e Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 10 Jul 2020 12:41:26 -0400 Subject: [PATCH] Minor optimization for Page::isLoaded($fieldName) method --- wire/core/Page.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wire/core/Page.php b/wire/core/Page.php index 53340f31..d1012635 100644 --- a/wire/core/Page.php +++ b/wire/core/Page.php @@ -3819,7 +3819,10 @@ class Page extends WireData implements \Countable, WireMatchable { * */ public function isLoaded($fieldName = null) { - if($fieldName) return parent::get($fieldName) !== null; + if($fieldName) { + if($this->hasField($fieldName)) return isset($this->data[$fieldName]); + return parent::get($fieldName) !== null; + } return $this->isLoaded; }