Last active
December 14, 2019 02:58
-
-
Save johnalarcon/fca74a4d7d1140bf64d22de72f146d5b to your computer and use it in GitHub Desktop.
Show current PHP version in ClassicPress 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
| /** | |
| * Add PHP version to ClassicPress admin bar. | |
| * | |
| * For environments in which the PHP version is subject to change, this will add | |
| * the currently-running PHP version number to the admin bar to save some clicks | |
| * and keep it immediately discoverable. | |
| * | |
| * @author John Alarcon | |
| */ | |
| function codepotent_adminbar_php_version() { | |
| global $wp_admin_bar; | |
| $wp_admin_bar->add_menu([ | |
| 'parent' => false, | |
| 'id' => 'codepotent_adminbar_phpversion', | |
| 'title' => 'PHP '.phpversion() | |
| ]); | |
| } | |
| add_action('wp_before_admin_bar_render', 'codepotent_adminbar_php_version', PHP_INT_MAX); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment