Closed rasmustaarnby closed 8 years ago
I initially just used the sanitize
method and update_post_meta
but realized that it probably the wrong place to save data and that it would only support post objects. I have now placed the functionality in it's own method and are using the cmb2_save_field
, where I have the whole field object and thus access to all required data for actions, objects and values.
Just realized you might want to wait with the pull request till version 2.2.0 of CMB2 is out. I'm relying on a hook that's not introduced until that version.
By splitting the values and saving them as separate meta values, the start date and end date can be used to sort and filter the posts in WP_Query.