hideEmpty value in custom post type template not being saved

Hello,

I created a custom metabox called “custom_metabox_event_location”. If I create a custom post type, use your block and save this setting, everything is working. Your metablock is showing the correct value of the metabox.

But I created a custom template for my custom post type following this guide: .

The custom template is working and I added some of your metablock functions like “hideEmtpy” into my template, which you can see here:

'template' => array(
    // Ort
    array( 'mfb/meta-field-block', array(
        'metaType' => 'postType',
        'fieldType' => 'meta',
        'fieldName' => 'custom_metabox_event_location',
        'hideEmpty' => 'true',
        'emptyMessage' => 'Kein Ort',
        'tagName' => 'p',
    ) ),            
)

If I create a new custom post type, everything is showing correct.

The problem is, that if I enter no value in the metabox for “custom_metabox_event_location”, save my custom post type and then go back to the edit screen, the value for “hideEmpty” is back to “false”.

Why isn’t this being saved? Do I have to add something to my custom post type?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer