-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathit-gets-better.php
More file actions
117 lines (108 loc) · 4.33 KB
/
it-gets-better.php
File metadata and controls
117 lines (108 loc) · 4.33 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
/**
* @package It-Gets-Better
* @version 2.0.1
*
* Plugin Name: It Gets Better!
* Plugin URI: https://boofolaworks.com/wordpress/plugins/mu-multisite-plugins/
* Description: This is just a simple plugin, it tries to give hope while you work by randomly showing inspirational quotes in the upper right of your admin screen on every page.
* Version: 2.0.1
* Author: BOOFOLA LLC
* Author URI: https://boofolallc.com/
* License: GPLv2 or later
* Text Domain: mu-multisite-plugins
*
* @package BoofolaWorks Must-Use Multisite Plugins
* @category Settings
*
* This plugin is created as free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
function it_gets_better_get_quotes() {
/** These are the quotes to inspire! */
$quotes = "Smile at strangers and you just might change a life.
It only takes a split second to smile and forget, yet to someone that needed it, it can last a lifetime.
If you’re reading this… Congratulations, you’re alive. If that’s not something to smile about, then I don’t know what is.
Smile! It increases your face value.
No Matter What is Happening In Your Life, It Really Does Get BETTER!
Smile, it’s free therapy.
Use your smile to change the world; don’t let the world change your smile.
A smile is a curve that sets everything straight.
Today, give a stranger one of your smiles. It might be the only sunshine he sees all day.
Always find opportunities to make someone smile, and to offer random acts of kindness in everyday life.
A gentle word, a kind look, a good-natured smile can work wonders and accomplish miracles.
A warm smile is the universal language of kindness.
A smile is the universal welcome.
A smiling face is a beautiful face. A smiling heart is a happy heart.
Life is like a mirror. Smile at it and it smiles back at you.
A smile is a friend maker.
Nothing you wear is more important than your smile.
You’ll find that life is still worthwhile, if you just smile.
A smile is happiness you’ll find right under your nose.
Sometimes your joy is the source of your smile, but sometimes your smile can be the source of your joy.
A smile remains the most inexpensive gift I can bestow on anyone and yet its powers can vanquish kingdoms.
Smile, it is the key that fits the lock of everybody’s heart.
Lighten up, just enjoy life, smile more, laugh more, and don’t get so worked up about things.
One of the most rewarding things in life is to always put a smile on your face.
If you smile when you are alone, then you really mean it.
Wrinkles should merely indicate where smiles have been.
Smiling is the best way to face every problem, to crush every fear and to hide every pain.
Never regret anything that made you smile.
It’s hard not to feel happy when you make someone smile.
Anyone can smile on their best day. I like to meet a man who can smile on his WORST.
The world always looks brighter from behind a smile.
Everywhere you go, take a smile with you.
Smile more. Smiling can make you and others happy.
Learn to smile at every situation. See it as an opportunity to prove your strength and ability.";
$quotes = explode( "\n", $quotes );
return wptexturize( $quotes[ mt_rand( 0, count( $quotes ) - 1 ) ] );
}
function it_gets_better() {
$chosen = it_gets_better_get_quotes();
$lang = '';
if ( 'en_' !== substr( get_user_locale(), 0, 3 ) ) {
$lang = ' lang="en"';
}
printf(
'<p id="quotes"><span class="screen-reader-text">%s </span><span dir="ltr"%s>%s</span></p>',
__( 'Quotes to Inspire:' ),
$lang,
$chosen
);
}
add_action( 'admin_notices', 'it_gets_better' );
function quotes_css() {
echo "
<style type='text/css'>
#quotes {
float: right;
padding: 5px 10px;
margin: 0;
font-size: 12px;
line-height: 1.6666;
}
.rtl #quotes {
float: left;
}
.block-editor-page #quotes {
display: none;
}
@media screen and (max-width: 782px) {
#quotes,
.rtl #quotes {
float: none;
padding-left: 0;
padding-right: 0;
}
}
</style>
";
}
add_action( 'admin_head', 'quotes_css' );