Custom Fields
Re-Envisioned
Support General Empty fields and postmeta records with default values

  • Creator
    Topic
  • #10053
    GrupoADSLZone
    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?.

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #10075
    GrupoADSLZone
    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 1 replies (of 1 total)
  • You must be logged in to reply to this topic.