Create or update a snippet
wp_snippet_saveCreate or update a WordPress PHP snippet by storing code with a target scope. Save it inactive, test it, then activate to run on the live site.
Instructions
Save a snippet. Omit id to create; pass id to update. Keep active=false, test with wp_snippet_run, then activate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| code | Yes | PHP without the opening <?php tag | |
| name | Yes | ||
| scope | No | manual | |
| active | No | ||
| priority | No | ||
| description | No |