corcel / corcel/acf

Image in Flexible Content .. can't get ID

Open
#86 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
132
Forks
102
PR merge metrics
No merged PRs in 30d

Description

Hi,

I've got an image within a flexible content block and I'm trying to get its ID so I can pass it to a WP function

```
$blocks = $post->acf->flexibleContent('flexible_content_blocks');
foreach($blocks as $block) {
$image = $block->fields->image;
$ID = $image->ID; // fails
wp_get_attachment_image($ID, 'fullsize', '', ['class' => 'foo']);
}
```

currently using
```
"jgrossi/corcel": "2.8",
"corcel/acf": "^1.1.1"
```

(I can't update due to other dependencies currently)

thanks for any advice

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.