[wp-trac] [WordPress Trac] #49171: Trying to get property 'post_type' of non-object in wp-includes/link-template.php on line 682

WordPress Trac noreply at wordpress.org
Sat Jan 11 17:19:46 UTC 2020


#49171: Trying to get property 'post_type' of non-object in wp-includes/link-
template.php on line 682
--------------------------+-----------------------------
 Reporter:  ronald2020    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Feeds         |    Version:
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:  template      |
--------------------------+-----------------------------
 Hi there,

 I believe this maybe a bug or at least an unchecked condition (post/page
 does not exist) throwing the above error. I have legit crawlers visiting
 that cause these errors.

 Running 5.3.2. All plugins disabled (except for Health Check &
 Troubleshooting). Theme: Twenty.

 How to re-produce : https://your.site.com/news2020/feed/atom/

 It is key that the slug for the post/page does NOT (NO longer) exists.

 Stack trace:
 1. {main}() /Users/me/root/index.php:0
 2. require() /Users/me/root/index.php:17
 3. require_once() /Users/me/root/wp-blog-header.php:19
 4. do_action() /Users/me/root/wp-includes/template-loader.php:13
 5. WP_Hook->do_action() /Users/me/root/wp-includes/plugin.php:478
 6. WP_Hook->apply_filters() /Users/me/root/wp-includes/class-wp-
 hook.php:312
 7. redirect_canonical() /Users/me/root/wp-includes/class-wp-hook.php:288
 8. is_front_page() /Users/me/root/wp-includes/canonical.php:498
 9. WP_Query->is_front_page() /Users/me/root/wp-includes/query.php:456
 10. WP_Query->is_page() /Users/me/root/wp-includes/class-wp-query.php:3879
 PHP Notice:  Trying to get property 'post_type' of non-object in
 /Users/me/root/wp-includes/link-template.php on line 682


 A variant (same sort of problem) throws an error in class-wp-query.php
 with the following:

 https://your.site.com/news2020/feed/

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49171>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list