wphooks.info - old_slug_redirect_post_id

old_slug_redirect_post_id

(trunk - 5.0-alpha-42541)

*** New in trunk ***

The hook occurs in the following file:

wp-includes/query.php:
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
			$id = _find_post_by_old_date( $post_type );
		}

		/**
		 * Filters the old slug redirect post ID.
		 *
		 * @since 4.9.2
		 *
		 * @param string $id The redirect post ID.
		 */
		$id = apply_filters( 'old_slug_redirect_post_id', $id );

		if ( ! $id ) {
			return;
		}

		$link = get_permalink( $id );

		if ( get_query_var( 'paged' ) > 1 ) {
			$link = user_trailingslashit( trailingslashit( $link ) . 'page/' . get_query_var( 'paged' ) );