wp_safe_redirect_fallback
Filters the redirect fallback URL for when the provided redirect is not safe (local).
Description
Parameters (2)
- 0. $admin_url (string) =>
admin_url()
- The fallback URL to use by default.
- 1. $status (int)
- The redirect status.
Usage
- To run the hook, copy the example below.
- $admin_url = apply_filters( 'wp_safe_redirect_fallback', $admin_url, $status );
- if ( !empty( $admin_url ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the wp_safe_redirect_fallback callback
- function filter_wp_safe_redirect_fallback( $admin_url, $status ) {
- // make filter magic happen here...
- return $admin_url;
- };
- // add the filter
- add_filter( 'wp_safe_redirect_fallback', 'filter_wp_safe_redirect_fallback', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'wp_safe_redirect_fallback', 'filter_wp_safe_redirect_fallback', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/pluggable.php
- $location = wp_validate_redirect( $location, apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status ) );