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
1270
1271      /**
1272       * Filter the whitelist of hosts to redirect to.
1273       *
1274       * @since 2.3.0
1275       *
1276       * @param array       $hosts An array of allowed hosts.
1277       * @param bool|string $host  The parsed host; empty if not isset.
1278       */
1279      $allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '' );
1280
1281      if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) )
1282           $location = $default;
1283
1284      return $location;
1285 }
1286 endif;
1287
1288 if ( ! function_exists('wp_notify_postauthor') ) :