Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Subscribe and Connect adjust social network markup to include nofollow
add_filter( 'subscribe_and_connect_networks_list', 'jk_change_social_links_markup' );
function jk_change_social_links_markup( $list ) {
global $subscribe_and_connect;
$settings = $subscribe_and_connect->get_settings();
$networks = Subscribe_And_Connect_Utils::get_networks_in_order( $settings['connect']['networks'], $settings['connect']['networks_order'] );
$list = '';
if ( 0 < count( $networks ) ) {
foreach ( $networks as $k => $v ) {
if ( ! isset( $v['url'] ) || '' == $v['url'] ) continue;
$class = $k;
$list .= '<li class="' . esc_attr( $class ) . '"><a href="' . esc_url( $v['url'] ) . '" rel="nofollow"><span>' . "\n";
$list .= '</span></a></li>' . "\n";
}
}
return $list;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment