I've been trying to replace more and more of my plugins with functions as well as just finding really useful snippets to customize it..
What are some of your favorite snippets that you've been using?
Mine are:
Disables the textarea for 'post' view. Comes in handy if you've got a setup that utilize only custom fields in various post types.
Code:
add_action('init', 'remove_textarea');
function remove_textarea() {
remove_post_type_support( 'post', 'editor' );
}
Modifies the back-end footer to display text and links of your choice.
Code:
function modify_footer_admin () {
echo 'Created by <a href="">Link</a>';
echo ' Powered by<a href="http://WordPress.org">WordPress</a>.';
}
add_filter('admin_footer_text', 'modify_footer_admin');
If you're making some tweaks and don't want the users to see and/or if you have a WordPress site on a live server that you don't want visitors seeing yet you can toss this up. Replaces any need for a "maintenance mode" plugin.
Code:
function maintenance_mode() {
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {
die('Maintenance.');
}
}
add_action('get_header', 'maintenance_mode');