If you’re ok with the public seeing your list of groups you could show the field in the plugin settings and use JavaScript to check the boxes you want.
I’ve been looking for a way to do this without showing the field, and I’ve enabled it by making a simple edit to the plugin file and inserting hidden inputs.
in mailchimp.php
, at line 1201, it checks if the field is being shown:
if (get_option('mc_show_interest_groups_'.$ig['id']) == 'on') {
comment out this line, along with its closing bracket (line 1237), and add a case for hidden fields to be processed the same way as checkboxes.
Insert the following above the line case 'checkboxes':
:
case 'hidden':
Now, you can add hidden inputs that get processed the same way as checkboxes:
<input type="hidden" name="group[#][]" value="Group Name"/>
Where # is the group’s ID and the value is the name of the group. I used the Sub-header Content field to insert the hidden input, since it’s rendered inside the <form>
tag.