Changes between Version 2 and Version 3 of Ticket #54149, comment 9
- Timestamp:
- 11/05/2021 01:44:22 AM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #54149, comment 9
v2 v3 28 28 29 29 That just re-enforces this to me, having to do `if ( $comment instanceOf WP_Comment || ( is_array( $comment ) && ! empty( $comment ) ) ) {}` is ridiculous, when if you trust those who use the filters, `if ( $comment ) {}` is far more readable and "safe" 30 31 (edit: To be clear though, I agree that the above is an over-the-top.. if you request a object from `get_comment()` it should return an object, but there's no filtering in the function to ensure the object it returns is a WP_Comment or even an object after the filter has been run)