Navigation link server renderer tries to get_post
on links with types other than post/page causing links to not render
#28712
Labels
[Block] Navigation
Affects the Navigation Block
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Milestone
Description
The
get_post
here doesn't work with categories (and possibly other link types different from post/page?), and (might) end up returning an empty string, resulting in the inner link block not rendering in the frontend.It seems that this went unnoticed because, in a testing environment (i.e when testing manually using a fresh WP org install), the IDs of post/pages and categories are small enough that they overlap, and that ends causing the link to be rendered, causing the false impression it's working as expected.
Step-by-step reproduction instructions
Expected behavior
I expect any navigation links with a type other than page or post to not be influenced by settings from posts / pages and to show as expected.
Actual behavior
Navigation links with type other than page / post are not rendered if there's not a post/page with the same ID and or if there is and it's private.
Screenshots or screen recording (optional)
categorypostidoverlap.mp4
WordPress information
9.8.3
andmaster
(537412fd43
)Device information
The text was updated successfully, but these errors were encountered: