Plugin Name: SearchWP Term Highlight
Highlight search terms in results
Version: 2.0.3
Author: Jonathan Christopher
This plugin allows you to highlight search terms in search results. It is compatible with SearchWP 1.9.5 or greater.
Usage
To use this plugin, simply install and activate it. There are no additional settings to configure.
License
This plugin is released under the GNU General Public License.
Compatibility
This plugin requires SearchWP 1.9.5 or greater to function properly.
Excerpt Generation
This plugin also provides a utility function that generates an excerpt with at least one search term in it. It retrieves the content from the main editor or any custom fields (if specified).
To generate an excerpt, use the following function:
“`php
searchwp_term_highlight_get_the_excerpt_global($post_id, $custom_field, $query)
“`
- $post_id (optional): The ID of the post. If not specified, it will default to the current post.
- $custom_field (optional): The name of the custom field to generate the excerpt from.
- $query (optional): The search terms to highlight. If not specified, it will default to the current search query.
Valoraciones
No hay valoraciones aún.