Advertisement
Guest User

Untitled

a guest
Mar 1st, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.55 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @package Hello_Tempz
  4.  * @version 1.0
  5.  */
  6.  
  7. function hello_tempz_get_lyric() {
  8.     /** These are the lyrics to Next Hype */
  9.     $lyrics = "What kind of things that you have
  10. When I find out don't expect me to stop
  11. I'll come for the P's that you stack
  12. And come for all the food that you blot
  13. Better hand over the bag
  14. Your boys don't wanna see you shot
  15. If I kick down the door to your flat
  16. Dun Know I'll clear out your house on the spot
  17. (CLEAR!) All the things in your house
  18. (CLEAR!) All the things in your fridge
  19. (SMASH!) All your plates from your rack
  20. (CLEAR!) All of your kids' toys
  21. (CLEAR!) All of your CD rack
  22. Won't get none of your CD's back
  23. Drag off your curtain rail from the wall
  24. Kick off your HDTV from the stand
  25. Run up on stairs into rooms
  26. Flip the mattress and search for the cash
  27. Make man look down the barrel of a mash
  28. It's not worth your life, just cough up the scratch
  29. It's too late to lock up the latch
  30. I can smell the crow, just pull out the batch
  31. I'm not here to cotch or relax
  32. And drink your wine here just pull out the bags
  33. I have to punch up guys
  34. Guys try it with me, I don't know why
  35. Bax! Pax man straight in his eyes
  36. They floored me, I was looking at the sky
  37. Par! Now I have to go blind
  38. That boy there I swear he gonna die
  39. You're not bad you're a mug don't think you're a guy
  40. When I slap man you won't be alright
  41. Catch man on the field flying his kite
  42. Roll man down on the grass with a knife
  43. Watch as his friends disperse out of sight from afar
  44. I can hear screams from his wife
  45. Run after man let me draw for his life
  46. Blood's pouring I got stains off the knife
  47. Leave guys dead in the field over night
  48. I'm sick, when I dream I won't think of them twice";
  49.  
  50.     // Here we split it into lines
  51.     $lyrics = explode( "\n", $lyrics );
  52.  
  53.     // And then randomly choose a line
  54.     return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] );
  55. }
  56.  
  57. // This just echoes the chosen line, we'll position it later
  58. function hello_tempz() {
  59.     $chosen = hello_tempz_get_lyric();
  60.     echo "<p id='dolly'>$chosen</p>";
  61. }
  62.  
  63. // Now we set that function up to execute when the admin_notices action is called
  64. add_action( 'admin_notices', 'hello_tempz' );
  65.  
  66. // We need some CSS to position the paragraph
  67. function tempz_css() {
  68.     // This makes sure that the positioning is also good for right-to-left languages
  69.     $x = is_rtl() ? 'left' : 'right';
  70.  
  71.     echo "
  72.     <style type='text/css'>
  73.     #dolly {
  74.         float: $x;
  75.         padding-$x: 15px;
  76.         padding-top: 5px;      
  77.         margin: 0;
  78.         font-size: 11px;
  79.     }
  80.     </style>
  81.     ";
  82. }
  83.  
  84. add_action( 'admin_head', 'tempz_css' );
  85.  
  86. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement