Created
March 14, 2019 09:51
-
-
Save timiwahalahti/b51103dcc4335b43a19ace918fc21961 to your computer and use it in GitHub Desktop.
WP Gotta Go Fast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: WP Gotta Go Fast | |
Plugin URI: https://dude.fi | |
Description: Gotta Go Fast | |
Author: Timi Wahalahti | |
Version: 0.1.0 | |
Author URI: https://sipp.is | |
Text Domain: wp-gotta-go-fast | |
*/ | |
add_action( 'admin_init', 'maybe_go_fast' ); | |
function maybe_go_fast() { | |
if ( apply_filters( 'wp_gotta_go_fast', false ) ) { | |
add_action( 'admin_notices', 'go_fast' ); | |
add_action( 'admin_head', 'go_fast_css' ); | |
} | |
} | |
function go_fast() { | |
echo '<div id="go-fast"><svg xml:space="preserve" enable-background="new 0 0 100 100" viewBox="0 0 100 100" height="100px" width="100px" y="0px" x="0px" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:graph="http://ns.adobe.com/Graphs/1.0/" xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/" xmlns:x="http://ns.adobe.com/Extensibility/1.0/"><path d="M74.783,29.908c3.538,0,6.407-2.875,6.407-6.414c0-3.54-2.869-6.412-6.407-6.412c-3.547,0-6.42,2.873-6.42,6.412 S71.236,29.908,74.783,29.908z"/><path d="M88.075,42.323L77.32,44.001c-1.533,0.238-3.146-0.783-3.581-2.273l-2.961-10.124c-0.436-1.489-1.926-3.28-3.312-3.979 L52.781,20.21c-1.386-0.699-3.753-0.969-5.261-0.6l-12.879,3.153c-1.508,0.369-2.741,1.814-2.741,3.211 c0,1.397,1.234,2.244,2.743,1.882l11.27-2.702c1.51-0.362,3.833-0.005,5.164,0.792l3.649,2.185 c1.332,0.797,1.335,2.107,0.007,2.912l-11.298,6.84c-1.327,0.805-3.034,2.367-3.793,3.475c-0.758,1.105,2.134,7.191,2.8,8.594 l3.52,7.459c0.665,1.402-0.061,2.59-1.613,2.59H30.057c-1.552,0-2.719,1.225-2.591,2.771l0.183,1.816 C27.775,66.136,29.149,67,30.702,67h24.89c1.551,0,2.37-0.807,1.82-2.258l-4.359-11.287c-0.552-1.451-1.35-3.765-1.773-5.257 l-0.146-0.467c-0.424-1.493,0.326-3.332,1.666-4.113l7.84-4.561c1.34-0.782,3.139-1.759,3.998-2.179 c0.857-0.419,1.907,0.462,2.332,1.956l2.686,9.426c0.424,1.493,2.014,2.447,3.53,2.119l14.921-3.23 c1.516-0.329,2.758-1.646,2.758-2.929S89.608,42.084,88.075,42.323z"/><path d="M47.489,69h-6.019c-1.553,0-3.858,0.557-5.125,1.455l-7.062,4.919c-1.266,0.897-1.566,2.622-0.668,3.889l1.398,1.948 c0.899,1.266,2.628,1.499,3.842,0.533l14.248-11.159C49.317,69.619,49.041,69,47.489,69z"/><path d="M40.143,35c1.552,0,2.822-0.51,2.822-1s-1.271-1-2.822-1H10.46c-1.552,0-2.822,0.51-2.822,1s1.271,1,2.822,1H40.143z"/><path d="M38.644,38c0-0.49-1.271-1-2.822-1H13.912c-1.553,0-2.822,0.51-2.822,1s1.27,1,2.822,1h21.909 C37.373,39,38.644,38.49,38.644,38z"/><path d="M37.214,42c0-0.489-1.27-1-2.821-1H16.21c-1.553,0-2.823,0.511-2.823,1c0,0.49,1.271,1,2.823,1h18.183 C35.944,43,37.214,42.49,37.214,42z"/></svg></div>'; | |
} | |
function go_fast_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'> | |
#go-fast { | |
float: $x; | |
margin: 0; | |
} | |
#go-fast svg { | |
width: 40px; | |
height: 40px; | |
} | |
</style> | |
"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment