File: /home/thuexe247c/public_html/wp-content/plugins/current-year-shortcode/shortcodes/ip.php
<?php
/**
* Includes shortocdes of user IP
* Plugin: Current Year and Symbols Shortcode
* Since: 2.3.2
* Author: KGM Servizi
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
*
* Retrieve user IP
*
*/
add_shortcode('show_user_ip', 'cys_retrieve_ip');
function cys_retrieve_ip() {
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
return apply_filters('wpb_get_ip', $ip);
}