Changeset 2041637
- Timestamp:
- 02/28/2019 04:19:49 PM (6 years ago)
- Location:
- show-visitor-ip/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
show-visitor-ip/trunk/readme.txt
r1721366 r2041637 3 3 Tags: ip address, country code, region, lat, long, city, country name, user, visitor, display, shortcode, vs, rockon 4 4 Requires at least: 3.0 5 Tested up to: 4.86 Stable tag: 1.0.0 015 Tested up to: 5.1 6 Stable tag: 1.0.01 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
show-visitor-ip/trunk/show-visitor-ip.php
r1721360 r2041637 20 20 } 21 21 add_shortcode('show_ip', 'show_visitor_ip'); 22 23 22 24 23 function show_visitor_locationByIp($svip){ 25 26 24 $client = @$_SERVER['HTTP_CLIENT_IP']; 27 25 $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; 28 26 $remote = @$_SERVER['REMOTE_ADDR']; 29 30 31 if(filter_var($client, FILTER_VALIDATE_IP)){ 32 33 $ip = $client; 34 27 if(filter_var($client, FILTER_VALIDATE_IP)){ 28 $ip = $client; 35 29 }elseif(filter_var($forward, FILTER_VALIDATE_IP)){ 36 37 $ip = $forward; 38 30 $ip = $forward; 39 31 } else { 40 32 $ip = $remote; … … 66 58 return $svip_data; 67 59 } 68 69 60 add_shortcode('svip_location', 'show_visitor_locationByIp'); 70 61 ?>
Note: See TracChangeset
for help on using the changeset viewer.