Create an Account
username: password:
 
  MemeStreams Logo

MemeStreams Discussion

search


This page contains all of the posts and discussion on MemeStreams referencing the following web page: WordPress/Trac Integration Plugin. You can find discussions on MemeStreams as you surf the web, even if you aren't a MemeStreams member, using the Threads Bookmarklet.

WordPress/Trac Integration Plugin
by Lost at 9:21 pm EDT, May 8, 2008

<?php
/*
Plugin Name: Trac Ticket Number/Link Conversion
Description: Replaces #123 with a link to the ticket on Trac, and wiki:MyPage with a link to Trac's wiki page MyPage
Author: Russell Jurney
*/

function convert_ticket($text) {
$link = preg_replace('/[^&]#([0-9]+)/m', " <a href='/trac/myproject/ticket/$1'>#$1", $text);
return $link;
}

function convert_wiki($text) {
$link = preg_replace('/wiki:(\w+)/m', "$1", $text);
return $link;
}

add_filter('the_content', 'convert_ticket');
add_filter('the_content', 'convert_wiki');
?>


 
 
Powered By Industrial Memetics