Custom field blank in backend - present in frontend

Support Meta Box AIO Custom field blank in backend - present in frontend

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38173
    ChrisChris
    Participant

    Hello.

    First of all, thank you for this nice toolbox.

    Now, I am a little disappointed that when choosing the type "number" there are no options on how to store or get the field data in a certain way (number formatting) - That is strange as it's fairly easy to implement it. However, I figured that you can manually do that via sanitization callback, adding a filter.

    But then, after sanitizing a custom field according to https://docs.metabox.io/sanitization/ I get the desired result at the frontend but the custom field value in the backend is empty in that case. That shouldn't be the case and to make it worse, if one needs to edit that pages content and stores it, it will delete the value (field is empty)... that is inacceptable to be used for me as my clients would ruin the output regularly.

    #38176
    Long NguyenLong Nguyen
    Moderator

    Hi,

    It looks like you are using the sanitization callback to add dots or commas to the number value and save it to the database. Then the field value is not a number, it will be a string/text and in the backend, the value will not display in the field appearance.

    Please use the field text to format the number value in both backend and frontend. Or use the custom field type multimask that is created by an expert Meta Box user https://github.com/badabingbreda/field-text-multimask

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