Description
With this commit 1936a04 there was some code introduced which will not render in frontend Navigation Items anymore which are set to e.G. "private" post_status.
Caused by: #27207
Step-by-step reproduction instructions
- Create 2 new pages "page A" and page B".
- Add on "page A" a new
core/navigation-Block with "Page Link" which contains "page B".
--> Everything is rendered correctly in backend and frontend.
- Change "page B" to post_status "private"
--> "page A" will now show in Backend "page B" in Navigation, but in Frontend its not there anymore.
Expected behaviour
Pages which having post_status publish or private should be visible in the Navigation in frontend and backend.
Code snippet (optional)
The code should be changed to something like:
if ( is_numeric( $attributes['id'] ) ) {
$post = get_post( $attributes['id'] );
if (!in_array($post->post_status, ['publish', 'private'], true)) {
return '';
}
}
WordPress information
- WordPress version: latest
- Gutenberg version: 10.9.1 - looks like this was introduced with version 9.8.0
- Are all plugins except Gutenberg deactivated? Yes
- Are you using a default theme (e.g. Twenty Twenty-One)? Yes
Device information
not relevant.
Description
With this commit 1936a04 there was some code introduced which will not render in frontend Navigation Items anymore which are set to e.G. "private" post_status.
Caused by: #27207
Step-by-step reproduction instructions
core/navigation-Block with "Page Link" which contains "page B".--> Everything is rendered correctly in backend and frontend.
--> "page A" will now show in Backend "page B" in Navigation, but in Frontend its not there anymore.
Expected behaviour
Pages which having post_status
publishorprivateshould be visible in the Navigation in frontend and backend.Code snippet (optional)
The code should be changed to something like:
WordPress information
Device information
not relevant.