How To Automatically Add Post Name To The Body Class
The following snippet will let you automatically add post name to the body class.
1 2 3 4 5 6 7 8 9 10 |
function wpprogrammer_post_name_in_body_class( $classes ){ if( is_singular() ) { global $post; array_push( $classes, "{$post->post_type}-{$post->post_name}" ); } return $classes; } add_filter( 'body_class', 'wpprogrammer_post_name_in_body_class' ); |
Snippet source/Credit: WPProgrammer.com
How To Add An Extra Contact Methods To User Profiles
The following snippet will let you add an extra contact methods to user profiles.
1 2 3 4 5 6 |
add_filter('user_contactmethods', 'my_user_contactmethods'); function my_user_contactmethods($user_contactmethods){ $user_contactmethods['twitter'] = 'Twitter Username'; $user_contactmethods['facebook'] = 'Facebook Username'; return $user_contactmethods; } |
Snippet Source/Credit: TutsPlus
How to change WordPress editor font
Using the following snippet, you will be able to change WordPress editor font.
1 2 3 4 5 |
add_action( 'admin_head-post.php', 'devpress_fix_html_editor_font' ); add_action( 'admin_head-post-new.php', 'devpress_fix_html_editor_font' ); function devpress_fix_html_editor_font() { ?> <style type="text/css">#editorcontainer #content, #wp_mce_fullscreen { font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; }</style> <?php } |
Snippet Source/Credit: DevPress
How To Automatically Obfuscate Email Addresses
The following snippet will let you automatically obfuscate email addresses.
1 |
<?php antispambot('name@email.com',1 ) ?> |
Snippet Source/Credit: WordPress Codex
How To Disable Plugins Update In WordPress
The following snippet will let you disable plugins update in WordPress.
1 2 |
remove_action( 'load-update-core.php', 'wp_update_plugins' ); add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) ); |
Snippet Source/Credit: WP Snippets