Rules on creating patterns in php for the WordPress block editor

Creating patterns programmatically for a WordPress theme using blocks is incredibly hard and frustrating for so many reasons. Even AIs struggle – and they have access to so much more than we do, so with the help of GPT 5 and days and days of struggle (back and forth coding) it came up with this. …