AdvancedCustomFields / AdvancedCustomFields/acf

Inconsistency with block support classes in ACF blocks

Open
#739 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

Hey @lgladdy,

currently I'm running some tests to work without the additional block wrapper div so that the frontend result is even more possible in the editor view.

This could be solved if we only use the ACF block wrapper TEMPLATE div for the frontend and prevent the output of this div in the block editor. While working on this, I noticed some inconsistencies with how ACF adds block classes.

Using the block align like "wide" or "full" adds a class name "alignwide" and "alignfull" to the "block-editor-block-list__block" div.

However, this does not work in the case of block alignContent and alignText. If an option is set, class names like has-text-align-left will not be output to the block-editor-block-list__block div. There seems to be an inconsistency here.

Why it's working correct for align but not for alignContent and alignText? It's possible to fix this for us?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing an ACF block in the editor with align, alignContent, and alignText options, then compare the classes on the block-editor-block-list__block div. Trace how ACF adds the working align classes and identify why the other alignment classes are omitted. Done means alignContent and alignText produce the expected editor wrapper classes consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.