Advertisement
sc0ttkclark

Pods get_current_url in 1.9.6

Jun 13th, 2011
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Get current URL (general function WP is lacking)
  4.  *
  5.  * @return bool
  6.  * @since 1.9.6
  7.  */
  8. if (!function_exists('get_current_url')) {
  9.     function get_current_url() {
  10.         $url = 'http://';
  11.         if (isset($_SERVER['HTTPS']) && 'off' != $_SERVER['HTTPS'] && 0 != $_SERVER['HTTPS'])
  12.             $url = 'https://';
  13.         $url .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
  14.         return $url;
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement