Filter hook 'redirect_term_location'

in WP Core File wp-admin/edit-tags.php at line 231

View Source

redirect_term_location

Filter Hook
Description
Filters the taxonomy redirect destination URL.

Hook Information

File Location wp-admin/edit-tags.php View on GitHub
Hook Type Filter
Line Number 231

Hook Parameters

Type Name Description
string $location The destination URL.
WP_Taxonomy $tax The taxonomy object.

Usage Examples

Basic Usage
<?php
// Hook into redirect_term_location
add_filter('redirect_term_location', 'my_custom_filter', 10, 2);

function my_custom_filter($location, $tax) {
    // Your custom filtering logic here
    return $location;
}

Source Code Context

wp-admin/edit-tags.php:231 - How this hook is used in WordPress core
<?php
 226  	 * @since 4.6.0
 227  	 *
 228  	 * @param string      $location The destination URL.
 229  	 * @param WP_Taxonomy $tax      The taxonomy object.
 230  	 */
 231  	wp_redirect( apply_filters( 'redirect_term_location', $location, $tax ) );
 232  	exit;
 233  }
 234  
 235  $wp_list_table->prepare_items();
 236  $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );

PHP Documentation

<?php
/**
	 * Filters the taxonomy redirect destination URL.
	 *
	 * @since 4.6.0
	 *
	 * @param string      $location The destination URL.
	 * @param WP_Taxonomy $tax      The taxonomy object.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/edit-tags.php
Related Hooks

Related hooks will be displayed here in future updates.