-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwp-ip.php
More file actions
31 lines (27 loc) · 789 Bytes
/
wp-ip.php
File metadata and controls
31 lines (27 loc) · 789 Bytes
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
<?php
/**
* Plugin Name: WP IP
* Plugin URI: https://github.com/asmbs/wp-ip
* Version: 1.1.0
* Description: See the IP address of your WordPress instance, right in your admin bar (if you're an administrator).
* Author: The A-TEAM
* Author URI: https://github.com/asmbs
* License: MIT
* License URI: http://opensource.org/licenses/MIT2
*/
/**
* @param WP_Admin_Bar $wp_admin_bar
*/
function admin_bar_ip($wp_admin_bar)
{
if (!current_user_can('manage_options')) {
return;
}
$wp_admin_bar->add_node([
'id' => 'wp-ip',
'title' => sprintf(__('Currently located at <b>%s</b>'), $_SERVER['SERVER_ADDR']),
'parent' => 'top-secondary'
]);
}
// Register the hook
add_action('admin_bar_menu', 'admin_bar_ip', 10);