Skip to content

Instantly share code, notes, and snippets.

@kaskad88
Created April 26, 2019 09:08
Show Gist options
  • Save kaskad88/5905ef7c01df57f1ed714863f092171a to your computer and use it in GitHub Desktop.
Save kaskad88/5905ef7c01df57f1ed714863f092171a to your computer and use it in GitHub Desktop.
add_filter( 'jet-search/ajax-search/custom-post-data', '__your_prefix_add_custom_result_data', 10, 3 );
function __your_prefix_add_custom_result_data( $post_data, $data, $post ) {
$custom_meta_value = get_post_meta( $post->ID, 'custom_post_meta', true );
$post_data['custom'] = $custom_meta_value ? sprintf( '<div class="jet-ajax-search__custom-meta">%s</div>', $custom_meta_value ) : '';
return $post_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment