-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathzing.php
59 lines (55 loc) · 1.23 KB
/
zing.php
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Plugin Name: Zing!
* Description: Turn your admin panel upside down. Literally.
* Version: 0.1.0
* Author: Frankie Jarrett
* Author URI: http://frankiejarrett.com
* Text Domain: zing
*
* Copyright: © 2015 Frankie Jarrett.
* License: GNU General Public License v2.0
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
/**
* Add a custom class to the body element
*
* @filter admin_body_class
*
* @return string
*/
function zing_admin_body_class( $classes ) {
$classes .= ' zing ';
return $classes;
}
add_filter( 'admin_body_class', 'zing_admin_body_class' );
/**
* Modify the DOM on all admin screens
*
* @filter admin_head
*
* @return void
*/
function zing_admin_head() {
?>
<script>
jQuery( document ).ready( function( $ ) {
$( document ).keypress( function( e ) {
if ( 122 === e.which ) {
$( 'body' ).toggleClass( 'zing' );
}
});
});
</script>
<style type="text/css">
body.zing #wpbody {
margin: 0 18px 0 -18px;
-ms-transform: rotate(180deg); /* IE 9 */
-moz-transform: rotate(180deg); /* Firefox */
-webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */
transform: rotate(180deg);
}
</style>
<?php
}
add_action( 'admin_head', 'zing_admin_head' );