Skip to content

Instantly share code, notes, and snippets.

@rnagle
Last active August 29, 2015 14:12
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 rnagle/d561bd58504a644e9657 to your computer and use it in GitHub Desktop.
Save rnagle/d561bd58504a644e9657 to your computer and use it in GitHub Desktop.
Hello World!
<?php
/**
* @package Hello_World
* @version 0.1
*
* Plugin Name: Hello World!
* Plugin URI: https://gist.github.com/rnagle/d561bd58504a644e9657
* Description: Just a simple WordPress plugin that prints "Hello world!" in the top corner of the WordPress dashboard.
* Author: Ryan Nagle
* Version: 0.1
**/
function hello_world() {
return "Hello world!";
}
function hello_world_markup() {
echo "<p id='hello-world'>" . hello_world() . "</p>";
}
add_action('admin_notices', 'hello_world_markup');
function hello_world_css() {
$x = is_rtl() ? 'left' : 'right';
echo "
<style type='text/css'>
#hello-world {
float: $x;
padding-$x: 15px;
padding-top: 5px;
margin: 0;
font-size: 11px;
}
</style>
";
}
add_action('admin_head', 'hello_world_css');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment