Skip to content

Instantly share code, notes, and snippets.

@FriendlyWP
Created October 26, 2013 00:52
Show Gist options
  • Save FriendlyWP/7164007 to your computer and use it in GitHub Desktop.
Save FriendlyWP/7164007 to your computer and use it in GitHub Desktop.
Bold words in widget titles using underscore + asterisk (_* word *_).
// REPLACE _* *_ WITH <STRONG> HTML IN WIDGET TITLES
// usage: _*This*_ word is bold
add_filter( 'widget_title', function($title) {
$title = str_replace('_*', '<strong>', $title);
$title = str_replace('*_', '</strong>', $title);
return $title;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment