Setting Post meta field

I am trying the beta version of Generateblocks, but the Post meta field does not show the field I have set up in Metabox.

I want to get the field for each custom post in the Query Loop, am I doing it wrong?

2022-04-22_16-57-30

Hi there,

You need to make sure that meta field is available via the REST api. Usually plugins will have a toggle when setting up the field to make it available.

Hope this helps!

I checked and it is set to expose in the REST API.

Where is it available for download?

Hi,

For example, the data in the link below.

Strange, that should allow the meta item to appear in the list.

As a test, can you try with a plugin like ACF? Does it appear?

A custom post type created in Metabox with data in a custom field created in Metabox.

However, it is not displayed.:thinking:

Is this a common issue? Or is it my personal issue?

I haven’t tried Metabox, but I have tried manually registering post meta fields and ACF - both work. Can you confirm that ACF shows up for you?

I also tried with ACF and it did not show up.
Could you please tell me how to set this up as I may be doing it wrong.
I will refer to the documentation if it is already there.

It looks like we may need to add specific support for metabox plugins to have their values display in the editor.

For now, try manually registering the field (you can do this in addition to adding it using the Metabox plugin):

add_action( 'init', function() {
    register_meta( 'post', 'reading_time', [
        'show_in_rest' => true
    ] );
} );

Just change reading_time to the name of your meta key.

Let me know :slight_smile:

Thank you very much.
It finally worked. :+1:

It seems that in addition to the above code, the Metabox plugin requires that the attached image be set in the custom post type creation screen.!
202205040655|690x384

Aha, yes that makes sense.

We’ll be implementing deeper integration with plugins like ACF and Metabox in the future so this extra step isn’t necessary.

Thanks for testing!

2 Likes

I am happy to see Tom’s comment about future “deeper integration with plugins like ACF and Metabox”. This is something that is important to me. And (like Marumoro) I can confirm that this isn’t just a Metabox issue - ACF fields also seem to be missing from the dropdown options out of the box. Of course their post meta ids can now be manually added, but the ideal would be to be able to select the fields in the dropdown and have a preview show up in the editor - much like the default WP fields now show up.