Files
wordpress/wp-includes
Sergey Biryukov 1448dc5aa8 Taxonomy: Check the result of get_term() in WP_Term_Query::get_terms().
`get_term()` can return `WP_Error` or `null` on failure, so the result should be verified as a `WP_Term` instance before accessing the `count` property.

This commit prevents a PHP warning if `get_term()` returns `null` for a child term:
{{{
Warning: Attempt to read property "count" on null
}}}

Follow-up to [27458], [37572].

Props josephscott, coleatkinson1, kebbet, jakariaistauk, sabernhardt, westonruter, SergeyBiryukov.
Fixes #63877.
Built from https://develop.svn.wordpress.org/trunk@60661


git-svn-id: http://core.svn.wordpress.org/trunk@59997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-08-26 17:26:29 +00:00
..