WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 964 | /** |
| 965 | * Filters whether to perform a strict guess for a 404 redirect. |
| 966 | * |
| 967 | * Returning a truthy value from the filter will redirect only exact post_name matches. |
| 968 | * |
| 969 | * @since 5.5.0 |
| 970 | * |
| 971 | * @param bool $strict_guess Whether to perform a strict guess. Default false (loose guess). |
| 972 | */ |
| 973 | $strict_guess = apply_filters( 'strict_redirect_guess_404_permalink', false ); |
| 974 | |
| 975 | if ( $strict_guess ) { |
| 976 | $where = $wpdb->prepare( 'post_name = %s', get_query_var( 'name' ) ); |
| 977 | } else { |
| 978 | $where = $wpdb->prepare( 'post_name LIKE %s', $wpdb->esc_like( get_query_var( 'name' ) ) . '%' ); |
| 979 | } |
| 980 | |
| 981 | // If any of post_type, year, monthnum, or day are set, use them to refine the query. |
| 982 | if ( get_query_var( 'post_type' ) ) { |