1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4791],{11009:function(e,s,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/en/extending/filters/wpfts_pre_set_file_search",function(){return i(24597)}])},24597:function(e,s,i){"use strict";i.r(s),i.d(s,{useTOC:function(){return useTOC}});var n=i(85893),t=i(37812),r=i(80390),h=i(38925);function useTOC(e){return[{value:"Arguments",id:"arguments",depth:2},{value:"Return Value",id:"return-value",depth:2},{value:"Important Notes",id:"important-notes",depth:2},{value:"Example (though using this filter is not recommended)",id:"example-though-using-this-filter-is-not-recommended",depth:2}]}s.default=(0,t.c)(function(e){let{toc:s=useTOC(e)}=e,i={code:"code",em:"em",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...(0,h.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i.h1,{children:[(0,n.jsx)(i.code,{children:"wpfts_pre_set_file_search"})," (Filter)"]}),"\n",(0,n.jsxs)(i.p,{children:["The ",(0,n.jsx)(i.code,{children:"wpfts_pre_set_file_search"})," filter in WP Fast Total Search is designed to modify the ",(0,n.jsx)(i.code,{children:"WP_Query"})," object ",(0,n.jsx)(i.em,{children:"before"})," file search settings are applied. ",(0,n.jsx)(i.strong,{children:"However, based on the code and comments, this filter is deprecated and may be removed in the future."})," It is not currently used for any significant logic in the plugin."]}),"\n",(0,n.jsx)(i.h2,{id:s[0].id,children:s[0].value}),"\n",(0,n.jsxs)(i.ul,{children:["\n",(0,n.jsxs)(i.li,{children:[(0,n.jsx)(i.code,{children:"&$wpq"})," (object): The ",(0,n.jsx)(i.code,{children:"WP_Query"})," object."]}),"\n",(0,n.jsxs)(i.li,{children:[(0,n.jsx)(i.code,{children:"$display_attachments"})," (int): A flag indicating whether to display attachments in search results (deprecated parameter)."]}),"\n"]}),"\n",(0,n.jsx)(i.h2,{id:s[1].id,children:s[1].value}),"\n",(0,n.jsxs)(i.ul,{children:["\n",(0,n.jsxs)(i.li,{children:["The filter should not return any value, as the ",(0,n.jsx)(i.code,{children:"WP_Query"})," object is passed by reference."]}),"\n"]}),"\n",(0,n.jsx)(i.h2,{id:s[2].id,children:s[2].value}),"\n",(0,n.jsxs)(i.ul,{children:["\n",(0,n.jsxs)(i.li,{children:[(0,n.jsx)(i.strong,{children:"This filter is deprecated and should not be used."})," Instead, use other available filters such as ",(0,n.jsx)(i.code,{children:"wpfts_pre_get_posts"})," or filters related to specific search settings."]}),"\n",(0,n.jsx)(i.li,{children:"The documentation should clearly indicate that the filter is deprecated and suggest alternative options."}),"\n"]}),"\n",(0,n.jsx)(i.h2,{id:s[3].id,children:s[3].value}),"\n",(0,n.jsx)(i.pre,{tabIndex:"0","data-language":"php","data-word-wrap":"","data-copy":"",children:(0,n.jsxs)(i.code,{children:[(0,n.jsxs)(i.span,{children:[(0,n.jsx)(i.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"add_filter"}),(0,n.jsx)(i.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(i.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"'wpfts_pre_set_file_search'"}),(0,n.jsx)(i.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,n.jsx)(i.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"'my_wpfts_pre_set_file_search'"}),(0,n.jsx)(i.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,n.jsx)(i.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"10"}),(0,n.jsx)(i.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,n.jsx)(i.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"2"}),(0,n.jsx)(i.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:");"})]}),"\n",(0,n.jsx)(i.span,{children:" "}),"\n",(0,n.jsxs)(i.span,{children:[(0,n.jsx)(i.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"function"}),(0,n.jsx)(i.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" my_wpfts_pre_set_file_search"}),(0,n.jsx)(i.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(i.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"&"}),(0,n.jsx)(i.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"$wpq, $display_attachments)"})]}),"\n",(0,n.jsx)(i.span,{children:(0,n.jsx)(i.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"{"})}),"\n",(0,n.jsx)(i.span,{children:(0,n.jsx)(i.span,{style:{"--shiki-light":"#6A737D","--shiki-dark":"#6A737D"},children:" // Your logic (using this filter is not recommended)."})}),"\n",(0,n.jsx)(i.span,{children:(0,n.jsx)(i.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"}"})})]})})]})},"/en/extending/filters/wpfts_pre_set_file_search",{filePath:"pages/en/extending/filters/wpfts_pre_set_file_search.md",timestamp:1733329702e3,pageMap:r.v,frontMatter:{},title:"wpfts_pre_set_file_search (Filter)"},"undefined"==typeof RemoteContent?useTOC:RemoteContent.useTOC)}},function(e){e.O(0,[9993,9774,2888,179],function(){return e(e.s=11009)}),_N_E=e.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.