Snippets: Allow Shortcodes in Top Bar Social Settings

This code will allow shortcodes to be added to the topbar social links function.

// Filter the output to parse the href value and render the shortcode value
add_filter( 'wpex_topbar_social_link_attrs', function( $attrs ) {
	$attrs['href'] = do_shortcode( $attrs['href']);
	return $attrs;
} );

Snippet Type: PHP

All PHP snippets should be added via a child theme's functions.php file or via the Code Snippets Plugin (or alternative plugin)