-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbeta-ribbon.php
More file actions
43 lines (36 loc) · 1.28 KB
/
Copy pathbeta-ribbon.php
File metadata and controls
43 lines (36 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* @package beta-ribbon
* @version 0.2
*/
/*
Plugin Name: Beta Ribbon
Plugin URI: https://turriffweb.co.uk/wordpress/plugins/beta-ribbon/
Description: When activated this will show a BETA ribbon on the top left corner of your website. Deactivate the plugin to remove your site from beta :)
Version: 0.2
Author: Mike Rawlins
Author URI:
License: WTFPL
*/
/*
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
*/
function render_beta_ribbon() {
$ribbon_url = plugins_url('beta-ribbon.png', __FILE__ );
if(function_exists('is_admin_bar_showing')) {
$padding_top = is_admin_bar_showing() ? 28 : 0;
} else {
$padding_top = 0;
}
echo "class='beta-ribbon' <img src='{$ribbon_url}' alt='This is BETA' style='position: absolute; top: ".$padding_top ."px; left: 0; z-index: 100000; border:none;' />";
}
add_action('wp_footer', 'render_beta_ribbon');
?>