#56287 closed defect (bug) (fixed)
Handle PHP Notice when get_post_type_object() returns null in is_post_type_archive()
| Reported by: | sean212 | Owned by: | audrasjb |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.1 |
| Component: | Query | Version: | |
| Severity: | normal | Keywords: | php8 has-patch has-unit-tests |
| Cc: | Focuses: |
Description
When get_post_type_object() is called inside is_post_type_archive() it can return null and will potentially throw a PHP notice.
Relates to #29660 but isn't specific to get_queried_object() so I figured it might be worthwhile to track separately.
Change History (8)
#1
@
4 years ago
- Summary Handle PHP Notice when get_post_type_object() returns null → Handle PHP Notice when get_post_type_object() returns null in is_post_type_archive()
This ticket was mentioned in PR #3027 on WordPress/wordpress-develop by srtfisher.
4 years ago
#2
- Keywords has-patch has-unit-tests added
srtfisher commented on PR #3027:
4 years ago
#5
@costdev Thanks for the review! Changes made.
4 years ago
#8
Committed in https://core.trac.wordpress.org/changeset/54464
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/56287