PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.2
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.2
4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 All 200 releases
← All changes | includes/REST/Docs.php +19 -1 4.8.24.9.2 View file →
@@ -703,9 +703,27 @@
703 703 public function search_insert( $request ) {
704 704 $search_input = sanitize_text_field( $request->get_param( 's' ) );
705 705 $no_result = sanitize_text_field( $request->get_param( 'no_result' ) );
706 706
707 - return betterdocs()->query->insert_search_keyword( $search_input, $no_result );
707 + $result = betterdocs()->query->insert_search_keyword( $search_input, $no_result );
708 +
709 + if ( ! empty( $search_input ) ) {
710 + /**
711 + * Fires after a front-end docs search is logged.
712 + *
713 + * Pro hooks this to record a 'search' event into the raw events
714 + * table, which the Advanced Analytics aggregator rolls up into
715 + * betterdocs_analytics_search (search volume + zero-result rate —
716 + * the primary content-gap signal).
717 + *
718 + * @param string $search_input The search term.
719 + * @param bool $no_result True when the search returned no results.
720 + * @param WP_REST_Request $request The ingest request.
721 + */
722 + do_action( 'betterdocs_analytics_search_recorded', $search_input, ! empty( $no_result ), $request );
723 + }
724 +
725 + return $result;
708 726 }
709 727
710 728
711 729 public function get_terms_name_and_slug( $request ) {