validate_theme_template
Validates PHP theme template files against WordPress best practices to detect header/footer, The Loop, output escaping, hardcoded script/style, accessibility, and template hierarchy issues.
Instructions
Validate a PHP theme template file against WordPress best practices. Checks for: get_header/get_footer, wp_head/wp_footer, The Loop, output escaping, hardcoded scripts/styles, accessibility, template hierarchy compliance. Template types: index, single, page, archive, category, tag, search, 404, header, footer, sidebar, functions, etc. Theme types: block, classic, hybrid.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>",
"conversationId": "<conversationId>"
},
"name": "validate_theme_template"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The PHP template file content to validate. | |
| revision | No | Revision number. | |
| themeType | No | Theme type: 'block' for block/FSE themes, 'classic' for traditional PHP themes, 'hybrid' for both. | classic |
| artifactId | No | Artifact ID for tracking revisions. | |
| templateType | No | The type of template file being validated. | general |
| conversationId | Yes | The conversation ID obtained from learn_wordpress_api. |