Skip to content

Instantly share code, notes, and snippets.

@rayrutjes
Created February 26, 2018 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rayrutjes/8c2f9957101e3ea54ac946b8b273e377 to your computer and use it in GitHub Desktop.
Save rayrutjes/8c2f9957101e3ea54ac946b8b273e377 to your computer and use it in GitHub Desktop.
Replace domain in Algolia Search plugin for WordPress
<?php
/**
* @version 0.1.0
* Plugin Name: Replace domain in Algolia Search plugin for WordPress
*/
function custom_post_shared_attributes( array $shared_attributes ) {
$shared_attributes['permalink'] = str_replace( 'admin.rushlimbaugh.com', 'www.rushlimbaugh.com', $shared_attributes['permalink'] );
return $shared_attributes;
}
add_filter( 'algolia_post_shared_attributes', 'custom_post_shared_attributes' );
add_filter( 'algolia_searchable_post_shared_attributes', 'custom_post_shared_attributes' );
add_filter( 'algolia_term_record', 'custom_post_shared_attributes' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment