MattGeri/WP-Most-Popular — pull request #20 by callerc1 (2014-01-24 10:18:31+00:00)
Title: Widget item filter hook

Hi Matt,

I have added a filter hook to the most popular items widget. This way i can amend output in my theme if need be.

As an example i'm using it like so to output post thumbnail amongst other things:

function theme_most_popular_item_output($item_output, $post_id, $title, $post_class, $permalink){
$item_output = '
';
$item_output .= get_the_post_thumbnail($post_id, 'top_spots', array('class' => "media-object pull-left"));
$item_output .= '';
$item_output .= '

' . $title . '

';
$item_output .= '' . get_the_date() . '';
$item_output .= '
';
return $item_output;
}
add_filter('wp_most_popular_item_output', 'theme_most_popular_item_output', 10, 5);

Would be great to here your thoughts

Cheers

Chris