Log1x / acf-composer

Compose ACF Fields, Blocks, Widgets, and Option Pages with ACF Builder on Sage 10.
https://github.com/Log1x/acf-composer
MIT License
398 stars 53 forks source link

How to enable usePostMeta in ACF Block #248

Closed joseph-farruggio closed 1 month ago

joseph-farruggio commented 1 month ago

How can I enabled usePostMeta for ACF Blocks generated with the ACF Composer?

Log1x commented 1 month ago

try adding it to https://github.com/Log1x/acf-composer/blob/master/src/Console/stubs/block.stub#L100

joseph-farruggio commented 1 month ago

I tried that, but I don't believe it belongs inside of supports.

If this were going inside of block.json, then it would go under the acf key.

Log1x commented 1 month ago

oh i see, it needs to be in the acf key. https://www.advancedcustomfields.com/resources/save-acf-block-values-to-post-meta/

it needs a PR to go here for block.json but would need to source dive to see if it can be done when registered with PHP (not cached)

Log1x commented 1 month ago

looks like it can be done with use_post_meta when passed to settings for non-cached blocks. it would make sense to introduce a new $postMeta bool to enable this probably

joseph-farruggio commented 1 month ago

Is there a supported way of manually passing in use_post_meta from my block's controller?

Log1x commented 1 month ago

not in this case, but if you want to do a PR I can get it merged in and push a release. otherwise I can swing around to this sometime this week.

Log1x commented 1 month ago

Would you mind giving #249 a try when you get a chance?

joseph-farruggio commented 1 month ago

Sorry for the delay. This is what I needed. Thanks