Skip to content

Instantly share code, notes, and snippets.

@About2git
Forked from srikat/gist:8393618
Created February 15, 2015 22:23
Show Gist options
  • Save About2git/61772cd614a087a0ee4a to your computer and use it in GitHub Desktop.
Save About2git/61772cd614a087a0ee4a to your computer and use it in GitHub Desktop.
Parse <br> in WordPress widget titles. Source: http://wpmu.org/wordpress-widget-title-html/
//* Enable line breaks in widget titles
add_filter( 'widget_title', 'html_widget_title' );
function html_widget_title( $title ) {
$title = str_replace( '[', '<', $title );
$title = str_replace( 'br]', 'br>', $title );
return $title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment