The documentation for
https://www.dokuwiki.org/devel:event:io_wikipage_read states:
The $data field is an array with the entries:
$data[0] – The raw arguments for io_readFile() as an array. Do not change.
$data[0][0] – the file path.
$data[0][1] – whether to convert line endings to unix format, default true.
$data[1] – ns: The colon separated namespace path minus the trailing page name. (false if root ns)
$data[2] – page_name: The wiki page name without the namespace.
$data[3] – rev: The page revision, false for current wiki pages.
In the BEFORE event handler the $data can be modified, to influence the read action.
I assume this means that in the BEFORE event handler, only $data[1]..$data[3] may be changed. What would be the effect of changing the
ns and/or
page_name?
The reason I ask is I'm writing a plugin that intercepts a command to edit a page in the "published" area of my namespace, and copy the page into a special "drafts" area and edit that instead. Maybe IO_WIKIPAGE_READ is too late in the sequence of events to do this, but I wanted to clarify this.