Hacking a wordpress plugin

I hacked TwitThis plugin for WordPress in order to display AddClips and blog ranking bannars. Then I noticed AddClips includes TwitThis, so comented out the original code for displaying.This plugin and xLanguage plugin competed with each other until I let down this priority of filter hook.

How to make a WordPress Plugin Part1(in Japanese) and Writing a Plugin « WordPress Codex were useful for these.

Here is how I changed the source code(indicated as red and bold):

function set_filters () {
add_filter('the_content', array(&$this, 'display'), 15000);
}
function write_script () {

(Some lines omitted.)

(Here is the AddClips code with slight modification.)
$script .= “<!– AddClips Code START –>\n”;
$script .= “<a href=\”http://www.addclips.org/addclips.php\” onclick=\”";
if(is_single()) {

$script .= “AddClipsUrl=location.href; AddClipsTitle=document.title; “;
} else {
$script .= “AddClipsUrl=’” . get_permalink() . “‘; AddClipsTitle=’” . $post.get_the_title() . ” – ‘ + document.title; “;

(The rest is omitted.)

  AddClips   人気blogランキング  BS blog ranking  

Tags: , ,

Leave a Reply