Created
April 26, 2019 09:08
-
-
Save kaskad88/5905ef7c01df57f1ed714863f092171a to your computer and use it in GitHub Desktop.
This file contains 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
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