Created
June 11, 2012 13:16
-
-
Save siriokun/2910052 to your computer and use it in GitHub Desktop.
Check if WordPress site description is default, show notice to update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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