Markdown and the Flickr Photo Album for WordPress Plugin
Not one day after I [post](http://www.premagination.com/2006/03/22/wordpress-flickr-post-bar-and-markdown/) instructions on how to modify the *Wordpress Flickr Post Bar* Joe Tan releases a massive upgrade in the form of the [Flickr Photo Album for WordPress](http://tantannoodles.com/toolkit/photo-album/). After a receiving a helpful hint from Joe on where to start I’d like to share my hack that replaces the HTML inserted by the plugin with Markdown.
As before, we’re simply removing the hardcoded html and replacing it with Markdown. The function that performs this is named *silas_AddPhoto* and can be found in *”inline-photos.html”* file on line 22. Simply replace that function with the code below and replace the original file on the server with the modified version. That’s it!
*I have reformatted the original code to be easier to read*
function silas_addPhoto(photoUrl, sourceUrl, width, height, title)
{
/*var html =
‘‘ +
‘‘ +
‘ ‘*/
var html = ‘[](‘ + photoUrl + ‘ “‘ + title + ‘”)’
if ( richedit )
{
win.tinyMCE.execCommand(‘mceInsertContent’, false, html);
}
else
{
win.edInsertContent(win.edCanvas, html);
}
return false;
}
This entry was posted on Thursday, March 23rd, 2006 at 8:04 pm and is filed under Wordpress. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


Rogier November 5th, 2006 at 4:28 am
What is different between the original code in this? Why should we use this code?