Hello Dolly - Version 1.7.2

Version Description

Download this release

Release Info

Developer Otto42
Plugin Icon 128x128 Hello Dolly
Version 1.7.2
Comparing to
See all releases

Code changes from version 1.6 to 1.7.2

Files changed (2) hide show
  1. hello.php +38 -20
  2. readme.txt +6 -4
hello.php CHANGED
@@ -1,16 +1,15 @@
1
  <?php
2
  /**
3
  * @package Hello_Dolly
4
- * @version 1.6
5
  */
6
  /*
7
  Plugin Name: Hello Dolly
8
- Plugin URI: https://wordpress.org/plugins/hello-dolly/
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
  Author: Matt Mullenweg
11
- Version: 1.6
12
- Author URI: https://ma.tt/
13
- Text Domain: hello-dolly
14
  */
15
 
16
  function hello_dolly_get_lyric() {
@@ -43,40 +42,59 @@ Dolly, never go away
43
  Promise, you'll never go away
44
  Dolly'll never go away again";
45
 
46
- // Here we split it into lines
47
  $lyrics = explode( "\n", $lyrics );
48
 
49
- // And then randomly choose a line
50
  return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] );
51
  }
52
 
53
- // This just echoes the chosen line, we'll position it later
54
  function hello_dolly() {
55
  $chosen = hello_dolly_get_lyric();
56
- echo "<p id='dolly'>$chosen</p>";
 
 
 
 
 
 
 
 
 
 
57
  }
58
 
59
- // Now we set that function up to execute when the admin_notices action is called
60
  add_action( 'admin_notices', 'hello_dolly' );
61
 
62
- // We need some CSS to position the paragraph
63
  function dolly_css() {
64
- // This makes sure that the positioning is also good for right-to-left languages
65
- $x = is_rtl() ? 'left' : 'right';
66
-
67
  echo "
68
  <style type='text/css'>
69
  #dolly {
70
- float: $x;
71
- padding-$x: 15px;
72
- padding-top: 5px;
73
  margin: 0;
74
- font-size: 11px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  }
76
  </style>
77
  ";
78
  }
79
 
80
  add_action( 'admin_head', 'dolly_css' );
81
-
82
-
1
  <?php
2
  /**
3
  * @package Hello_Dolly
4
+ * @version 1.7.2
5
  */
6
  /*
7
  Plugin Name: Hello Dolly
8
+ Plugin URI: http://wordpress.org/plugins/hello-dolly/
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
  Author: Matt Mullenweg
11
+ Version: 1.7.2
12
+ Author URI: http://ma.tt/
 
13
  */
14
 
15
  function hello_dolly_get_lyric() {
42
  Promise, you'll never go away
43
  Dolly'll never go away again";
44
 
45
+ // Here we split it into lines.
46
  $lyrics = explode( "\n", $lyrics );
47
 
48
+ // And then randomly choose a line.
49
  return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] );
50
  }
51
 
52
+ // This just echoes the chosen line, we'll position it later.
53
  function hello_dolly() {
54
  $chosen = hello_dolly_get_lyric();
55
+ $lang = '';
56
+ if ( 'en_' !== substr( get_user_locale(), 0, 3 ) ) {
57
+ $lang = ' lang="en"';
58
+ }
59
+
60
+ printf(
61
+ '<p id="dolly"><span class="screen-reader-text">%s </span><span dir="ltr"%s>%s</span></p>',
62
+ __( 'Quote from Hello Dolly song, by Jerry Herman:', 'hello-dolly' ),
63
+ $lang,
64
+ $chosen
65
+ );
66
  }
67
 
68
+ // Now we set that function up to execute when the admin_notices action is called.
69
  add_action( 'admin_notices', 'hello_dolly' );
70
 
71
+ // We need some CSS to position the paragraph.
72
  function dolly_css() {
 
 
 
73
  echo "
74
  <style type='text/css'>
75
  #dolly {
76
+ float: right;
77
+ padding: 5px 10px;
 
78
  margin: 0;
79
+ font-size: 12px;
80
+ line-height: 1.6666;
81
+ }
82
+ .rtl #dolly {
83
+ float: left;
84
+ }
85
+ .block-editor-page #dolly {
86
+ display: none;
87
+ }
88
+ @media screen and (max-width: 782px) {
89
+ #dolly,
90
+ .rtl #dolly {
91
+ float: none;
92
+ padding-left: 0;
93
+ padding-right: 0;
94
+ }
95
  }
96
  </style>
97
  ";
98
  }
99
 
100
  add_action( 'admin_head', 'dolly_css' );
 
 
readme.txt CHANGED
@@ -1,11 +1,13 @@
1
  === Hello Dolly ===
2
- Contributors: matt
3
- Stable tag: 1.6
4
- Tested up to: 4.9
5
  Requires at least: 4.6
6
 
7
  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.
8
 
9
  == Description ==
10
 
11
- 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.
 
 
1
  === Hello Dolly ===
2
+ Contributors: matt, wordpressdotorg
3
+ Stable tag: 1.7.2
4
+ Tested up to: 5.2
5
  Requires at least: 4.6
6
 
7
  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.
8
 
9
  == Description ==
10
 
11
+ 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.
12
+
13
+ Thanks to Sanjib Ahmad for the artwork.