forked from gatespace/caxias-hosoya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcaxias-hosoya.php
68 lines (59 loc) · 2.26 KB
/
caxias-hosoya.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
60
61
62
63
64
65
66
67
68
<?php
/**
* @package Caxias Hosoya
* @version 1.0
*/
/*
Plugin Name: Caxias Hosoya
Plugin URI: http://wordbench.org/groups/kobe/
Description: これはただのプラグインではありません。伝説上のシンガー カシアス・ホソヤによって歌われた最も有名な WordPress のキーワードに要約される、同一世代のすべての人々の希望と情熱を象徴するものです。これは世界で最初で最後になるかわからない WordBench Kobe 公式プラグインです。このプラグインが有効にされると、プラグイン管理画面以外の管理パネルの右上に「君の瞳にダッシュボード」からの歌詞がランダムに表示されます。
Author: Caxias Hosoya
Version: 1.0
Author URI: https://twitter.com/tkc49
*/
function caxias_hosoya_get_lyric() {
/** These are the lyrics to Caxias Hosoya */
$lyrics = "眠れぬ夜は思い出すよ
君のquery_posts 白くなった画面
俺がバグを見つけて 君は笑ってくれたね
その時から俺のメインクエリーは 君だけのものさ
三日前から既読なのに
どうしてなんだベイべ〜♫
それLINEですやんほそやん
君の笑顔にAccess
404 Not foundで
ピュアなハートが クラウドクラッシュ
君の瞳にダッシュボード
溢れる想いがトラックバック
そして届かない君からのコメント通知
Wow〜 You are my Type〜";
// Here we split it into lines
$lyrics = explode( "\n", $lyrics );
// And then randomly choose a line
return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] );
}
// This just echoes the chosen line, we'll position it later
function caxias_hosoya() {
$chosen = caxias_hosoya_get_lyric();
echo "<p id='caxias'>$chosen</p>";
}
// Now we set that function up to execute when the admin_notices action is called
add_action( 'admin_notices', 'caxias_hosoya' );
// We need some CSS to position the paragraph
function caxias_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'>
#caxias {
float: $x;
padding-$x: 15px;
padding-top: 5px;
margin: 0;
font-size: 11px;
}
</style>
";
}
add_action( 'admin_head', 'caxias_css' );
?>