From c9511a4dd3dd7ae9065cf92e5e5d8b4f56f55f9c Mon Sep 17 00:00:00 2001 From: Jesse Erbach Date: Tue, 14 Jun 2022 20:28:24 -0500 Subject: [PATCH] Allow for editorBlocks to get acf block attribute values by acf block names --- src/class-config.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/class-config.php b/src/class-config.php index 13d326e..5f899af 100644 --- a/src/class-config.php +++ b/src/class-config.php @@ -378,6 +378,12 @@ protected function get_acf_field_value( $root, $acf_field, $format = false ) { $id = $root['node']->ID; } + if ( is_array( $root ) && isset( $root['blockName'] ) ) { + if ( isset( $root[ 'attrs' ][ 'data' ][ $acf_field['name'] ] ) ) { + $value = $root[ 'attrs' ][ 'data' ][ $acf_field['name'] ]; + } + } + if ( is_array( $root ) && ! ( ! empty( $root['type'] ) && 'options_page' === $root['type'] ) ) { if ( isset( $root[ $acf_field['key'] ] ) ) {