Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Codex linking?

@_ck_

Participant

Untested. Actually the forum is deleting some of the code so use it from here:

http://pastebin.com/f54a958de

<?php
/*
Plugin Name: Wiki Link
*/
add_action('post_text','wiki_link',200);
function wiki_link($text) {
$url="http://example.com/path_to_wiki?terms=";
$text=preg_replace("/([[(.+?)]])/si","<a class='wiki_link' href='$url$2'>$2</a>",$text);
return $text;
}
?>

the above is missing two $2, should look like

<a class='wiki_link' href='$url$2'>$2</a>

Skip to toolbar