Using Standard WordPress Hooks
WP Fast Total Search (WPFTS) actively utilizes standard WordPress hooks to integrate its functionality into the system and interact with other plugins and themes. This allows the plugin to work correctly in various configurations and provides developers with extension points to modify WPFTS behavior.
Below is a list of standard WordPress hooks used by WPFTS, with a brief description of their purpose within the plugin:
Hook | Description |
---|---|
save_post | Called when a post is saved. WPFTS uses this hook to re-index the content of the saved or updated post. |
after_delete_post | Called after a post is deleted. WPFTS uses this hook to remove the deleted post’s data from the search index. |
wp_enqueue_scripts | Called to register scripts and styles on the frontend. WPFTS uses this hook to add Smart Excerpts styles and scripts for the Live Search widget. |
wpmu_new_blog | Called when a new blog is created in a WordPress Multisite network. WPFTS uses this hook to activate the plugin on the new blog. |
post_submitbox_misc_actions | Called to add elements to the “Publish” meta box on the post editing page. WPFTS uses this hook to display the post indexing status. |
widgets_init | Called when widgets are initialized. WPFTS uses this hook to register its search widget. |
wp_ajax_(nopriv_)wpfts_autocomplete | AJAX hooks for search autocomplete. wp_ajax_wpfts_autocomplete is called for authorized users, wp_ajax_nopriv_wpfts_autocomplete for unauthorized users. |
wp_ajax_(nopriv_)wpfts_force_index | AJAX hooks for forced indexing. wp_ajax_wpfts_force_index for authorized users, wp_ajax_nopriv_wpfts_force_index for unauthorized users. |
wp_ajax_wpftsi_* | Various AJAX hooks used for internal plugin functions, such as getting the indexing status, pausing indexing, hiding notifications, etc. |
admin_enqueue_scripts | Called to register scripts and styles in the admin panel. WPFTS uses this hook to connect its scripts and styles on the settings pages. |
admin_notices | Called to display notifications in the admin panel. WPFTS uses this hook to display various messages and warnings. |
safe_style_css | Filter to define the list of allowed CSS properties. WPFTS uses this hook to add the display property to the allowed list. |
the_title | Filter to modify the post title before output. WPFTS uses this hook to apply Smart Excerpts to titles in search results. |
attachment_link , page_link , post_type_link , post_link | Filters to modify links to attachments, pages, and posts. WPFTS uses these hooks to apply Smart Excerpts to links in search results. |
get_the_excerpt | Filter to modify the post excerpt before output. WPFTS uses this hook to display Smart Excerpts instead of standard excerpts in search results. |
pre_get_posts | Filter to modify the WP_Query query parameters before execution. WPFTS uses this hook to integrate its search engine with WordPress. |
posts_search , posts_search_orderby , posts_where , posts_join , posts_distinct , post_limits , posts_fields , posts_clauses , posts_pre_query , split_the_query , the_posts | Filters used to modify various parts of the SQL query used to retrieve posts. WPFTS uses these hooks to implement its search mechanism. |
A detailed description of each hook and its use in WPFTS is provided in the corresponding sections of the documentation.