Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 27 additions & 24 deletions wp-content/plugins/hello-dolly/hello.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

/**
* @package Hello_Dolly
* @version 1.7.2
*/
/*
Expand All @@ -12,9 +12,10 @@
Author URI: http://ma.tt/
*/

function hello_dolly_get_lyric() {
/** These are the lyrics to Hello Dolly */
$lyrics = "Hello, Dolly
function hello_dolly_get_lyric()
{
/** These are the lyrics to Hello Dolly */
$lyrics = "Hello, Dolly
Well, hello, Dolly
It's so nice to have you back where you belong
You're lookin' swell, Dolly
Expand Down Expand Up @@ -42,35 +43,37 @@ function hello_dolly_get_lyric() {
Promise, you'll never go away
Dolly'll never go away again";

// Here we split it into lines.
$lyrics = explode( "\n", $lyrics );
// Here we split it into lines.
$lyrics = explode("\n", $lyrics);

// And then randomly choose a line.
return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] );
// And then randomly choose a line.
return wptexturize($lyrics[mt_rand(0, count($lyrics) - 1)]);
}

// This just echoes the chosen line, we'll position it later.
function hello_dolly() {
$chosen = hello_dolly_get_lyric();
$lang = '';
if ( 'en_' !== substr( get_user_locale(), 0, 3 ) ) {
$lang = ' lang="en"';
}
function hello_dolly()
{
$chosen = hello_dolly_get_lyric();
$lang = '';
if (substr(get_user_locale(), 0, 3) !== 'en_') {
$lang = ' lang="en"';
}

printf(
'<p id="dolly"><span class="screen-reader-text">%s </span><span dir="ltr"%s>%s</span></p>',
__( 'Quote from Hello Dolly song, by Jerry Herman:', 'hello-dolly' ),
$lang,
$chosen
);
printf(
'<p id="dolly"><span class="screen-reader-text">%s </span><span dir="ltr"%s>%s</span></p>',
__('Quote from Hello Dolly song, by Jerry Herman:', 'hello-dolly'),
$lang,
$chosen
);
}

// Now we set that function up to execute when the admin_notices action is called.
add_action( 'admin_notices', 'hello_dolly' );
add_action('admin_notices', 'hello_dolly');

// We need some CSS to position the paragraph.
function dolly_css() {
echo "
function dolly_css()
{
echo "
<style type='text/css'>
#dolly {
float: right;
Expand All @@ -97,4 +100,4 @@ function dolly_css() {
";
}

add_action( 'admin_head', 'dolly_css' );
add_action('admin_head', 'dolly_css');
Loading