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:

HookDescription
save_postCalled when a post is saved. WPFTS uses this hook to re-index the content of the saved or updated post.
after_delete_postCalled after a post is deleted. WPFTS uses this hook to remove the deleted post’s data from the search index.
wp_enqueue_scriptsCalled 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_blogCalled 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_actionsCalled to add elements to the “Publish” meta box on the post editing page. WPFTS uses this hook to display the post indexing status.
widgets_initCalled when widgets are initialized. WPFTS uses this hook to register its search widget.
wp_ajax_(nopriv_)wpfts_autocompleteAJAX 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_indexAJAX 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_scriptsCalled to register scripts and styles in the admin panel. WPFTS uses this hook to connect its scripts and styles on the settings pages.
admin_noticesCalled to display notifications in the admin panel. WPFTS uses this hook to display various messages and warnings.
safe_style_cssFilter to define the list of allowed CSS properties. WPFTS uses this hook to add the display property to the allowed list.
the_titleFilter 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_linkFilters to modify links to attachments, pages, and posts. WPFTS uses these hooks to apply Smart Excerpts to links in search results.
get_the_excerptFilter to modify the post excerpt before output. WPFTS uses this hook to display Smart Excerpts instead of standard excerpts in search results.
pre_get_postsFilter 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_postsFilters 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.