Add wiki_preprocess hook and documentation
This commit is contained in:
parent
802ccdff4a
commit
bad4ea6e65
@ -332,6 +332,10 @@ class Wiki extends Controller {
|
|||||||
|
|
||||||
$content = (($p['content'] == '') ? $sampleContent : $p['content']);
|
$content = (($p['content'] == '') ? $sampleContent : $p['content']);
|
||||||
|
|
||||||
|
$hookinfo = ['content' => $content, 'mimetype' => $mimeType];
|
||||||
|
call_hooks('wiki_preprocess',$hookinfo);
|
||||||
|
$content = $hookinfo['content'];
|
||||||
|
|
||||||
// Render the Markdown-formatted page content in HTML
|
// Render the Markdown-formatted page content in HTML
|
||||||
if($mimeType == 'text/bbcode') {
|
if($mimeType == 'text/bbcode') {
|
||||||
$renderedContent = NativeWikiPage::convert_links($content,argv(0) . '/' . argv(1) . '/' . NativeWiki::name_encode($wikiUrlName));
|
$renderedContent = NativeWikiPage::convert_links($content,argv(0) . '/' . argv(1) . '/' . NativeWiki::name_encode($wikiUrlName));
|
||||||
|
11
doc/hook/wiki_preprocess.bb
Normal file
11
doc/hook/wiki_preprocess.bb
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[h3]wiki_preprocess[/h3]
|
||||||
|
|
||||||
|
Called before markdown/bbcode processors are run for wiki pages
|
||||||
|
|
||||||
|
Passed parameter array:
|
||||||
|
|
||||||
|
'content' => wiki page content
|
||||||
|
'mimetype' => page mimetype
|
||||||
|
|
||||||
|
|
||||||
|
see: Zotlabs/Module/Wiki.php
|
@ -625,6 +625,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the
|
|||||||
[zrl=[baseurl]/help/hook/well_known]well_known[/zrl]
|
[zrl=[baseurl]/help/hook/well_known]well_known[/zrl]
|
||||||
Called when accessing the '.well-known' special site addresses
|
Called when accessing the '.well-known' special site addresses
|
||||||
|
|
||||||
|
[zrl=[baseurl]/help/hook/wiki_preprocess]wiki_preprocess[/zrl]
|
||||||
|
Called before markdown/bbcode processors are run for wiki pages
|
||||||
|
|
||||||
[zrl=[baseurl]/help/hook/zot_best_algorithm]zot_best_algorithm[/zrl]
|
[zrl=[baseurl]/help/hook/zot_best_algorithm]zot_best_algorithm[/zrl]
|
||||||
Called when negotiating crypto algorithms with remote sites
|
Called when negotiating crypto algorithms with remote sites
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user