Filter hook 'old_slug_redirect_url'

in WP Core File wp-includes/query.php at line 1114

View Source

old_slug_redirect_url

Filter Hook
Description
Filters the old slug redirect URL.

Hook Information

File Location wp-includes/query.php View on GitHub
Hook Type Filter
Line Number 1114

Hook Parameters

Type Name Description
string $link The redirect URL.

Usage Examples

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

function my_custom_filter($link) {
    // Your custom filtering logic here
    return $link;
}

Source Code Context

wp-includes/query.php:1114 - How this hook is used in WordPress core
<?php
1109  		 *
1110  		 * @since 4.4.0
1111  		 *
1112  		 * @param string $link The redirect URL.
1113  		 */
1114  		$link = apply_filters( 'old_slug_redirect_url', $link );
1115  
1116  		if ( ! $link ) {
1117  			return;
1118  		}
1119  

PHP Documentation

<?php
/**
		 * Filters the old slug redirect URL.
		 *
		 * @since 4.4.0
		 *
		 * @param string $link The redirect URL.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/query.php
Related Hooks

Related hooks will be displayed here in future updates.