Custom Fields
Re-Envisioned
Support MB Custom Table Unable to save field when updating field to empty

  • Creator
    Topic
  • #23973
    Resolved devwork
    Participant

    Hi,

    I am unable to set a field to empty by removing the content of the field and click on update.

    These are the fields.

    <?php
    add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
    
    function your_prefix_register_meta_boxes( $meta_boxes ) {
        $prefix = '';
    
        $meta_boxes[] = [
            'title'        => esc_html__( 'Endowment Form', 'text-domain' ),
            'id'           => 'endowment-form',
            'post_types'   => ['endowment'],
            'context'      => 'normal',
            'priority'     => 'high',
            'fields'       => [
                [
                    'id'   => $prefix . 'title',
                    'type' => 'text',
                    'name' => esc_html__( 'Title', 'text-domain' ),
                ],
                [
                    'id'   => $prefix . 'description',
                    'type' => 'textarea',
                    'name' => esc_html__( 'Description', 'text-domain' ),
                ],
                [
                    'id'   => $prefix . 'content_text',
                    'name' => esc_html__( 'Content', 'text-domain' ),
                    'type' => 'wysiwyg',
                ],
                [
                    'id'   => $prefix . 'icon',
                    'type' => 'text',
                    'name' => esc_html__( 'Icon', 'text-domain' ),
                ],
                [
                    'id'   => $prefix . 'image',
                    'type' => 'text',
                    'name' => esc_html__( 'Image', 'text-domain' ),
                ],
            ],
            'table'        => 'endowments',
            'storage_type' => 'custom_table',
        ];
    
        return $meta_boxes;
    }

    I have also checked that database table field I am editing allows null.

    There is also no PHP error.

    What else can I check?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #23975
    Long Nguyen
    Moderator

    Hi,

    I'm going to check it out and let you know later.

    Thank you.

    #24023
    Long Nguyen
    Moderator

    Hi,

    Please update the new version of MB Custom Table 1.1.12 to update an empty field.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.