We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb09cf8 commit 9576fa0Copy full SHA for 9576fa0
1 file changed
src/wp-includes/nav-menu.php
@@ -886,7 +886,11 @@ function wp_setup_nav_menu_item( $menu_item ) {
886
$menu_item->_invalid = true;
887
}
888
889
- if ( 'publish' !== get_post_status( $menu_item->object_id ) ) {
+ $post_status = get_post_status( $menu_item->object_id );
890
+
891
+ if ( 'private' === $post_status && ! current_user_can( 'read_private_posts' ) ) {
892
+ $menu_item->_invalid = true;
893
+ } elseif ( 'private' !== $post_status && ! is_post_status_viewable( $post_status ) ) {
894
895
896
0 commit comments