Opened 6 years ago
Last modified 6 months ago
#49171 new defect (bug)
Trying to get property 'post_type' of non-object in wp-includes/link-template.php on line 682
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Feeds | Keywords: | needs-patch |
| Focuses: | template | Cc: |
Description
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:
- {main}() /Users/me/root/index.php:0
- require() /Users/me/root/index.php:17
- require_once() /Users/me/root/wp-blog-header.php:19
- do_action() /Users/me/root/wp-includes/template-loader.php:13
- WP_Hook->do_action() /Users/me/root/wp-includes/plugin.php:478
- WP_Hook->apply_filters() /Users/me/root/wp-includes/class-wp-hook.php:312
- redirect_canonical() /Users/me/root/wp-includes/class-wp-hook.php:288
- is_front_page() /Users/me/root/wp-includes/canonical.php:498
- WP_Query->is_front_page() /Users/me/root/wp-includes/query.php:456
- 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/
Change History (2)
#2
@
6 months ago
Reproduction Report
Description
This report validates whether the issue can be reproduced.
Environment
- WordPress: 6.9-alpha-60273
- PHP: 8.2.28
- Server: Apache/2.4.62 (Debian)
- Database: mysqli (Server: 11.4.7-MariaDB-ubu2404 / Client: mysqlnd 8.2.28)
- Browser: Chrome 137.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.2
- MU Plugins: None activated
- Plugins:
- Gutenberg 21.0.0
- Test Reports 1.2.0
Actual Results
- ❌ Error condition does not occur (not-reproduced).
Additional Notes
Visited the http://localhost:8888/news2020/feed/atom/ URL but could not see any error reported.

You can find more information on this particular bit on this ticket: https://core.trac.wordpress.org/ticket/29660