04/07/2015 at 10:40 pm
#330908
Keymaster
@ dominic
Ok, 8.2.5 (when released) will contain a icon for links and an option to use them. It can be used just like the email icons as mention in this reply in the other thread. Example:
[connections link_format='%icon%']
If you do not like the icon I chose and wish to use yours instead, there is a filter name is: cn_output_link_icon
Use it like so:
add_filter( 'cn_output_link_icon', 'cn_custom_link_icon', 10, 2);
function cn_custom_link_icon( $icon, $type ) {
switch( $icon['width'] ) {
case 16:
$icon['src'] = 'path/to/your/16px/icon.png';
break;
case 24:
$icon['src'] = 'path/to/your/24px/icon.png';
break;
case 32:
$icon['src'] = 'path/to/your/32px/icon.png';
break;
case 48:
$icon['src'] = 'path/to/your/48px/icon.png';
break;
case 64:
$icon['src'] = 'path/to/your/64px/icon.png';
break;
}
return $icon;
}
The $type var is the link type; ie. blog or website. So you could get creative and assign custom icons by link type.
That should cover it I believe. Hope that helps!
