mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 16:26:59 +02:00
Fix issue processwire/processwire-issues#267
This commit is contained in:
@@ -1055,15 +1055,15 @@ class InputfieldPage extends Inputfield implements ConfigurableModule {
|
|||||||
$field->value = '<p>' .
|
$field->value = '<p>' .
|
||||||
sprintf($this->_('Add the following hook to a %s file and modify per your needs. The hook should find and return selectable pages in a PageArray.'), '<u>/site/ready.php</u>') .
|
sprintf($this->_('Add the following hook to a %s file and modify per your needs. The hook should find and return selectable pages in a PageArray.'), '<u>/site/ready.php</u>') .
|
||||||
"</p><pre><code>" .
|
"</p><pre><code>" .
|
||||||
"\$wire->addHookAfter('InputfieldPage::getSelectablePages', function(\$event) {" .
|
"\$wire->addHookAfter('InputfieldPage::getSelectablePages', function(\$event) {" .
|
||||||
"\n if(\$event->object->name == '<strong>$this->name</strong>') {" .
|
"\n if(\$event->object->hasField == '<strong>$this->name</strong>') {" .
|
||||||
"\n \$event->return = \$event->pages->find('<strong>your selector here</strong>');" .
|
"\n \$event->return = \$event->pages->find('<strong>your selector here</strong>');" .
|
||||||
"\n }" .
|
"\n }" .
|
||||||
"\n});" .
|
"\n});" .
|
||||||
"</code></pre>" .
|
"</code></pre>" .
|
||||||
"<p>" .
|
"<p>" .
|
||||||
sprintf($this->_('If you need to know the page being edited, it is accessible from: %s'),
|
sprintf($this->_('If you need to know the page being edited, it is accessible from: %s'),
|
||||||
"<code>\$event->arguments('page');</code>") .
|
"<code>\$event->arguments('page');</code>") .
|
||||||
"</p>";
|
"</p>";
|
||||||
}
|
}
|
||||||
$field->label = $this->_('Custom PHP code');
|
$field->label = $this->_('Custom PHP code');
|
||||||
|
Reference in New Issue
Block a user