AdvancedCustomFields / AdvancedCustomFields/acf

How can I get block object based on ID?

Open
#639 5 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

Hi,

I'm looping through some fields that are part of ACF Gutenberg blocks and I want to fetch the block object so that I can access information such as icon, title, description etc. If I know the block ID, such as block_612de94a30387 , how can I go about fetching the object? I tried to use acf_get_block_types() but none of the items in the array have an ID that I can compare against.

Any help is appreciated!

Regards,
Jonathan

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

The issue mentions ACF Gutenberg blocks, the block ID format, and acf_get_block_types(); no file or test is identified. Start by reviewing block registration and the return structure of acf_get_block_types(). Done would be a confirmed, documented way to retrieve the block metadata object from its ID.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.