Data in cloneable group not saving
- This topic has 6 replies, 2 voices, and was last updated 3 years, 3 months ago by
Long Nguyen.
-
AuthorPosts
-
December 28, 2021 at 11:46 PM #32897
Kenneth Lang
ParticipantHello,
I've been working with MetaBox Group to have a group of 3 cloneable admin fields, and it's working great. I figured out how to have an existing taxomony on the site, called "group_presenters", appear in a dropdown within the MetaBox Group. Here's the code I used in functions.php:
<div>
array(
'name' => 'Speaker',
'id' => 'group_presenters',
'title' => 'Group Presenter',
'type' => 'taxonomy',
'taxonomy' => 'group_presenters',
'multiple' => true,
'ajax' => true,
</div>The dropdown of the existing taxonomy is showing properly in the MetaBox Group on the admin page, and you can choose items from the list, but it's not saving that data once you update the page. Do we have to do something in the database so the data gets saved? What's wrong here? Thank you for your help!
December 29, 2021 at 7:59 AM #32902Long Nguyen
ModeratorHi,
Please refer to this topic to use the field
taxonomy_advanced
https://support.metabox.io/topic/not-show-taxonomy-field-values-in-mb-blocks/December 30, 2021 at 4:00 AM #32914Kenneth Lang
ParticipantThank you - worked perfectly!
A follow up question. In each cloneable group's data, we have a date for each cloned group, and we want to delete old dates and their associated objects once the date has passed. How can we write a cron job to do that? My programmer is good at that sort of thing but wasn't sure how to do it because it's not a straightforward table due to the cloned elements. How can we accomplish this? Thank you!
December 30, 2021 at 4:58 PM #32927Long Nguyen
ModeratorHi,
You can follow this documentation to get the subfield value in a group https://docs.metabox.io/extensions/meta-box-group/#getting-sub-field-values
and this documentation to create a cronjob in WordPress site https://developer.wordpress.org/reference/functions/wp_schedule_event/
December 31, 2021 at 7:57 AM #32943Kenneth Lang
ParticipantThank you - could you be more specific with how we can set up a cron job to remove a MetaBox cloned group once the date in it has passed? There are 4 pieces of data in each cloned group, and the first is an upcoming date, so we need the whole cloned group to be removed via a cron job once the date has passed. Thank you for any help you can lend with this.
January 4, 2022 at 3:47 AM #32974Kenneth Lang
ParticipantHi, happy new year. I'm submitting this again in case it got lost in the end-of-the-year shuffle. Thank you.
Thank you - could you be more specific with how we can set up a cron job to remove a MetaBox cloned group once the date in it has passed? There are 4 pieces of data in each cloned group, and the first is an upcoming date, so we need the whole cloned group to be removed via a cron job once the date has passed. Thank you for any help you can lend with this.
January 4, 2022 at 12:36 PM #32982Long Nguyen
ModeratorHi,
You can refer to this topic to know how to update the group value or delete a cloneable in a group https://support.metabox.io/topic/replace-array-value-in-group/
Then contact your developer to create the cronjob.Or create a service request here https://metabox.io/contact/
I will forward it to our development team, estimate the job, and get back to you with a quote. -
AuthorPosts
- You must be logged in to reply to this topic.