Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Commit

Permalink
add takwimu as es index name, update indexable post types to include …
Browse files Browse the repository at this point in the history
…wp-block & acf -fields
  • Loading branch information
KhadijaMahanga committed Dec 10, 2019
1 parent c2c7ccb commit 03bf67e
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions wp-content/themes/hurumap/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,21 @@ function register_acf_block_types()
add_action('acf/init', 'register_acf_block_types');
}

function include_attachement_to_search( $query ) {
if ( $query->is_search ) {
$query->set( 'post_type', array( 'attachment', 'post', 'page', 'profile_section_page', 'topic_page', 'carousel_topic', 'profile', 'snippet', 'any' ) );
$query->set( 'post_status', array( 'publish', 'inherit' ) );
}

return $query;
//rename elasticsearch/elastic press index name
function custom_index_name() {
return 'takwimu';
}

add_filter( 'pre_get_posts', 'include_attachement_to_search' );
add_filter( 'ep_index_name', 'custom_index_name');



//Update indexable posts
function update_indexable_posts( $post_types ) {

return array_merge( $post_types, array(
'wp_block' => 'wp_block',
'acf-field' => 'acf-field')
);
}
add_filter( 'ep_indexable_post_types' , 'update_indexable_posts');

0 comments on commit 03bf67e

Please sign in to comment.