Create an Account
username: password:
 
  MemeStreams Logo

WordPress/Trac Integration Plugin

search

Lost
Picture of Lost
My Blog
My Profile
My Audience
My Sources
Send Me a Message

sponsored links

Lost's topics
Arts
Business
Games
Health and Wellness
Home and Garden
Miscellaneous
Current Events
Recreation
Local Information
Science
Society
Sports
Technology

support us

Get MemeStreams Stuff!


 
WordPress/Trac Integration Plugin
Topic: Technology 9:20 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');
?>

WordPress/Trac Integration Plugin



 
 
Powered By Industrial Memetics
RSS2.0