Skip to content

Instantly share code, notes, and snippets.

@lukecav
Created January 28, 2016 23:32
Show Gist options
  • Select an option

  • Save lukecav/299e65dc2ae25f278338 to your computer and use it in GitHub Desktop.

Select an option

Save lukecav/299e65dc2ae25f278338 to your computer and use it in GitHub Desktop.
Widget Title URL
// We will make use of widget_title filter to
//dynamically replace custom tags with html tags
add_filter( 'widget_title', 'accept_html_widget_title' );
function accept_html_widget_title( $mytitle ) {
// The sequence of String Replacement is important!!
$mytitle = str_replace( '[link', '<a', $mytitle );
$mytitle = str_replace( '[/link]', '</a>', $mytitle );
$mytitle = str_replace( ']', '>', $mytitle );
return $mytitle;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment