Filter the arguments for the blogroll:
add_filter( 'widget_links_args', 'wpse_76521_filter_blogroll' );
function wpse_76521_filter_blogroll( $args )
{
$li_start = isset ( $args['before'] ) ? $args['before'] : '<li>';
$args['before'] = $li_start . '<i class="icon-ok"></i>';
return $args;
}
Explanation
- The blogroll is created by the widget class
WP_Widget_Links
. - This class calls
wp_list_bookmarks()
with some prepared widget arguments which we can filter withwidget_links_args
. wp_list_bookmarks()
calls_walk_bookmarks()
and passes the original arguments through._walk_bookmarks()
accepts an argument'before'
that defaults to<li>
.- So we add that argument to
widget_links_args
in (2.) and let it fall through until it arrives in_walk_bookmarks()
(4.).
Alternative
You could use CSS instead:
.widget_links li
{
padding-left: 20px;
background: url(path/to/icon.png) 0% 50% no-repeat transparent;
}