From 172ad1c8128cac3ab219ae0c9090cf7fba8fb2e4 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 17 May 2024 11:08:33 -0400 Subject: [PATCH] Make the Page::getInputfields() method hookable --- wire/core/Page.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/wire/core/Page.php b/wire/core/Page.php index 0177821f..deea152d 100644 --- a/wire/core/Page.php +++ b/wire/core/Page.php @@ -3020,6 +3020,23 @@ class Page extends WireData implements \Countable, WireMatchable { * */ public function getInputfields($fieldName = '') { + if($this->wire()->hooks->isMethodHooked($this, 'getInputfields')) { + return $this->__call('getInputfields', array($fieldName)); + } else { + return $this->___getInputfields($fieldName); + } + } + + /** + * Hookable version of getInputfields() method. + * + * See the getInputfields() method above for documentation details. + * + * @param string|array $fieldName + * @return null|InputfieldWrapper Returns an InputfieldWrapper array of Inputfield objects, or NULL on failure. + * + */ + protected function ___getInputfields($fieldName = '') { return $this->values()->getInputfields($this, $fieldName); }