When asked to do so, Broadcast will copy the custom fields of the post to the children. According to the WordPress Codex on custom fields, they are used to store meta-data about the post.
Normally all fields can be broadcasted without problems, but depending on which plugins are installed or your post workflow, you might want to handle some fields differently.
In the admin settings, Broadcast offers a custom field blacklist, a whitelist and a protect list. In these fields you can specify which fields you do not want broadcasted. If you do not want the fictional custom field post_coauthor
broadcast, just write its name in the blacklist, for example.
The fields also take wildcards: the fictional field above will be matched if you write *coauthor
or post_co*
.
The blacklist will prevent the specified fields from being broadcasted.
The whitelist acts as exceptions to the blacklist.
The protect list will broadcast custom fields to the child posts only if the field does not already exist on the child. It does not update existing custom fields. This requires that the child post already exists.
You’re going to have to show me a debug dump of the post in question in order for me to see what is going on.
how does it work with ACF field ?
ACF fields are handled by the ACF add-on.
Do you mean your WooCommerce products? You might want the WooCommerce add-on in that case.
Hello! How can I prevent all fields with product descriptions from being updated in child posts on a network of sites? So that only the price is updated when there is a change in the parent post. Please tell me? I couldn’t figure out which field name I needed to add to the rules.
Do you know the name of the custom field that contains the price?
Add it to the whitelist.
And then write * in the protect list.
That way, all fields except those in the whitelist will not be updated.
Thank you! I dont know the name of the custom field that contains the price. I tried adding different price names to the white sheet, but it didn’t work. My sites worked on WooCommerce. Can you tell me what exact price name needs to be added in the whitelist for this to work?
Try … _price ?
You can look at all of the custom fields using a Broadcast tool:
Admin > Broadcast > Maintenance tab > View post info
now when I update the second site it clears the data from the exclude field, why?
The blacklist will not broadcast the the custom field at all.
Perhaps the protect list is more to your liking, where it will broadcast the custom field but leave any existing values alone.
Can you please confirm that custom fields are broadcasting still when a post is updated? When we create a post, the custom fields broadcast fine, but when we update a post, the added/updated fields are not added or updated .. We are not protecting the custom field when we do this broadcast.
Thanks
Custom fields should be automatically updated (deleted, then recreated) during broadcasting.
Enabling Broadcast debug mode will tell you what is going on.
Example:
– main-site.com/team
– second-site.com/about/team
If I save the main site page, it updates the second site removing the parent and changing the url to second-site.com/team
I want to keep the structure I have for the second site
Tried adding post_parent at “settings/Custom field blacklist” but it didn’t work
Also tried bypass using broadcast_post_presave and broadcast_post_prepare_post but I think WPVIP is blocking it.
Help 😢
Since “Team” does not have a parent page set on the parent blog, Broadcast will try to reproduce that by removing the “About” parent.
There are two solutions: either custom code or using the Protect Child Properties add-on, that can specifically protect the parent post setting from being changed.
The custom code you write should be something like this:
– during the threewp_broadcast_broadcasting_after_switch_to_blog action
– retrieve the ID of the existing child (get_linked_child_on_this_blog, in the action -> broadcasting_data -> broadcast_data )
– retrieve the post
– save the post parent ID
– during threewp_broadcast_broadcasting_before_restore_current_blog
– replace the parent ID of the child post
The Protect Child Properties add-on does that, but in a lot more code since it can protect a lot more information.