Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: allowed_redirect_hosts

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
986      if ( isset($lp['scheme']) && !('http' == $lp['scheme'] || 'https' == $lp['scheme']) )
987           return $default;
988
989      // Reject if scheme is set but host is not. This catches urls like https:host.com for which parse_url does not set the host field.
990      if ( isset($lp['scheme'])  && !isset($lp['host']) )
991           return $default;
992
993      $wpp = parse_url(home_url());
994
995      $allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '');
996
997      if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) )
998           $location = $default;
999
1000      return $location;
1001 }
1002 endif;
1003
1004 if ( ! function_exists('wp_notify_postauthor') ) :