The Live Search Feature - Otter Features Library
๐Note: This feature is part of Otter Pro, Agency, which you can get from here.
The Live Search feature enhances the core block Search by adding two additional attributes ( isLive and postTypes ) that can be set inside the inspector under the Live Search panel.
Using the Blocks |
Using WP Action |
๐งฉ Using the Blocks
- 1
-
While you're in the editor, add the Search or Live Search block.
- 2
Ensure the Live Search block has the Enable Live Search toggle on.
- 3
- 4
Go to the front end and add different post types in the Token Field.
- 5
Check if the results are filtered according to the search.
If you click on enter, a new page that contains only the search results will appear.
๐ Note: The container can be closed by clicking outside the search area or when the field is empty.
๐ Using WP Action
Actions allow you to add functionality at specific points during the execution of WordPress, such as when a theme or plugin is loaded. For example, if you want to use live search inside a dynamically generated modal, it cannot be done just by using the block, as described above.
If you want to load Live Search functionality in your custom theme or 3-rd party plugin, use the WordPress action otter_load_live_search_deps.
Example:
do_action( 'otter_load_live_search_deps' )
Please note that loading dependencies does not make any search plugin start acting like the Live Search. It is important to understand that the Live Search functionality is exclusive to our block and should not be misinterpreted. This feature is specifically designed to operate under unique conditions, ensuring optimal performance.
๐ Note: This feature is available for Otter Pro users.