2.11.0
What’s Changed
Fixed
- Inlined block stylesheets shipped unminified source.
acf_blocks_minify_loader_src()only runs when a sheet is printed as a<link>. Styles registered fromblock.jsonalso carrypathdata, andwp_maybe_inline_styles()reads that file straight off disk and prints its bytes into the page without the URL ever reachingstyle_loader_src— so every page rendering one of those blocks carried the readable source. It hit the four blocks whoseblock.jsondeclaresstyleas an array (Callout, Feature Grid, Post Display, Table of Contents); a stringstyleis pre-registered byacf_blocks_register_styles()under the handle WordPress would have generated, so core bails before attachingpath.acf_blocks_minify_registered_styles()now rewrites bothsrcandpathon plugin-owned registrations before the inline pass. Rewriting the registration rather than the printed tag keeps the inlining, so pages still avoid the extra request and just carry less of it — measured on a published Table of Contents post, 2,279 inlined bytes down to 1,494. - ACF blocks now keep their baseline rhythm in the block editor.
acf_blocks_register_layout_styles()attachestokens.cssandblock-layout.csswithwp_enqueue_block_style(), which only fires when a block renders on the front end — the editor canvas never received them. A heading following a Table of Contents block sat flush against it while editing and had 1.5rem of air once published. The sheets are now also enqueued onenqueue_block_assetsin admin, the hook WordPress injects into the canvas document. Front-end delivery still goes throughwp_enqueue_block_style(), so pages only pay for the sheets when a block is actually present. block-layout.cssmatches the editor’s markup. The front end renders the block element itself carrying.acf-block, while the editor wraps the same output in.wp-blockand putsacf-block-component/acf-block-<name>on the wrapper — so.acf-blockmatched nothing inside the canvas even once the sheet loaded. The rule now carries a second selector for the wrapper. The two cannot match the same element, so the margin is never doubled. That second selector deliberately does not use:where(): the block editor sets its own margins on.wp-blockelements, so a zero-specificity rule loses to them. Measured on a Table of Contents block followed by a heading — 0px with:where(), 24px without, against 24px on the published page.
Commits
- 2.11.0: serve minified CSS for inlined block stylesheets (
ae06e79)
Stats
- Commits: 1
- Changes: 7 files changed, 212 insertions(+), 4 deletions(-)
Plugin Info
- Blocks included: 29
- Requires WordPress: 6.0+
- Requires PHP: 7.4+
- Requires: ACF Pro 6.0+ or Secure Custom Fields
Installation
- Download
acf-blocks-plugin-*.zipfrom the assets below - Go to Plugins → Add New → Upload Plugin in WordPress admin
- Upload the zip file and activate
