redirect_post_location
Filters the post redirect destination URL.
Usage
add_filter( 'redirect_post_location', 'wp_kama_redirect_post_location_filter', 10, 2 ); /** * Function for `redirect_post_location` filter-hook. * * @param string $location The destination URL. * @param int $post_id The post ID. * * @return string */ function wp_kama_redirect_post_location_filter( $location, $post_id ){ // filter... return $location; }
- $location(string)
- The destination URL.
- $post_id(int)
- The post ID.
Changelog
Since 2.9.0 | Introduced. |
Where the hook is called
redirect_post_location
wp-admin/includes/post.php 2218
wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) );