Thread Starter
redsk
(@redsk)
Hi,
I’ve find a solution to use “Wiki Page Links” with wordpress wiki plugin.
I edited file wikipagelinks.php of plugin wiki page links.
First I modified line 118 from
if ( $page = get_page_by_title(html_entity_decode($link, ENT_QUOTES) ) ) {
to this
if ( $page = get_page_by_title(html_entity_decode($link, ENT_QUOTES), $output = OBJECT, $post_type = ‘incsub_wiki’) ) {
and then I modifiled line 128 from
$content = str_replace($match, “{$page_title}[?]”, $content);
to this
$content = str_replace($match, “{$page_title}[?]”, $content);
Now the Wiki Page Links plugins only works for wiki pages, not for normal pages anymore. However, for me it’s perfectly fine.
Just in case someone is interested to this.
Hi there @redsk,
Awesome! Glad you were able to find a nice solution for that and thanks so much for posting the edit so others can utilize it.
Another possibility, perhaps you might like, you can use the markdown features of Jetpack Markdown:
https://wordpress.org/plugins/jetpack-markdown/
There’s a helpful code snippet for integration with Wiki here:
https://wordpress.org/support/topic/jetpack-markdown-support
Hope that’s helpful, please feel free to ask if you have questions though. We’re here to help! 🙂
Cheers,
David
Thread Starter
redsk
(@redsk)
Hi @david,
thank you for pointing that out. I’m going to get feedback from my users and maybe I’ll give a try to Jetpack Markdown.
Cheers,
Nico
Hi there Nico,
You’re most welcome, glad to help! I have to admit, I really like the idea of full Markdown support myself and will be sure to mention it to the developers to see if that could maybe be built into the plugin.
Just let me know if I can assists in any way though, will be happy to help. 🙂
Cheers,
David
Thread Starter
redsk
(@redsk)
Hi guys,
I was writing down some notes about the installation of my CMS and I noticed that part of my previous post is wrong. This is probably because I didn’t put the code in between backtics. Sorry for that.
That’s the correct version:
I’ve find a solution to use “Wiki Page Links” with wordpress wiki plugin.
I edited file wikipagelinks.php of plugin wiki page links.
First I modified line 118 from
if ( $page = get_page_by_title(html_entity_decode($link, ENT_QUOTES) ) ) {
to this
if ( $page = get_page_by_title(html_entity_decode($link, ENT_QUOTES), $output = OBJECT, $post_type = 'incsub_wiki') ) {
and then I modifiled line 128 from
$content = str_replace($match, "{$page_title}[<a href='$home/wp-admin/post-new.php?post_type=page&post_title=$encodedlink' class='nonexistant_page' title='Create this page (requires a valid \"contributer\" account)'>?</a>]", $content);
to this
$content = str_replace($match, "{$page_title}[<a href='$home/wp-admin/post-new.php?post_type=incsub_wiki&post_title=$encodedlink' class='nonexistant_page' title='Create this page (requires a valid \"contributer\" account)'>?</a>]", $content);
Now the Wiki Page Links plugins only works for wiki pages, not for normal pages anymore. However, for me it’s perfectly fine.
HTH
Nico
Hi Nico,
Looks very nice that way and thanks again for posting that. I’m sure others will find it helpful! 🙂
Cheers,
David