4 * @author Matt Mullenweg
8 Plugin Name: Hello Dolly
9 Plugin URI: http://wordpress.org/#
10 Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
11 Author: Matt Mullenweg
13 Author URI: http://ma.tt/
16 function hello_dolly_get_lyric() {
17 /** These are the lyrics to Hello Dolly */
18 $lyrics = "Hello, Dolly
20 It's so nice to have you back where you belong
21 You're lookin' swell, Dolly
23 You're still glowin', you're still crowin'
24 You're still goin' strong
25 We feel the room swayin'
26 While the band's playin'
27 One of your old favourite songs from way back when
28 So, take her wrap, fellas
29 Find her an empty lap, fellas
30 Dolly'll never go away again
33 It's so nice to have you back where you belong
34 You're lookin' swell, Dolly
36 You're still glowin', you're still crowin'
37 You're still goin' strong
38 We feel the room swayin'
39 While the band's playin'
40 One of your old favourite songs from way back when
42 Find her a vacant knee, fellas
43 Dolly'll never go away
44 Dolly'll never go away
45 Dolly'll never go away again";
47 // Here we split it into lines
48 $lyrics = explode("\n", $lyrics);
50 // And then randomly choose a line
51 return wptexturize( $lyrics[ mt_rand(0, count($lyrics) - 1) ] );
54 // This just echoes the chosen line, we'll position it later
55 function hello_dolly() {
56 $chosen = hello_dolly_get_lyric();
57 echo "<p id='dolly'>$chosen</p>";
60 // Now we set that function up to execute when the admin_footer action is called
61 add_action('admin_footer', 'hello_dolly');
63 // We need some CSS to position the paragraph
64 function dolly_css() {
66 <style type='text/css'>
79 add_action('admin_head', 'dolly_css');