Skip navigation

Snippets Snippets

  • WebAware
  • Shop
  • Snippets
  • Search
Menu

Search

  • Home
  • About
  • Privacy Policy
  • Twitter
  • GitHub
  • WordPress

Yet another programmer blogging about code

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: blocks, cpt, wordpress
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: blocks, cpt, wordpress
Posted in Snippets | No comments

Read more »

A new theme for WebAware

30 August 2021

We now have a new theme, built with Sass, Timber / Twig, minimal pure JS, and accessible HTML.

Tags: timber, twig, wordpress
Posted in Administrivia | No comments

Read more »

Easy Digital Downloads and WebP images

21 January 2021

Easy Digital Downloads is the ideal WordPress eCommerce plugin for sites that distribute non-physical products like software or ebooks. You can run into a problem if your site has WebP optimised versions of your images though. Easily fixed through a filter hook.

Tags: easy digital downloads, webp, wordpress
Posted in Snippets | No comments

Read more »

postcss-clean breaks above postcss@8.1.10

3 January 2021

If you use postcss-clean to drive clean-css as part of your build process, you need to pin postcss to no later than version 8.1.10 or you'll get "TypeError: node.getIterator is not a function".

Tags: css, javascript
Posted in How-to | No comments

Read more »

Reduce Gravity Forms spam false positives with multipart emails

9 December 2020

Standard Gravity Forms notification emails are HTML emails. They don't have a plain text part, which some spam filters flag as maybe spam. Stop this happening by making them multipart emails.

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

Read more »

Allow editors or contributors to change settings

15 August 2020

The WordPress settings API makes it easy to add shared content to a site for administrators to edit. But it would be nice to let other roles edit some settings too.

Tags: wordpress
Posted in Snippets | No comments

Read more »

Variable fonts with legacy fallback

2 August 2020

Variable fonts support several variations of a typeface from a single file. Support older browsers through progressive enhancement.

Tags: css, fonts, legacy
Posted in Snippets | No comments

Read more »

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

© 2022 WebAware Pty Ltd | ABN 56 079 079 593

  • Twitter
  • GitHub
  • WordPress
  • Contact Us