Skip to content

Instantly share code, notes, and snippets.

@illyaking
Forked from billday/hello.php
Last active May 8, 2018 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save illyaking/fd1a20d6110d6c49e4eb209c9fcabaaa to your computer and use it in GitHub Desktop.
Save illyaking/fd1a20d6110d6c49e4eb209c9fcabaaa to your computer and use it in GitHub Desktop.
Hello Nacho WP plugin
<?php
/**
* @package Hello_Nacho
* @version 1.7
*/
/*
Plugin Name: Hello Nacho
Plugin URI: http://wordpress.org/#
Description: This is a parody/rip-off/modification of Matt Mullenweg's Hello Dolly plugin. The lyrics are from Nacho Libre's Forbidden Nectar song.
Author: Matt Mullenweg
Version: 1.7
Author URI: http://ma.tt/
*/
function hello_nacho_get_lyric() {
/** These are the lyrics to Forbidden Nector*/
$lyrics = "When you notice my biceps, with the eyes of a dove...
With the breath of a lion, I will sing you my song.
Forget about Hector, his mustache is like a girl...
I could rupture his intestine, with the flexion of my thigh.
My love is like the nectar, from a fruit which is forbidden...
And in my heart is hidden, all the messes of my love!
When you perchance to see my haunches, like a stallion they are tight...
With a breath of a chicken, dark intruders take their flight.
My love it will protect you, like a vest of bullet-proofness...
In the wind I am a warrior, in your arms I am a child.
...I see you at night ...You are so delicate
...No one will touch you ...While I am watching
My love is like the nectar, from a fruit which is forbidden...
And in my heart is hidden, all the messes of my love!
...When I see you ...My thighs quiver like a girl.
...But I need you to know ...that I am strong like a stallion.
...I will take you on a ride ...Through the desert ...On my back";
// 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 ) ] );
}
// This just echoes the chosen line, we'll position it later
function hello_nacho() {
$chosen = hello_nacho_get_lyric();
echo "<p id='nacho'>$chosen</p>";
}
// Now we set that function up to execute when the admin_notices action is called
add_action( 'admin_notices', 'hello_nacho' );
// We need some CSS to position the paragraph
function nacho_css() {
// This makes sure that the positioning is also good for right-to-left languages
$x = is_rtl() ? 'left' : 'right';
echo "
<style type='text/css'>
#nacho {
float: $x;
padding-$x: 15px;
padding-top: 5px;
margin: 0;
font-size: 11px;
}
</style>
";
}
add_action( 'admin_head', 'nacho_css' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment