Skip to content

Instantly share code, notes, and snippets.

@nciske
Created September 19, 2015 02:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nciske/fdcadd66d6d692462d5b to your computer and use it in GitHub Desktop.
Save nciske/fdcadd66d6d692462d5b to your computer and use it in GitHub Desktop.
Quick filter to allow you to add a "note" to the widget title that doesn’t display on the front end.
<?php
add_filter( 'widget_title', 'example_widget_title_filter' );
function example_widget_title_filter( $title ){
if( is_admin() )
return;
if( strpos( $title, '|') !== false ){
$title = trim( end( explode( '|', $title ) ) );
}
return $title;
}
@colinoakes
Copy link

This worked perfectly. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment