Skip to content

Instantly share code, notes, and snippets.

@FriendlyWP
Created October 26, 2013 01:32
Show Gist options
  • Save FriendlyWP/7164284 to your computer and use it in GitHub Desktop.
Save FriendlyWP/7164284 to your computer and use it in GitHub Desktop.
Remove widget title if it begins with an exclamation point (!)
// REMOVE WIDGET TITLE IF IT BEGINS WITH EXCLAMATION POINT
// To use, add a widget and in the Title field put !The title here
// The title will show in the control panel, but not on the site itself
add_filter( 'widget_title', 'remove_widget_title' );
function remove_widget_title( $widget_title ) {
if ( substr ( $widget_title, 0, 1 ) == '!' )
return;
else
return ( $widget_title );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment