10/19/2015 at 10:27 pm
#351016
Guest
I added this fix to class.seo.php. I added this after the offending line.
if ( ! is_object( $post ) || $wp_query->post->ID != $id || ! self::$filterPermalink ) return $title;
This makes sense anyway. You shouldn’t be checking $wp_query->post->ID if you don’t know whether $wp_query->post is null or not. No assumptions should ever be made in coding. In theory it looks like filterPostTitle() is some kind of callback that can only ever be called for posts, however it looks like it is being called in some other context. Either way it is defensive programming to add this fix. For example even if it is another plugin, it stops your plugin breaking due to the fault of another plugin.
