From c07a9f206c8d76386f40bb499b3fa18fa2324e78 Mon Sep 17 00:00:00 2001 From: Sbisson Date: Wed, 7 Feb 2024 14:26:39 -0500 Subject: [PATCH] Show delete links option only if custom post type supports custom-fields --- src/postmeta/wp-postmeta-detectlinks.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/postmeta/wp-postmeta-detectlinks.js b/src/postmeta/wp-postmeta-detectlinks.js index 2e4a93f..e449ae5 100644 --- a/src/postmeta/wp-postmeta-detectlinks.js +++ b/src/postmeta/wp-postmeta-detectlinks.js @@ -5,6 +5,11 @@ import { PluginDocumentSettingPanel } from '@wordpress/edit-post'; import { ToggleControl, PanelRow } from '@wordpress/components'; const WikipediaPreviewPostMetaDetectLinks = ( { postMeta, setPostMeta } ) => { + if ( postMeta === undefined ) { + // this is probably a custom post type + // without 'custom-fields' support + return; + } return (