Posted By

lajevardi on 02/22/09


Tagged

wordpress idevcenter shortcode


Versions (?)

iDC WordPress Shortcode


 / Published in: PHP
 

Shortcode to insert iDevCenter.com rank in a WP blog post.

  1. function idcRankHandler($args){
  2. extract(shortcode_atts(array('link' => null),$args));
  3. $idcRef = !is_null($link) ? "http://idevcenter/link/$link" : "http://www.idevcenter.com/links/post/?url=".$hold=rawurlencode(get_permalink($post->ID));
  4. return '<a href="'.$idcRef .'" class="idcRankAnchor">'
  5. .'<img src="http://idevcenter.com/links/image?url='.$hold
  6. .'" title="Vote on iDevCenter.com" alt="Vote on iDevCenter.com" class="idcRankImage" />
  7. </a>';
  8. }
  9. add_shortcode("idc","idcRankHandler"); //Attaching iDC handler

Report this snippet  

You need to login to post a comment.