Skip to content

Commit

Permalink
Page Details View: Show parent only if there is one (#51648)
Browse files Browse the repository at this point in the history
* Page Details View: Show parent only if there is one

* Update packages/edit-site/src/components/sidebar-navigation-screen-page/page-details.js

Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com>

---------

Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com>
  • Loading branch information
juanfra and Mamaduka committed Jun 20, 2023
1 parent 5c8ea31 commit 747e155
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ function getPageDetails( page ) {
} );
}

details.push( {
label: __( 'Parent' ),
// `null` indicates no parent.
value:
null === page?.parentTitle
? __( 'Top level' )
: decodeEntities( page?.parentTitle || __( '(no title)' ) ),
} );
if ( page?.parentTitle ) {
details.push( {
label: __( 'Parent' ),
value: decodeEntities( page.parentTitle || __( '(no title)' ) ),
} );
}

/*
* translators: If your word count is based on single characters (e.g. East Asian characters),
Expand Down

0 comments on commit 747e155

Please sign in to comment.