10/23/2015 at 6:27 pm
#351565
Guest
The final response on my StackOverflow question relating to this issue was:
Unfortunately, I’m still not sure what that check is actually there
for.$postshould be an object during the_title filter, no matter if a
post is returned or a 404 is shown (sois_object( $post )seems
redundant)…$wp_queryshould be NULL if you’re on a 404 page, since
there’s no actual query object. Otherwise, I have no idea when
$wp_query->post->IDwouldn’t be equal to the$idpassed to the filter.
Honestly, I’d remove that check in favor of usingif (
!get_queried_object() ) return $title;
