Skip to content

Gutenberg blocks conditional fields not working when adding blocks programmatically #1296

@henrik-dons

Description

@henrik-dons

Hi all,

I came across issue that conditional fields are not being initialized when adding blocks to post_content meta programmatically.
When I add block via Gutenberg editor manually, it works fine.

Does anyone know how I can trigger conditional field initialization?
Or should I pass something to block contents to make the conditional fields work on load?

PHP Block object contents:
Array(
[blockName] => carbon-fields/paragraph
[attrs] => Array(
[data] => Array(
[content] => '

Paragraph

'
[hidden] => 0
[multi_column] => 0
[column_width] => // conditional field here
)
)
[innerBlocks] => Array()
[innerHTML] =>
[innerContent] => Array()
)

Looking forward to any guidance to fix this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions