Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Using URLs in Widget Titles. Using the format TITLE||URL||TARGET, being target optional. Nice article with many methods:
add_filter( 'widget_title', function( $title )
$pieces = explode( '||', $title );
if( isset( $pieces[1] ) )
$target = isset( $pieces[2] ) ? "target='{$pieces[2]}'" : '';
$new_title = sprintf(
"<a href='%s' %s>%s</a>",
$return = isset( $new_title ) ? $new_title : $title;
return $return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.