Support

Account

Home Forums Gutenberg ACF Blocks – Pass field value to script Reply To: ACF Blocks – Pass field value to script

  • Thanks for your suggestions! I completely forgot about this issue, but I just tested this for future reference and it turns out that $post object isn’t available yet when registering ACF Blocks using acf/init action (as suggested in the acf_register_block_type documentation). So it’s probably better to just put the data in data-attributes in the template/render_callback and read them from there, or pass them some other way, especially if it’s just a few parameters.