snippets/get-global-scripts reads the site-wide header, body and footer scripts WPCode outputs on every page.
These are not snippets. They are the original Insert Headers and Footers fields, stored in their own options.
At a glance
| Ability | snippets/get-global-scripts |
| Toolset | WPCode — toolset/wpcode |
| Group | WPCode › Global Scripts |
| Requires | WPCode, active on the site |
| Capability | manage_options |
| Safety | Read-only — changes nothing |
| Repeatable | Idempotent — running it twice leaves the same result |
| Ships in | AcrossAI Abilities Manager 0.0.34 and later |
How it works
WPCode grew out of Insert Headers and Footers, and those three fields survived the transition unchanged. They have no code type, no conditional logic, no location and no active state — they simply output on every page of the site, always.
Which makes them easy to overlook. An audit of what runs on a site that only lists snippets misses three blocks of markup that run everywhere, including on checkout and login pages.
The body slot has a caveat the others do not: it is rendered through wp_body_open, and a theme that never calls that hook never outputs it. The response reports whether the active theme supports it, so a script that does nothing can be explained rather than debugged.
The option keys are returned too, which is what lets you find the same values through the options abilities if you need to.
Input
This ability takes no input.
What comes back
| Name | Type | What it is |
|---|---|---|
header | string | The markup output in the site head. |
body | string | The markup output just after the opening body tag. |
footer | string | The markup output in the site footer. |
body_supported | boolean | Whether the active theme calls wp_body_open. If not, the body slot never renders. |
option_keys | object | The option names these are stored under. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation. |
Example
Ask your assistant:
What scripts are running on every page of this site?
It resolves to one call:
{
"ability": "snippets/get-global-scripts",
"parameters": {}
}Worth knowing
- These run on every page, unconditionally. No location, no rules, no active flag.
body_supportedfalse means the body slot outputs nothing, whatever is in it.- Include these in any audit of what a site loads. A snippet listing does not cover them.
Related abilities
- Update Global Header and Footer Scripts — change them
- List Code Snippets — the other half of what runs
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category