diff --git a/includes/classes/Feature/Search/Search.php b/includes/classes/Feature/Search/Search.php index 30f0422e2..9bdf44cd4 100644 --- a/includes/classes/Feature/Search/Search.php +++ b/includes/classes/Feature/Search/Search.php @@ -719,6 +719,10 @@ public function enqueue_block_editor_assets() { return; } + if ( ! $post->post_type || ! post_type_supports( $post->post_type, 'custom-fields' ) ) { + return; + } + wp_enqueue_script( 'ep-search-editor', EP_URL . 'dist/js/search-editor-script.js', @@ -817,7 +821,6 @@ public function save_exclude_from_search_meta( $post_id ) { } else { delete_post_meta( $post_id, 'ep_exclude_from_search' ); } - } /**