1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-30 12:00:28 +00:00
TiddlyWiki5/editions/dev/tiddlers/new/Hook__th-renaming-tiddler.tid
2017-02-09 15:42:55 +00:00

25 lines
813 B
Plaintext

created: 20170209145207186
modified: 20170209145633522
tags: HookMechanism
title: Hook: th-renaming-tiddler
type: text/vnd.tiddlywiki
This hook allows plugins to inspect tiddlers before they are modified by the `tm-rename-tiddler` message.
Hook function parameters:
* ''newTiddler'': tiddler object incorporating the rename
* ''oldTiddler'': optional existing tiddler object that will be overwritten
Return value:
* newTiddler: tiddler object to be used for the renaming operation.
The original tiddler object can be returned unmodified by the hook. If the hook needs to modify the tiddler then it should return a new tiddler object, for example:
```
return new $tw.Tiddler(tiddler,{"my-field": value});
```
Hooks must not change the ''title'' field but can freely modify any other field of the tiddler.