Adding Custom Fields to the Broadcast
-
Hey there,
I’m working with a tricky situation where the child sites might have MORE data in an ACF repeater field than the parent site broadcasting information down. In doing so, we’re trying to preserve any data on the child site on broadcast, but allow the parent fields to broadcast down. To do this, we’ve setup a hidden ACF field that holds a unique ID that is only set on the parent. If the child doesn’t have this ID, we know it is unique to the child and should be preserved.
The issue is, I’m hooking into threewp_broadcast_broadcasting_modify_post to modify the post_custom_fields within the broadcast data ($action->broadcasting_data->post_custom_fields).
Doing the following to modify a known field value works:
$action->broadcasting_data->post_custom_fields[‘topic_0_topic_title’] = ‘TEST’;The child gets the title ‘TEST’ and the parent still has the original title.
However, if I loop through the child fields and add the added fields to the post_custom_fields array (along with their ACF field key ‘_topic_4_topic_text’ = field_5452b42467f6a), the child doesn’t seem to keep the data.
I’ve confirmed the $action->broadcasting_data->post_custom_fields contains all of the fields as expected.
Is there something else that needs to be updated to make this work? Any advice/help would be greatly appreciated! If you need more details or clarification, please let me know.
Broadcast Version: 16
Blog Groups Version: 16
Premium Pack Version: 16Much appreciated!
Justin
- The topic ‘Adding Custom Fields to the Broadcast’ is closed to new replies.