PageSourceSearch

https://fulltextsearch.org/docs/_next/static/chunks/pages/en/exten…/wpfts_index_post_start-0bc5c849bf7c2ffc.js

js fulltextsearch.org collected 2026-09-25 21:08:30 UTC 7,741 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3749],{58283:function(i,s,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/en/extending/filters/wpfts_index_post_start",function(){return e(77486)}])},77486:function(i,s,e){"use strict";e.r(s),e.d(s,{useTOC:function(){return useTOC}});var n=e(85893),t=e(37812),h=e(80390),r=e(38925);function useTOC(i){return[{value:"When Used",id:"when-used",depth:2},{value:"Arguments",id:"arguments",depth:2},{value:"Return Value",id:"return-value",depth:2},{value:"Example",id:"example",depth:2},{value:"Important Notes",id:"important-notes",depth:2}]}s.default=(0,t.c)(function(i){let{toc:s=useTOC(i)}=i,e={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...(0,r.a)(),...i.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e.h1,{children:"wpfts_index_post_start (Action)"}),"\n",(0,n.jsxs)(e.p,{children:["The ",(0,n.jsx)(e.code,{children:"wpfts_index_post_start"})," hook in WP Fast Total Search is called at the very beginning of the process of indexing a single post. This happens ",(0,n.jsx)(e.strong,{children:"before"})," the plugin starts extracting data from the post for addition to the index."]}),"\n",(0,n.jsx)(e.h2,{id:s[0].id,children:s[0].value}),"\n",(0,n.jsx)(e.p,{children:"This hook can be useful for performing the following actions:"}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsx)(e.li,{children:"Initializing variables or resources needed to process post data before indexing."}),"\n",(0,n.jsx)(e.li,{children:"Performing preliminary checks and deciding whether to index the given post."}),"\n",(0,n.jsxs)(e.li,{children:["Modifying the ",(0,n.jsx)(e.code,{children:"$post"})," object before data extraction."]}),"\n",(0,n.jsx)(e.li,{children:"Logging or debugging the indexing process."}),"\n"]}),"\n",(0,n.jsx)(e.h2,{id:s[1].id,children:s[1].value}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"$wpfts_core"})," (object): The plugin core object ",(0,n.jsx)(e.code,{children:"WPFTS_Core"}),". Provides access to all plugin methods and properties."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"$post"})," (object): The ",(0,n.jsx)(e.code,{children:"WP_Post"})," object representing the post being indexed."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"$is_refresh_raw_cache"})," (bool): A flag indicating whether a forced refresh of the post’s raw data cache is being performed."]}),"\n"]}),"\n",(0,n.jsx)(e.h2,{id:s[2].id,children:s[2].value}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:["The ",(0,n.jsx)(e.code,{children:"wpfts_index_post_start"})," hook ",(0,n.jsx)(e.strong,{children:"should not return any value"}),"."]}),"\n"]}),"\n",(0,n.jsx)(e.h2,{id:s[3].id,children:s[3].value}),"\n",(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"php","data-word-wrap":"","data-copy":"",children:(0,n.jsxs)(e.code,{children:[(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"/**"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:" * Sets a flag for debugging the indexing of specific posts."})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:" */"})}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"add_action"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"'wpfts_index_post_start'"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"'my_wpfts_index_post_start_handler'"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"10"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"3"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"function"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" my_wpfts_index_post_start_handler"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"($wpfts_core, $post, $is_refresh_raw_cache) {"})]}),"\n",(0,n.jsx)(e.span,{children:" "}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"    if"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" ($post"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"->"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ID "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"=="}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" 123"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:") { "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"// Post ID for which to enable debugging."})]}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"        $wpfts_core"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"->"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"_dev_debug "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" true"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"; "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:"// Enables debug mode in the plugin core."})]}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"	}"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"}"})})]})}),"\n",(0,n.jsx)(e.h2,{id:s[4].id,children:s[4].value}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:["Changes made to the ",(0,n.jsx)(e.code,{children:"$post"})," object inside the handler of this hook may affect the further indexing process."]}),"\n",(0,n.jsx)(e.li,{children:"This hook is called for each indexed post, so the code inside the handler should be efficient to avoid slowing down the indexing process."}),"\n"]}),"\n",(0,n.jsxs)(e.p,{children:["The ",(0,n.jsx)(e.code,{children:"wpfts_index_post_start"})," hook provides developers with an entry point at the very beginning of post indexing, allowing them to perform necessary actions before data extraction."]})]})},"/en/extending/filters/wpfts_index_post_start",{filePath:"pages/en/extending/filters/wpfts_index_post_start.md",timestamp:1733329702e3,pageMap:h.v,frontMatter:{},title:"wpfts_index_post_start (Action)"},"undefined"==typeof RemoteContent?useTOC:RemoteContent.useTOC)}},function(i){i.O(0,[9993,9774,2888,179],function(){return i(i.s=58283)}),_N_E=i.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.