Created
June 30, 2012 16:54
-
-
Save miya0001/3024606 to your computer and use it in GitHub Desktop.
WordPressのAdminバーにオレオレメニューを追加
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 | |
class oreore { | |
function __construct() | |
{ | |
add_action("admin_bar_menu", array(&$this, "admin_bar_menu"), 9999); | |
} | |
public function admin_bar_menu($bar) | |
{ | |
$bar->add_menu(array( | |
"id" => "nginxchampuru", | |
"title" => "Nginx Cache", | |
"href" => false, | |
)); | |
if (!is_admin()) { | |
$bar->add_menu(array( | |
"parent" => "nginxchampuru", | |
"id" => "flushcache", | |
"title" => __("Flush This Page Cache", "oreore"), | |
"href" => 'http://example.com/', | |
"meta" => false, | |
)); | |
} | |
} | |
} | |
$wp_admin_bar->add_menu( array( | |
'id' => 'wp-logo', | |
'title' => '<span class="ab-icon"></span>', | |
'href' => self_admin_url( 'about.php' ), | |
'meta' => array( | |
'title' => __('About WordPress'), | |
), | |
) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment