Skip to content

Instantly share code, notes, and snippets.

@siriokun
Created June 11, 2012 13:16
Show Gist options
  • Save siriokun/2910052 to your computer and use it in GitHub Desktop.
Save siriokun/2910052 to your computer and use it in GitHub Desktop.
Check if WordPress site description is default, show notice to update
<?php
/**
* Checks to see if your tagline is set to the default and shows an admin notice to update it
* Throw this in function.php for your theme
*/
if (get_option('blogdescription') == 'Just another WordPress site') { add_action('admin_notices', create_function( '', "echo '<div class=\"error\"><p>".sprintf(__('Please update your <a href="%s">tagline</a>', 'bb'), admin_url('options-general.php'))."</p></div>';" ) ); };
// Different approach
/**
* Don't return the default description in the RSS feed if it hasn't been changed
*/
function roots_remove_default_description($bloginfo) {
$default_tagline = 'Just another WordPress site';
return ($bloginfo === $default_tagline) ? '' : $bloginfo;
}
add_filter('get_bloginfo_rss', 'roots_remove_default_description');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment