add_filter( 'wpmem_mc_merge', 'my_mc_merge_filter' ); function my_mc_merge_filter( $merge_vars ) { /* * The default merge_vars, first and last name come in * with the $merge_vars array. If you are adding to * the merge fields IN ADDITION TO those, you'll need * to consider that as you filter the array. * * Here is an example where I keep the existing merge * fields (first and last name) and add two additional * fields to that array. Note how I obtain the values * from the posted form data. */ $my_new_field = array( 'MC_MERGE_FIELD_1' => $_POST['wp-members-field-meta-key-1'], 'MC_MERGE_FIELD_2' => $_POST['wp-members-field-meta-key-2'], ); $my_new_merge = array_merge( $merge_vars, $my_new_field ); return $my_new_merge; }
Not sure what to do with this code?
You're not a "coder" and don't know what to do? Don't worry! Code Snippets are the basic building blocks of WordPress customization, and once you know the basics, they are simple to use.
Here are some free articles to get you started:
- Using Code Snippets from the Site
- The functions.php File
- Create a plugin file for custom functions
- Create a child theme
- Do not modify plugin files!
For "hands on" help, consider a plugin support subscription or the Pro Bundle.