Not extremely elegant, but should work…
$sep = " | ";
$args = array(
'before'=>'',
'after'=>$sep,
'category_after'=>'',
'category_before'=>'',
'title_li'=>'',
'echo'=>0 //return the string, don't echo
);
$str = wp_list_bookmarks($args);
//chop off the last separator...
$str = substr($str, 0, strlen($str) - strlen($sep));
echo $str;
EDIT —
I added before
and after
to the $args
array — these are actually what _walk_bookmarks()
uses before and after each link.