[wp-trac] [WordPress Trac] #51416: PHP Warning during sitemap generation
WordPress Trac
noreply at wordpress.org
Wed Sep 30 06:34:52 UTC 2020
#51416: PHP Warning during sitemap generation
--------------------------+-----------------------------
Reporter: dd32 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Sitemaps | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
The below error can be encountered during a sitemap render, this happens
as the Taxonomy Sitemap provider doesn't expect that `get_term_link()`
might return a WP_Error.
`E_WARNING: wp-includes/formatting.php:4309 - ltrim() expects parameter 1
to be string, object given`
In this case, `WP_Error` was returning `ambiguous_term_id - Term ID is
shared between multiple taxonomies` which is actually a second bug here,
that the `$taxonomy` parameter isn't being passed to properly disambiguate
the call.
Attached PR fixes this up.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51416>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list