Skip navigation

Snippets Snippets

  • WebAware
  • Shop
  • Snippets
  • Search

Search

  • Home
  • About
  • Privacy Policy
  • Mastodon
  • GitHub
  • WordPress
  • RSS
  • Contact Us

Yet another programmer blogging about code

Caching oembed with nginx

14 January 2023

When we post a blog link on Mastodon, caching pages might not be enough, thanks to oembed requests — so cache those too with nginx fastcgi cache.

Tags: caching, nginx, wordpress
Posted in Snippets | No comments

Read more »

Purging the nginx cache when users differ

10 January 2023

Purge the whole nginx fastcgi cache from WordPress when nginx and PHP run as different users.

Tags: caching, nginx, wordpress
Posted in Snippets | No comments

Read more »

Hide fields under review in Gravity Forms

14 December 2022

Hiding a page or section of a form in Gravity Forms, without having to remove it from the form.

Tags: gravity forms
Posted in How-to | No comments

Read more »

Test for blocks within reusable blocks

9 December 2022

WordPress has a handy function called has_block() that tests whether your page or post uses a particular block type.

Tags: wordpress, wp-blocks
Posted in Snippets | No comments

Read more »

Gravity Forms countries restricted by WooCommerce countries

3 December 2022

If WooCommerce is restricting which countries it sells to, then Gravity Forms should probably restrict its addresses to match.

Tags: gravity forms, woocommerce
Posted in Snippets | No comments

Read more »

WordPress video in the block editor

29 November 2022

The WordPress block editor comes with a simple video block that doesn't support MP4 and WebM for one video. But the old video shortcode can.

Tags: wordpress
Posted in How-to | No comments

Read more »

Safari-compatible SVG with dark mode support

14 June 2022

SVG images can support light and dark mode in CSS. But Safari browser has a problem.

Tags: css, svg
Posted in Snippets | No comments

Read more »

Turn on debug logging for WordPress tests

1 January 2022

Automatically turn on the debug log when running unit tests for WordPress plugins.

Tags: php, testing, wordpress
Posted in How-to | No comments

Read more »

Unit testing WordPress plugins with PHP8+

7 December 2021

Run your WordPress plugin tests on PHP 8.0 and later. With thanks to Juliette Reinders Folmer and Yoast!

Tags: php, testing, wordpress
Posted in How-to | No comments

Read more »

Restrict WordPress blocks by post type

3 November 2021

When building custom blocks for the WordPress editor, sometimes we want to make them only available on specific post types.

Tags: cpt, wordpress, wp-blocks
Posted in Snippets | No comments

Read more »

Send UpdraftPlus backups to different S3 folders

18 September 2021

Send UpdraftPlus backups to different S3 folders, so that separate lifecycle policies can be applied to them.

Tags: amazon s3, backups, wordpress
Posted in Snippets | No comments

Read more »

Block editor link control for custom post types

14 September 2021

The WordPress block editor supports a link picker that we can add to our custom blocks. The best bit is we can restrict its searches to a post type of our choosing.

Tags: cpt, wordpress, wp-blocks
Posted in Snippets | No comments

Read more »

  • 1
  • 2
  • 3
  • 4
  • …
  • 10
  • 11
  • >

© 2025 WebAware Pty Ltd | ABN 56 079 079 593

  • Mastodon
  • GitHub
  • WordPress
  • RSS
  • Contact Us