Lightweight JS Snippet 1.4: pick the post, skip the post ID

Picking which page a snippet runs on, without hunting for post IDs

Lightweight JS Snippet has always been the same one-line pitch: paste a piece of JavaScript, pick the post or page it should run on, save. No snippet library, no folders, no version control UI — just a script that fires on the pages you care about.

The thing that was annoying about it, until now, was the picking part. Earlier versions made you type a comma-separated list of post IDs into a textbox. Which means looking up post IDs in the admin first, then pasting them in the right format, then double-checking you didn’t fat-finger one. For a plugin whose whole point is “drop in a tracking pixel on three pages without thinking about it,” that was more thinking than it should have been.

What 1.4 changes

Version 1.4 replaces the textbox with a search-as-you-type chip picker. Start typing a post or page title, click the one you want, it gets added as a chip. Click the × on a chip to remove it. That’s it.

  • Search any post, page, or product by title.
  • Multiple targets are first-class — add as many as you need.
  • Storage format under the hood is unchanged. If you upgrade from an older version, your existing snippet keeps running on exactly the same pages.

Nothing new on the front end either — same single inline <script> tag in <head> on the pages you picked.

More on the project page, or install it from wp.org. Settings live under Settings → Lightweight JS snippet.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *