Empty fields and postmeta records with default values

Support General Empty fields and postmeta records with default values

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10053
    GrupoADSLZoneGrupoADSLZone
    Participant

    Hi, I'm loading serveral fields and the plugin creates multiple records using default values ("0", "a:0:{}" ...). The same pattern was observed when data in field is deleted by user.

    ¿What can be done to ensure that no many records will be created with default (zero) values?.

    #10075
    GrupoADSLZoneGrupoADSLZone
    Participant

    add_filter("rwmb_group_value", function($new, $field, $old) {
    if ($new == [[]]) $new = '';
    return $new;
    });

    add_filter("rwmb_checkbox_value", function($new, $field, $old) {
    if ($new == '0') $new = '';
    return $new;
    });

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