Programming
Register a Block Pattern in WordPress
register_block_pattern stores a ready-made arrangement of blocks, while register_block_pattern_category gives it a home in the inserter. The content is ordinary block markup copied out…
Programming
register_block_pattern stores a ready-made arrangement of blocks, while register_block_pattern_category gives it a home in the inserter. The content is ordinary block markup copied out…
Programming
A dynamic block saves nothing: save returns null and render_callback names the PHP that builds the markup on every request, so the output can…
Programming
register_block_type reads a block.json file and wp.blocks.registerBlockType describes the block in plain JavaScript. Because wp.element.createElement replaces JSX, there is no compiler in the loop…
Programming
ob_start catches everything a script prints, so a template that echoes becomes a function that returns. That one trick powers shortcodes and page caches,…
Programming
Send notifications the WordPress way: wp_mail with headers, a From address that exists, an HTML body and attachments - then catch the failure it…
Programming
A generator hands back one line at a time instead of building the whole array, which cut peak memory from 35.3 MB to 2.0…