Changeset 16270
- Timestamp:
- 11/10/2010 12:43:04 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/plugins/hello.php
r15997 r16270 2 2 /** 3 3 * @package Hello_Dolly 4 * @version 1. 5.14 * @version 1.6 5 5 */ 6 6 /* 7 7 Plugin Name: Hello Dolly 8 Plugin URI: http://wordpress.org/ #8 Plugin URI: http://wordpress.org/extend/plugins/hello-dolly/ 9 9 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. 10 10 Author: Matt Mullenweg 11 Version: 1. 5.111 Version: 1.6 12 12 Author URI: http://ma.tt/ 13 13 */ … … 45 45 46 46 // Here we split it into lines 47 $lyrics = explode( "\n", $lyrics);47 $lyrics = explode( "\n", $lyrics ); 48 48 49 49 // And then randomly choose a line 50 return wptexturize( $lyrics[ mt_rand( 0, count($lyrics) - 1) ] );50 return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] ); 51 51 } 52 52 … … 57 57 } 58 58 59 // Now we set that function up to execute when the admin_ footeraction is called60 add_action( 'admin_footer', 'hello_dolly');59 // Now we set that function up to execute when the admin_notices action is called 60 add_action( 'admin_notices', 'hello_dolly' ); 61 61 62 62 // We need some CSS to position the paragraph 63 63 function dolly_css() { 64 // This makes sure that the posi nioning is also good for right-to-left languages65 $x = ( is_rtl()) ? 'left' : 'right';64 // This makes sure that the positioning is also good for right-to-left languages 65 $x = is_rtl() ? 'left' : 'right'; 66 66 67 67 echo " 68 68 <style type='text/css'> 69 69 #dolly { 70 position: absolute; 71 top: 4.5em; 70 float: $x; 71 padding-$x: 15px; 72 padding-top: 5px; 72 73 margin: 0; 73 padding: 0;74 $x: 215px;75 74 font-size: 11px; 76 75 } … … 79 78 } 80 79 81 add_action( 'admin_head', 'dolly_css');80 add_action( 'admin_head', 'dolly_css' ); 82 81 83 82 ?>
Note: See TracChangeset
for help on using the changeset viewer.