Skip to content

Commit

Permalink
Only display the Exclude From Search checkbox if the post type suppor…
Browse files Browse the repository at this point in the history
…ts custom fields
  • Loading branch information
felipeelia committed Dec 11, 2024
1 parent 40e4b0e commit 6b31b70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion includes/classes/Feature/Search/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -817,7 +821,6 @@ public function save_exclude_from_search_meta( $post_id ) {
} else {
delete_post_meta( $post_id, 'ep_exclude_from_search' );
}

}

/**
Expand Down

0 comments on commit 6b31b70

Please sign in to comment.