Created
October 7, 2012 19:26
-
-
Save bainternet/3849312 to your computer and use it in GitHub Desktop.
Add Theme and Plugin Editor to Admin Bar (to save time!)
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 | |
// Add Theme and Plugin Editor to Admin Bar (to save time!) | |
function admin_bar_code_editor_option() { | |
global $wp_admin_bar; | |
if ( !is_super_admin() || !is_admin_bar_showing() ) | |
return; | |
$wp_admin_bar->add_menu( | |
array( | |
'id' => 'edit-code', | |
'title' => __('Code Editor'), | |
'href' => '#' | |
) | |
); | |
$wp_admin_bar->add_menu( | |
array( | |
'parent' => 'edit-code', | |
'id' => 'edit-theme', | |
'title' => __('Edit Theme'), | |
'href' => admin_url( 'theme-editor.php') | |
) | |
); | |
$wp_admin_bar->add_menu( | |
array( | |
'parent' => 'edit-code', | |
'id' => 'edit-plugin', | |
'title' => __('Edit Plugin'), | |
'href' => admin_url( 'plugin-editor.php') | |
) | |
); | |
} | |
add_action( 'admin_bar_menu', 'admin_bar_code_editor_option', 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment