diff --git a/includes/classes/Feature/Search/Search.php b/includes/classes/Feature/Search/Search.php index 42a714830a..7d15aaf353 100644 --- a/includes/classes/Feature/Search/Search.php +++ b/includes/classes/Feature/Search/Search.php @@ -237,7 +237,16 @@ public function add_search_highlight_tags( $formatted_args, $args ) { 'pre_tags' => [ $opening_tag ], 'post_tags' => [ $closing_tag ], 'type' => 'plain', - 'number_of_fragments' => 0, + /** + * Filter the maximum number of fragments highlighted for a searched field. + * + * @since 4.7.2 + * @hook ep_highlight_number_of_fragments + * @param {int} $max_fragments Maximum number of fragments for field. + * @param {string} $field Search field being setup. + * @return {int} New maximum number of fragments to highlight for the searched field. + */ + 'number_of_fragments' => apply_filters( 'ep_highlight_number_of_fragments', 0, $field ), ]; }