Internally DokuWiki maintains two arrays of metadata
- current (current metadata should only be set in the context of the renderer as it will be overwritten the next time metadata is rendered)
- persistent. (The persistent array holds duplicates of those key/values which should not be cleared during the rendering process.)
If you want to create logic that persists:
- only in the scope of a session (example, add a library at the end of a template if a syntax is present): use current
- for all scope that is data dependent: use persistent
with the render option possible values:
- METADATA_RENDER_USING_CACHE (default)
- METADATA_RENDER_UNLIMITED (also combined with the previous two options),
- p_set_metadata set metadata.
global $ID p_set_metadata( $ID, array($key => $value), $render = false, $persistent = true );
https://www.dokuwiki.org/devel:event:parser_metadata_render - Signalled by p_render_metadata() in inc/parserutils.php before instantiating the metadata renderer.
To get persistent metadata
- or the array renderer→persistent
To get volatile meta:
Metadata update happens asynchronously via the taskrunner
The task runner is located in lib/exe/taskrunner.php and is included as hidden image by the tpl_indexerWebBug() function.