Code Snippet Weekly

Useful code snippets you can use today. | 2026-08-30

THE BIG ONE

WordPress has just rolled out a game-changing feature: PHP-only block registration. This means you can now create custom blocks without relying on React or complex build pipelines. It’s particularly useful for developers who prefer backend solutions or are working on simple projects. You can define your blocks directly in PHP, making it easier to maintain and deploy. This change opens up new possibilities for WordPress development, especially for server-side rendering and dynamic content generation without the overhead of JavaScript.

Check out the full details here: WordPress PHP-Only Block Registration

QUICK HITS

Creating Web Widgets Using the Document Picture-in-Picture API: Ever thought about enhancing your web apps with Picture-in-Picture? This API allows you to create interactive web widgets that can float over other windows, making your applications more engaging. Why it matters: It provides a unique way to deliver content without being intrusive. Learn more here.

Animation-Trigger Property in CSS: This new property allows you to delay CSS animations until a specific event occurs, rather than on page load. Why it matters: It gives you better control over your animations, improving UX. Just be cautious that not all browsers support it yet. Explore the details.

Syntax Highlighting with MicroLighter: Simplify your code blocks with this lightweight syntax highlighter that doesn’t bog you down with complex markup. Why it matters: It’s perfect for anyone looking to streamline their documentation or blogging without the overhead. Check it out here.

How to Automate Your Tests in Express Using Vitest: Testing your Express app can be tedious, but with Vitest, you can automate much of it. Why it matters: It saves time and helps catch bugs early. Just remember to set up your environment properly to avoid configuration headaches. Read more here.

One Shared Memory for Every Agent in a Project: This innovative approach allows multiple AI agents to share memory, simplifying complex projects. Why it matters: It enhances collaboration between agents, improving overall efficiency. Just ensure you manage access correctly to avoid data collisions. Learn how it works.

ONE THING TO TRY

This week, give PHP-only block registration in WordPress a shot. It’s a great way to create custom blocks without the fuss of JavaScript. You can start small and expand as you get comfortable. It’s a practical skill that can save you time in future projects.

SIGN-OFF

I hope you find these snippets useful for your projects! Feel free to hit reply with any questions or to share your experiences using these techniques.

More from FreshSift:

Get this in your inbox every week

Subscribe for Free →