From cc4308fe76eac01502998b523246e86e643a381b Mon Sep 17 00:00:00 2001 From: Damien Wilson Date: Mon, 18 Mar 2024 18:26:19 +0000 Subject: [PATCH] Allow OpenSearch with ElasticPress (#475) * Include ElasticPress patch * Delete unused post-type --- public/app/themes/clarity/functions.php | 2 +- .../inc/elasticsearch-on-opensearch.php | 17 +++++++ .../clarity/inc/post-types/condolences.php | 47 ------------------- 3 files changed, 18 insertions(+), 48 deletions(-) create mode 100644 public/app/themes/clarity/inc/elasticsearch-on-opensearch.php delete mode 100644 public/app/themes/clarity/inc/post-types/condolences.php diff --git a/public/app/themes/clarity/functions.php b/public/app/themes/clarity/functions.php index e6e0af2d3..b7110076d 100644 --- a/public/app/themes/clarity/functions.php +++ b/public/app/themes/clarity/functions.php @@ -65,6 +65,7 @@ require_once 'inc/autoloader.php'; +require_once 'inc/elasticsearch-on-opensearch.php'; require_once 'inc/cookies.php'; require_once 'inc/comments.php'; require_once 'inc/constants.php'; @@ -91,7 +92,6 @@ require_once 'inc/post-types/post.php'; require_once 'inc/post-types/event.php'; require_once 'inc/post-types/news.php'; -// require_once 'inc/post-types/condolences.php'; require_once 'inc/post-types/regional-news.php'; require_once 'inc/post-types/regional-page.php'; require_once 'inc/post-types/team-area.php'; diff --git a/public/app/themes/clarity/inc/elasticsearch-on-opensearch.php b/public/app/themes/clarity/inc/elasticsearch-on-opensearch.php new file mode 100644 index 000000000..d6e69f9bf --- /dev/null +++ b/public/app/themes/clarity/inc/elasticsearch-on-opensearch.php @@ -0,0 +1,17 @@ + array( - 'name' => __('Condolences'), - 'singular_name' => __('Condolence page'), - 'add_new_item' => __('Add New Condolence page'), - 'edit_item' => __('Edit Condolence page'), - 'new_item' => __('New Condolence page'), - 'view_item' => __('View Condolence page'), - 'search_items' => __('Search Condolence pages'), - 'not_found' => __('No Condolence pages found'), - 'not_found_in_trash' => __('No Condolence pages found in Trash'), - ), - 'description' => __('Contains details of Condolence pages'), - 'public' => true, - 'menu_position' => 1, - 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ), - 'has_archive' => false, - 'menu_icon' => 'dashicons-heart', - 'rewrite' => array( - 'slug' => 'book-of-condolences', - 'with_front' => false, - ), - 'hierarchical' => false, - - ) - ); -} -add_action('init', 'define_condolences_post_type'); - - -/** - * - * Remove side meta boxes on Condolences entry admin page - these have been replaced in ACF with ACF fields - * - * */ -add_action('do_meta_boxes', 'remove_metaboxes_condolences'); - -function remove_metaboxes_condolences() -{ - remove_meta_box('tagsdiv-workplace', 'condolences', 'side'); -}