Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rayrutjes/73cebc902971bbea71799769dbf36e03 to your computer and use it in GitHub Desktop.
Save rayrutjes/73cebc902971bbea71799769dbf36e03 to your computer and use it in GitHub Desktop.
Algolia WordPress customize autocomplete header labels for use with translation plugin
<?php
add_filter( 'algolia_autocomplete_config', function ( $config ) {
// echo '<pre>';
// var_dump( $config );
// echo '</pre>';
foreach ( $config as &$index ) {
// Adjust and adapt according to your needs.
if ( $index['index_id'] === 'posts_post' ) {
$index['label'] = 'Custom translated label';
}
}
return $config;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment