Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created January 23, 2015 15:33
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 jchristopher/a0eccd9270a9527f5bd3 to your computer and use it in GitHub Desktop.
Save jchristopher/a0eccd9270a9527f5bd3 to your computer and use it in GitHub Desktop.
Manipulate Custom Field data before a post is indexed by SearchWP
<?php
function my_searchwp_get_custom_fields( $custom_fields, $post_id ) {
// manipulate the array of Custom Fields in any way you'd like
return $custom_fields;
}
add_filter( 'searchwp_get_custom_fields', 'my_searchwp_get_custom_fields', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment