Last active
March 26, 2020 21:43
-
-
Save bchiang7/2a949f636efbc9ed1c8ccdc9bd760c75 to your computer and use it in GitHub Desktop.
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 | |
define('THEME_PATH', get_stylesheet_directory() . '/'); | |
function algolia_get_settings($index_name) { | |
$settings_file_path = THEME_PATH . 'algolia-json/' . $index_name . '-settings.json'; | |
if (!file_exists($settings_file_path)) { | |
return false; | |
} | |
return json_decode( | |
file_get_contents($settings_file_path), | |
true | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment