functions.php. Snippets are stored in the wp_wmp_snippets database table and each has an independent enable/disable toggle.
Code Snippets was added in v1.4.0. The Monaco Editor was added in v1.8.0.
How snippets execute
| Type | Hook | Effect |
|---|---|---|
| PHP | init | Code runs on every front-end and admin page load |
| CSS | wp_head | Styles are output in the <head> of every page |
| JavaScript | wp_footer | Script is output before the closing </body> tag |
The snippet list
All snippets are shown as cards in the main list. Each card shows:- An enable/disable toggle switch — flipping this activates or deactivates the snippet without deleting it.
- The snippet title and type badge (PHP, CSS, or JS).
- An Active badge when the snippet is currently enabled.
- An optional description.
- A preview of the code.
- The last updated date.
Creating a PHP snippet
Write your code
The Monaco Editor opens with PHP syntax highlighting. Write or paste your PHP code. Do not include an opening
<?php tag — the plugin wraps your code automatically.Add an optional description
The Description field is optional but helps document what the snippet does.
Click Create Snippet
Click Create Snippet. The snippet is saved and appears in the list in a disabled state.
The Monaco Editor
The code editor is powered by the Monaco Editor — the same engine used by VS Code. It provides:- Syntax highlighting for PHP, CSS, and JavaScript
- Line numbers
- Word wrap
- Automatic layout
