Use whitelisted IPs outside this plugin
-
How do I use the list of whitelisted IPs outside this plugin?
I need to hide part of my menu from everyone else but the whitelisted IPs and I have this in my functions.php:function is_ip_approved() { $Approved_IP_list = array( "62.xx.xx.xx", "91.xx.xx.xx", "176.xx.xx.xx" ); if(in_array($_SERVER['REMOTE_ADDR'], $Approved_IP_list)) { $is_Ip_Approved = true; } else { $is_Ip_Approved = false; } return $is_Ip_Approved; }
And I’m using “Menu Items Visibility Control” plugin to show the menu items if $is_Ip_Approved returns true.
I would like to use the IP whitelist of RSA in this function so I would only need to make changes to RSA IP list and wouldn’t need to make updates to 2 different places.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Use whitelisted IPs outside this plugin’ is closed to new replies.