SnailsFromJupiter I do not think using get_queried_object_id()
would be correct since the returned object is not necessarily a post. Curious, add this to the file and visit a know page and a 404 page. I’d be SnailsFromJupiter
I do not think using get_queried_object_id()
would not be correct since the returned object is not necessarily a post.
Curious, add this to the file and visit a know page and a 404 page. I’d be interested to the the results:
var_dump( $wp_query->post );
var_dump( $post );
I find this whole thing odd because the global $post
object should not be set on a 404 anyway (I think) so the filter should bail right there and then. Stranger still the global $post
comes from $wp_query->post
https://github.com/WordPress/WordPress/blob/4.3.1/wp-includes/class-wp.php#L518
Anyway, like I said, I’d like to see the output of the dumps. Also… do this in Chrome with the dev tools open. Watch the Network tab. Does a 301 redirect happen when you hit a 404?interested to the the results: var_dump( $wp_query->post ); var_dump( $post ); I find this whole thing odd because the global $post
object should not be set on a 404 anyway (I think) so the filter should bail right there and then. Stranger still the global $post
comes from $wp_query->post
https://github.com/WordPress/WordPress/blob/4.3.1/wp-includes/class-wp.php#L518 Anyway, like I said, I’d like to see the output of the dumps. Also… do this in Chrome with the dev tools open. Watch the Network tab. Does a 301 redirect happen when you hit a 404?