Custom Fields
Support Meta Box Group Date picker when cloned adds data when it shouldn't

  • Creator
  • #9495

    Using date picker in a cloneable group with timestamp set to true results in the field being saved as array(1) { ["timestamp"]=> string(1) "0" }, even if the user hasn't entered any data in the field. You can see it on a var_dump of a cloneable field, which is how I noticed it.

    If timestamp => true is not set, the field works normally, and doesn't get saved to the database.

Viewing 1 replies (of 1 total)
  • Author
  • #9516
    Anh Tran


    When the timestamp is set to true, the date/datetime field will store values as an array in a group. This array contains 2 elements:

    • timestamp: the Unix timestampt
    • formatted: the formatted (user-entered) value

    This is a difference between a single date/datetime field, which stores only timestamp value.

    So, when you get the value from this field, please check both values.

    Here is the video that demonstrates how the data is saved:

    View post on

Viewing 1 replies (of 1 total)
  • The topic ‘Date picker when cloned adds data when it shouldn't’ is closed to new replies.