Created
January 3, 2018 14:17
-
-
Save rayrutjes/73cebc902971bbea71799769dbf36e03 to your computer and use it in GitHub Desktop.
Algolia WordPress customize autocomplete header labels for use with translation plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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