How to Shortcode to display users IP address in posts & pages

Adding this snippet to the functions.php of your wordpress theme will let you use a shortcode to display the users IP address in your posts or pages.
( click code to copy )wordpress snippet : PHP
<>
function display_user_ip() { $ip = $_SERVER['REMOTE_ADDR']; return $ip; } add_shortcode('user_ip', 'display_user_ip');
wordpress snippet : SHORTCODE
<>
[ip]
( WordPress codex functions, hooks, in this snippet. )
add_shortcode,