#56287 closed defect (bug) (fixed)
Handle PHP Notice when get_post_type_object() returns null in is_post_type_archive()
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Query | Keywords: | php8 has-patch has-unit-tests |
Focuses: | Cc: |
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
@
3 years ago
- Summary changed from Handle PHP Notice when get_post_type_object() returns null to 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.
3 years ago
#2
- Keywords has-patch has-unit-tests added
srtfisher commented on PR #3027:
3 years ago
#5
@costdev Thanks for the review! Changes made.
#7
@
2 years ago
- Owner set to audrasjb
- Resolution set to fixed
- Status changed from assigned to closed
In 54464:
2 years ago
#8
Committed in https://core.trac.wordpress.org/changeset/54464
Note: See
TracTickets for help on using
tickets.
Trac ticket: https://core.trac.wordpress.org/ticket/56287