Filter hook 'old_slug_redirect_post_id'

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

View Source

old_slug_redirect_post_id

Filter Hook
Description
Filters the old slug redirect post ID.

Hook Information

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

Hook Parameters

Type Name Description
int $id The redirect post ID.

Usage Examples

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

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

Source Code Context

wp-includes/query.php:1093 - How this hook is used in WordPress core
<?php
1088  		 *
1089  		 * @since 4.9.3
1090  		 *
1091  		 * @param int $id The redirect post ID.
1092  		 */
1093  		$id = apply_filters( 'old_slug_redirect_post_id', $id );
1094  
1095  		if ( ! $id ) {
1096  			return;
1097  		}
1098  

PHP Documentation

<?php
/**
		 * Filters the old slug redirect post ID.
		 *
		 * @since 4.9.3
		 *
		 * @param int $id The redirect post ID.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/query.php
Related Hooks

Related hooks will be displayed here in future updates.