Adding customizations to POP with the Code Snippets plugin

Configurationwordpress2026-07-01

Goal

Add a small customization (e.g. modify a POP filter) without touching the theme’s functions.php and without creating a dedicated plugin.

Prerequisites

Steps

  1. Install the free Code Snippets plugin from wp-admin > Plugins > Add New, then activate it.
  2. In the side menu, open Snippets > Add New.
  3. Give it a descriptive title (e.g. “POP - disable invoice number for payment method X”).
  4. Paste the PHP code into the dedicated area. Do not include the <?php tag: it’s already included automatically, and duplicating it causes a fatal error.
  5. If there are syntax errors, the editor flags them before you save.
  6. Leave the “Run snippet everywhere” option active for server-side hooks (add_filter, add_action) used by the POP plugin.
  7. Save and activate the snippet.
  8. Verify the behavior on the site (e.g. in sandbox, if the snippet affects invoice generation).

Real POP hook examples usually involved

These filters exist in the plugin’s code and are meant to be customized via snippet, without modifying the plugin files:

Verify

After activating the snippet, reproduce the scenario you wanted to change (e.g. generate a test order) and check that the behavior matches what you expected.

Common errors

For the checkout field names these snippets often act on, see checkout-field-names.