Skip to content

Instantly share code, notes, and snippets.

@annalinneajohansson
Created May 16, 2013 08:38
Show Gist options
  • Save annalinneajohansson/5590297 to your computer and use it in GitHub Desktop.
Save annalinneajohansson/5590297 to your computer and use it in GitHub Desktop.
Hide widget titles by using an exclamation mark
<?php
/*
Plugin Name: Hide Widget Titles!
Plugin URI:
Description: Prevent widget titles from displaying frontend by prepending them with an exclamation mark (ie. !Widget Title)
Version: 1
Author: Hippies
Author URI: http://hippies.se/
**************************************************************************
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*************************************************************************
*/
add_filter( 'widget_title', 'hip_hide_widget_title' );
function hip_hide_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