Skip to content

Commit

Permalink
Add fallback icon for custom post types
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Nov 7, 2024
1 parent 3e0a338 commit 5c63265
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions packages/block-editor/src/components/link-control/search-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
file,
home,
verse,
customPostType,
} from '@wordpress/icons';
import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
import { safeDecodeURI, filterURLForDisplay, getPath } from '@wordpress/url';
Expand Down Expand Up @@ -41,18 +42,16 @@ function SearchItemIcon( { isURL, suggestion } ) {
icon = verse;
}
}
} else {
icon = customPostType;
}

if ( icon ) {
return (
<Icon
className="block-editor-link-control__search-item-icon"
icon={ icon }
/>
);
}

return null;
return (
<Icon
className="block-editor-link-control__search-item-icon"
icon={ icon }
/>
);
}

/**
Expand Down

0 comments on commit 5c63265

Please sign in to comment.