Skip to content

Instantly share code, notes, and snippets.

@tott
Created March 19, 2020 19:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tott/ee8e43ded24e8547c32dd80db5484445 to your computer and use it in GitHub Desktop.
Hide repeater styrle fields following the pattern ..._0_... from indexing in ElasticPress
add_filter( 'ep_prepare_meta_data', function( $meta ) { 
foreach( $meta as $key => $value ) {
if ( preg_match( '/.+_([0-9]+)_.+/', $key ) ) {
unset( $meta[$key] );
}
}
return $meta;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment