Number field with value of "0" returns empty

Support MB Beaver Builder Integration Number field with value of "0" returns emptyResolved

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #32485
    Craig PatersonCraig Paterson
    Participant

    Hi there,

    I have created a numeric field called "dogs" which I want to use to display how many dogs are allowed to stay in a property. When I enter 1, 2, 3 etc it works perfectly well, but when I enter 0 (zero), the field shows as empty when rendered on the front end.

    I am using the following shortcode – [wpbb post:meta_box field='dogs']

    I have tried changing the field to a Text field, but the issue is the same.

    #32488
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I do not see that issue on my end, screen record https://www.loom.com/share/84889eba6ec74469ae2c786f1bdbdce6

    #32490
    Craig PatersonCraig Paterson
    Participant

    Hi,

    Thanks for showing me it working at your end. I have recorded a video showing what is happening at my end. I am using the shortcode in a Beaver Themer Layout, so I don’t know if that is the issue.

    https://cln.sh/x397KIFEqr76cLdTfwRd

    WordPress: 5.8.2
    Beaver Builder: 2.5.0.2
    Beaver Themer: 1.4
    MetaBox: 5.4.8
    MetaBox AIO: 1.15.2

    #32495
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I'm using
    Beaver Builder Pro: 2.2.6.1
    Beaver Themer: 1.2.1.1

    Using the shortcode to get the post meta value might not need Meta Box. You can try to contact Beaver support to ask for help with this case.

    #32496
    Craig PatersonCraig Paterson
    Participant

    Hi,

    I have already made contact with BB, as the same issue happens with Advanced Custom Fields using Beaver Themer 1.4. If I change to Beaver Themer 1.3.3.1, everything works as it should.

    Thank you for your guidance and help.

    Best regards,
    Craig

    #32519
    Craig PatersonCraig Paterson
    Participant

    I have received info from the Beaver Builder team that they have added "better expression support in Beaver Themer 1.4", so this means that in a number field, 1 = True and 0 = False.

    They now recommend the following for displaying the 0 instead of returning false…

    [wpbb-if post:meta_box type='number' name='number_dogs' exp='not_equals' value='']
    [wpbb post:meta_box type='number' name='number_dogs']
    [wpbb-else]
    0
    [/wpbb-if]

    Just thought I would share that in case anyone else requires it.

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