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
965      if ( isset($lp['scheme']) && !('http' == $lp['scheme'] || 'https' == $lp['scheme']) )
966           return $default;
967
968      // 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.
969      if ( isset($lp['scheme'])  && !isset($lp['host']) )
970           return $default;
971
972      $wpp = parse_url(home_url());
973
974      $allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '');
975
976      if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) )
977           $location = $default;
978
979      return $location;
980 }
981 endif;
982
983 if ( ! function_exists('wp_notify_postauthor') ) :