FriendlyWP
10/26/2013 - 1:32 AM

Remove widget title if it begins with an exclamation point (!)

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 );
}