[wp-trac] [WordPress Trac] #60631: block_core_navigation_render_inner_blocks block taxonomy type is 'tag', should be 'post_tag'
WordPress Trac
noreply at wordpress.org
Sun Feb 25 09:18:05 UTC 2024
#60631: block_core_navigation_render_inner_blocks block taxonomy type is 'tag',
should be 'post_tag'
--------------------------+-----------------------------
Reporter: anaid | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version:
Severity: normal | Keywords:
Focuses: multisite |
--------------------------+-----------------------------
In the `block_core_navigation_render_inner_blocks` filter, when iterating
over the menu items, the `type` attribute for a Post Tag has value
`'tag'`. However, to retrieve information about this taxonomy, the
`get_taxonomy` method requires value `'post_tag'`. Seems like a rename was
performed somewhere while implementing the block editor.
{{{
function block_core_navigation_render_inner_blocks($items)
{
foreach ($items as $key => $item)
{
$type = $item["attr"]["type"];
$taxonomy = get_taxonomy($type === "tag" ?
"post_tag" : $type); // Required workaround because of discrepancy
// <snip>
}
return $items;
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60631>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list