Skip to content

Instantly share code, notes, and snippets.

@rnagle rnagle/hello_world.php Secret

Last active Aug 29, 2015
Embed
What would you like to do?
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
You can’t perform that action at this time.