Skip Navigation

[Resolved] Using a block in a custom field

This thread is resolved. Here is a description of the problem and solution.

Problem:

I am trying to add a block type called "Open Sheet Music Display" as a custom field within a custom post type (music-styles). I attempted using a WYSIWYG and multi-line custom field, but they do not allow adding blocks. It seems I can only use Gutenberg blocks outside of custom fields.

Solution:

Blocks are a native feature of the WordPress editor and cannot be used within custom fields. Toolset cannot recreate block functionality inside custom fields because custom fields are standard WordPress features that do not support block content. You can only use blocks inside the main content editor.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 1 reply, has 2 voices.

Last updated by Christopher Amirian 2 months, 1 week ago.

Assisted by: Christopher Amirian.

Author
Posts
#2746698
Screenshot 2024-09-15 090631.png

Tell us what you are trying to do?
I have a block type called Open Sheet Music Display, for the sake of consistency while creating a custom post type (music-styles), I would like to have a custom field names music-notation that uses that block type. It appears that I can only use Gutenberg outside the custom fields.

I've tried adding a wysiwyg field and a multi line, but they won't allow me to add a block.

Is there any documentation that you are following?
No
Is there a similar example that we can see?
hidden link

What is the link to your site?
dev.salsablanca.com

#2747078

Christopher Amirian
Supporter

Languages: English (English )

Hi,

Unfortunately, it is not possible to have a block inside the content of a custom field.

Blocks are the feature of the native WordPress editor that is available as a block editor inside the content.

The toolset can not recreate such a feature inside the custom fields.

Just to make sure we are on the same page, Toolset adds a GUI layer over the custom fields so you can easily add content such as multi-line, single line, date ....

However the underlying code itself is a normal custom field of the WordPress platform.

WordPress itself does not allow to add a block as a custom field.

Hope I could explain the details.

Thanks.

#2747270

I suspected that was the case. Thanks.