PageSourceSearch

https://fulltextsearch.org/docs/_next/static/chunks/pages/en/archi…/admin_enqueue_scripts-7e27bc6019da8e5b.js

js fulltextsearch.org collected 2026-09-25 21:07:33 UTC 5,054 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2482],{73715:function(e,n,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/en/architecture/hooks_usage/admin_enqueue_scripts",function(){return s(20974)}])},20974:function(e,n,s){"use strict";s.r(n),s.d(n,{useTOC:function(){return useTOC}});var i=s(85893),t=s(37812),r=s(80390),d=s(38925);function useTOC(e){let n={code:"code",...(0,d.a)()};return[{value:(0,i.jsxs)(i.Fragment,{children:["The ",(0,i.jsx)(n.code,{children:"admin_enqueue_scripts"})," Hook in WPFTS"]}),id:"the-admin_enqueue_scripts-hook-in-wpfts",depth:2}]}n.default=(0,t.c)(function(e){let{toc:n=useTOC(e)}=e,s={code:"code",h2:"h2",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,d.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h2,{id:n[0].id,children:n[0].value}),"\n",(0,i.jsxs)(s.p,{children:["The ",(0,i.jsx)(s.code,{children:"admin_enqueue_scripts"})," hook is a standard WordPress hook used to enqueue scripts and styles in the WordPress admin panel. WPFTS utilizes this hook to enqueue necessary scripts and styles on its settings pages and post editing pages."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsxs)(s.strong,{children:["What WPFTS Does When ",(0,i.jsx)(s.code,{children:"admin_enqueue_scripts"})," is Called:"]})}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.strong,{children:"Determining the Current Page:"})," The plugin determines the current admin page using the ",(0,i.jsx)(s.code,{children:"get_current_screen()"})," function."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.strong,{children:"Enqueuing Scripts and Styles on Settings Pages:"})," If the current page is a WPFTS settings page (",(0,i.jsx)(s.code,{children:"$wpfts_core->is_wpfts_settings_page"}),"), the plugin enqueues core styles and scripts required for the settings interface, including Bootstrap, jQuery UI, Font Awesome, Select2, and Ace editor.  It also sets the ",(0,i.jsx)(s.code,{children:"is_welcome_message"})," flag and enqueues scripts for working with meta boxes (postbox) and pointers (",(0,i.jsx)(s.code,{children:"wp-pointer"}),")."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.strong,{children:"Enqueuing Scripts on Post Editing Pages:"})," On post editing pages, WPFTS enqueues scripts necessary for displaying indexing status."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.strong,{children:"Enqueuing Scripts and Styles for Add-ons:"})," The ",(0,i.jsx)(s.code,{children:"wpfts_admin_scripts"})," action is called, which add-ons can use to enqueue their own scripts and styles."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsxs)(s.strong,{children:["Important Functions Involved in ",(0,i.jsx)(s.code,{children:"admin_enqueue_scripts"})," Handling:"]})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"get_current_screen()"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"wp_enqueue_style()"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"wp_enqueue_script()"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"WPFTS_Core::set_is_settings_page()"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"WPFTS_Core::set_option()"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"WPFTS_Core::FeatureDetector()"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"do_action('wpfts_admin_scripts')"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"How to Use This in Add-on Development:"})}),"\n",(0,i.jsxs)(s.p,{children:["Add-on developers can use the ",(0,i.jsx)(s.code,{children:"wpfts_admin_scripts"})," action to enqueue their scripts and styles on WPFTS settings pages. This ensures your scripts and styles are only loaded when needed, preventing slowdowns on other admin pages."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Additional Notes:"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"WPFTS uses versioning for scripts and styles to avoid caching issues."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"The plugin enqueues different scripts and styles depending on the current admin page, optimizing performance."}),"\n"]}),"\n"]})]})},"/en/architecture/hooks_usage/admin_enqueue_scripts",{filePath:"pages/en/architecture/hooks_usage/admin_enqueue_scripts.md",timestamp:1733329702e3,pageMap:r.v,frontMatter:{},title:"Admin Enqueue Scripts"},"undefined"==typeof RemoteContent?useTOC:RemoteContent.useTOC)}},function(e){e.O(0,[9993,9774,2888,179],function(){return e(e.s=73715)}),_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.