Created
April 22, 2015 23:43
-
-
Save JustinSainton/613164292fd88f0f3c0d to your computer and use it in GitHub Desktop.
Print current plugin branch to admin bar
This file contains hidden or 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 | |
| public function admin_bar_menu() { | |
| global $wp_admin_bar; | |
| $plugin_path = ABSPATH . 'wp-content/plugins/WP-e-Commerce'; | |
| exec( 'cd ' . $plugin_path . ' && git rev-parse --abbrev-ref HEAD', $output, $return ); | |
| $wp_admin_bar->add_menu( array( | |
| 'id' => 'wpec-branch', | |
| 'title' => $output[0], | |
| 'href' => false ) ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment