Created
November 17, 2023 11:49
-
-
Save nextab/ebe1821050b5a54aeca4b70c6baec940 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // You can add this filter to functions.php: | |
| add_filter('jet-search/ajax-search/custom-post-data', function( $custom_data, $data, $post ) { | |
| $custom_data['post_id'] = $post->ID ?? 0; | |
| return $custom_data; | |
| }, 0, 3 ); | |
| // And then use {{{data.post_id}}} in the template. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment