Skip to content

Instantly share code, notes, and snippets.

@srikat
Created January 13, 2014 02:14
Show Gist options
  • Select an option

  • Save srikat/8393618 to your computer and use it in GitHub Desktop.

Select an option

Save srikat/8393618 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