Make WordPress Core

Ticket #43632: 43632.6.diff

File 43632.6.diff, 1.6 KB (added by audrasjb, 7 years ago)
  • src/wp-content/plugins/hello.php

    diff --git a/src/wp-content/plugins/hello.php b/src/wp-content/plugins/hello.php
    index 34e3b68..f59c9bc 100644
    a b Description: This is not just a plugin, it symbolizes the hope and enthusiasm of 
    1010Author: Matt Mullenweg
    1111Version: 1.7
    1212Author URI: http://ma.tt/
     13Text Domain: hello-dolly
    1314*/
    1415
    1516function hello_dolly_get_lyric() {
    Dolly'll never go away again"; 
    5253// This just echoes the chosen line, we'll position it later
    5354function hello_dolly() {
    5455        $chosen = hello_dolly_get_lyric();
    55         echo "<p id='dolly'>$chosen</p>";
     56        $lang = '';
     57        if ( 'en_' === substr( get_user_locale(), 0, 3 ) ) {
     58                $lang = " lang='en'";
     59        }
     60
     61        printf(
     62                "<p id='dolly'><span class='screen-reader-text'>%s </span><span%s>%s</span></p>",
     63                __( 'Quote from Hello Dolly song:', 'hello-dolly' ),
     64                $lang,
     65                $chosen
     66        );
    5667}
    5768
    5869// Now we set that function up to execute when the admin_notices action is called
    add_action( 'admin_notices', 'hello_dolly' ); 
    6071
    6172// We need some CSS to position the paragraph
    6273function dolly_css() {
    63         // This makes sure that the positioning is also good for right-to-left languages
    64         $x = is_rtl() ? 'left' : 'right';
    65 
    6674        echo "
    6775        <style type='text/css'>
    6876        #dolly {
    69                 float: $x;
    70                 padding-$x: 15px;
    71                 padding-top: 5px;               
     77                float: right;
     78                padding: 6px 10px 4px 0;
    7279                margin: 0;
     80                line-height: 1.7;
    7381                font-size: 11px;
    7482        }
     83        body.rtl #dolly {
     84                float: left;
     85                padding: 6px 0 4px 10px;
     86        }
     87        @media screen and (max-width: 782px) {
     88                #dolly {
     89                        float: none;
     90                }
     91        }
    7592        </style>
    7693        ";
    7794}
    7895
    7996add_action( 'admin_head', 'dolly_css' );
    80 
    81