Skip to content

Commit

Permalink
Fix title field
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Aug 7, 2024
1 parent 769dc91 commit bb731d7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/edit-site/src/components/post-fields/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ function usePostFields( viewType ) {
const addLink =
[ LAYOUT_TABLE, LAYOUT_GRID ].includes( viewType ) &&
item.status !== 'trash';
const renderedTitle =
typeof item.title === 'string'
? item.title
: item.title?.rendered;
const title = addLink ? (
<Link
params={ {
Expand All @@ -194,12 +198,12 @@ function usePostFields( viewType ) {
canvas: 'edit',
} }
>
{ decodeEntities( item.title?.rendered ) ||
{ decodeEntities( renderedTitle ) ||
__( '(no title)' ) }
</Link>
) : (
<span>
{ decodeEntities( item.title?.rendered ) ||
{ decodeEntities( renderedTitle ) ||
__( '(no title)' ) }
</span>
);
Expand Down

0 comments on commit bb731d7

Please sign in to comment.