allowed_redirect_hosts
Filters the whitelist of hosts to redirect to.
Description
Parameters (2)
- 0. $array (array) =>
array($wpp['host'])
- An array of allowed hosts.
- 1. $lp_host (bool) =>
isset($lp['host']) ? $lp['host'] : ''
- The parsed host; empty if not isset.
Usage
- To run the hook, copy the example below.
- $array = apply_filters( 'allowed_redirect_hosts', $array, $lp_host );
- if ( !empty( $array ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the allowed_redirect_hosts callback
- function filter_allowed_redirect_hosts( $array, $lp_host ) {
- // make filter magic happen here...
- return $array;
- };
- // add the filter
- add_filter( 'allowed_redirect_hosts', 'filter_allowed_redirect_hosts', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'allowed_redirect_hosts', 'filter_allowed_redirect_hosts', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/pluggable.php
- $allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '' );