We’ve been doing some seriously cool stuff with Barry of late but it’s been pretty chunky too and, in between mountains of code, decided it was time to clear the decks… get seriously Zen and look to the simple in life.
So, Barry challenges you to declare:
What’s the shortest, yet most useful, WordPress plugin (WP and/or WPMU) you’ve come across or can write yourself?
Length is measured from the start of the actual code, to the end (no need to count the bumpf up top), and quality is rated by usefulness, coolness and general bestness.
Make your submissions (your own, or other peoples plugins) in the comments! May the briefest win!







Ok, I’ll start. As James mentioned before, this is for plugins. The plugin must actually complete the task, but doesn’t need to include the “header comments”.
Disable the flash uploader plugin:
add_filter('flash_uploader', create_function('$flash', 'return false;'));
Here’s a one liner I now use to force a blog’s printed pages to look the same as its screen pages.
WYSIWYG Print Plugin:
`add_action(‘wp_head’, create_function(‘$print’, ‘print “”;’) );`
add_action('wp_head', create_function('$print', 'print "";') );Baa, sorry but the comment form borks the code. Here,
http://wpmudev.org/project/Wysiwyg-Print/download
Erg, sorry ’bout that, will put it in the mixer for upcoming wpmu.org redesign!
Knocking off 9 characters from the original plugin. Makes it smaller but a little bit trickier to read:
add_filter(‘flash_uploader’,create_function(‘$f’,'return 0;’));
And, yes I know 0 in php technically isn’t false, but the check for $flash doesn’t use a explicit check for false (===) so it works in this case.
I keep an emergency “disable all avatars” plugin handy to drop in mu-plugin “just in case”:
function get_avatar() {}I never could get that style of function override to work properly, so I gave up on them :)
?>
:)