WordPress.org

Make WordPress Core

Changeset 1340


Ignore:
Timestamp:
05/22/2004 08:45:36 AM (16 years ago)
Author:
saxmatt
Message:

Updated hooks and a new Dolly plugin.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-footer.php

    r1144 r1340  
    55?>
    66</p>
    7 
     7<?php do_action('admin_footer', ''); ?>
    88</body>
    99</html>
  • trunk/wp-admin/admin-functions.php

    r1324 r1340  
    11<?php
    2 
    3 function wp_admin_head() {
    4     do_action('wp_head', '');
    5 }
    62
    73function url_shorten ($url) {
  • trunk/wp-admin/admin-header.php

    r1236 r1340  
    131131<?php endif; ?>
    132132
    133 <?php wp_admin_head(); ?>
     133<?php do_action('admin_head', ''); ?>
    134134</head>
    135135<body>
  • trunk/wp-content/plugins/hello.php

    r1108 r1340  
    33Plugin Name: Hello Dolly
    44Plugin URI: http://wordpress.org/#
    5 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. This is, by the way, the world's first official WordPress plugin. When enabled you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen.
     5Description: 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. This is, by the way, the world's first official WordPress plugin. When enabled you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page but the plugins page.
    66Author: Matt Mullenweg
    77Author URI: http://photomatt.net/
    88*/
    99
     10// These are the lyrics to Hello Dolly
     11$lyrics = "Hello, Dolly
     12Well, hello, Dolly
     13It's so nice to have you back where you belong
     14You're lookin' swell, Dolly
     15I can tell, Dolly
     16You're still glowin', you're still crowin'
     17You're still goin' strong
     18We feel the room swayin'
     19While the band's playin'
     20One of your old favourite songs from way back when
     21So, take her wrap, fellas
     22Find her an empty lap, fellas
     23Dolly'll never go away again
     24Hello, Dolly
     25Well, hello, Dolly
     26It's so nice to have you back where you belong
     27You're lookin' swell, Dolly
     28I can tell, Dolly
     29You're still glowin', you're still crowin'
     30You're still goin' strong
     31We feel the room swayin'
     32While the band's playin'
     33One of your old favourite songs from way back when
     34Golly, gee, fellas
     35Find her a vacant knee, fellas
     36Dolly'll never go away
     37Dolly'll never go away
     38Dolly'll never go away again";
     39
     40// Here we split it into lines
     41$lyrics = explode("\n", $lyrics);
     42// And then randomly choose a line
     43$chosen = wptexturize( $lyrics[ mt_rand(0, count($lyrics) ) ] );
     44
     45// This just echoes the chosen line, we'll position it later
    1046function hello_dolly() {
    11     echo "It's me, Dolly.";
     47    global $chosen;
     48    echo "<p id='dolly'>$chosen</p>";
    1249}
     50
     51// Now we set that function up to execute when the admin_footer action is called
     52add_action('admin_footer', 'hello_dolly');
     53
     54// We need some CSS to position the paragraph
     55function dolly_css() {
     56    echo "
     57    <style type='text/css'>
     58    #dolly {
     59        position: absolute;
     60        top: 5px;
     61margin: 0; padding: 0;
     62        right: 3em;
     63        font-size: 20px;
     64        color: #666;
     65    }
     66    </style>
     67    ";
     68}
     69
     70add_action('admin_head', 'dolly_css');
     71
    1372?>
Note: See TracChangeset for help on using the changeset viewer.