1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-23 14:56:51 +02:00

Make ProcessPageSearchLive::execute() hookable per processwire/processwire-issues#675

This commit is contained in:
Ryan Cramer
2018-09-12 13:20:26 -04:00
parent 7a89f4f188
commit 468ecb6b29

View File

@@ -5,6 +5,7 @@
* *
* @method renderList(array $items, $prefix = 'pw-search', $class = 'list') * @method renderList(array $items, $prefix = 'pw-search', $class = 'list')
* @method renderItem(array $item, $prefix = 'pw-search', $class = 'list') * @method renderItem(array $item, $prefix = 'pw-search', $class = 'list')
* @method string|array execute($getJSON = true)
* *
* @todo support searching repeaters * @todo support searching repeaters
* *
@@ -394,7 +395,7 @@ class ProcessPageSearchLive extends Wire {
* @return string|array * @return string|array
* *
*/ */
public function execute($getJSON = true) { public function ___execute($getJSON = true) {
/** @var WireInput $input */ /** @var WireInput $input */
$input = $this->wire('input'); $input = $this->wire('input');
@@ -785,7 +786,7 @@ class ProcessPageSearchLive extends Wire {
* *
*/ */
protected function useType($type, $requestType = '') { protected function useType($type, $requestType = '') {
if($type === $requestType) return true; if($requestType) return $type === $requestType;
return !in_array($type, $this->noSearchTypes); return !in_array($type, $this->noSearchTypes);
} }