Skip to content

Instantly share code, notes, and snippets.

@spigists
spigists / functions.php
Created June 10, 2013 21:39
Obscure log in screen error messages
/**
* Obscure log in screen error messages
*/
function wpfme_login_obscure(){ return '<strong>Oh no... </strong>It looks like the user name and password combination that you entered is wrong.';}
add_filter( 'login_errors', 'wpfme_login_obscure' );
@spigists
spigists / functions.php
Created June 10, 2013 21:37
Keep WordPress from putting the version number in the page header
/**
* Remove WordPress version number from header
*/
remove_action('wp_head', 'wp_generator');
@spigists
spigists / functions.php
Created June 10, 2013 21:34
Stop images from getting wrapped in <p> tags when they are displayed with the_content()
/**
* Stop images from getting wrapped in the_content()'s <p> tags
*/
function remove_img_ptags($content){
return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
}
add_filter('the_content', 'remove_img_ptags');
@spigists
spigists / functions.php
Created June 10, 2013 21:33
Replace the default WordPress dashboard footer text and link with a custom message
/**
* Replace the default WordPress dashboard footer text and link with a custom message
*/
function footer_admin () {
echo 'Website designed and developed by <a href="http://go-spi.com/" target="_blank">Schmitt ProfiTools, Inc.</a>';
}
add_filter('admin_footer_text', 'footer_admin');
@spigists
spigists / functions.php
Created June 10, 2013 21:19
Re-enable the built in WordPress links manager in in 3.5+ installs
/**
* Re-enable the built in WordPress links manager
*/
add_filter( 'pre_option_link_manager_enabled', '__return_true' );