Skip to content

Instantly share code, notes, and snippets.

@DavidWells
Last active December 24, 2015 15:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidWells/6818344 to your computer and use it in GitHub Desktop.
Save DavidWells/6818344 to your computer and use it in GitHub Desktop.
Add additional Lead Fields to WordPress Lead Profiles for WordPress Leads Plugin http://wordpress.org/plugins/leads/
<?php
/**
* Add in custom lead fields to WordPress Leads Plugin
*
* This function adds additional fields to your lead profiles. Insert this code into functions.php of your theme
* Label: Name of the Field
* key: Meta key associated with data
* priority: Where you want the fields placed. See https://github.com/inboundnow/leads/blob/master/modules/wpl.m.userfields.php#L7 for current weights
* type: type of user area. 'text' or 'textarea'
*/
add_filter('wp_leads_add_lead_field', 'custom_add_more_lead_fields', 10, 1);
function custom_add_more_lead_fields($lead_fields) {
$new_fields = array(
array(
'label' => 'Upper Company',
'key' => 'wpleads_upper_company',
'priority' => 18,
'type' => 'text'
),
array(
'label' => 'Lead Source',
'key' => 'wpleads_lead_source',
'priority' => 19,
'type' => 'text'
),
array(
'label' => 'Description',
'key' => 'wpleads_description',
'priority' => 19,
'type' => 'textarea'
)
);
foreach ($new_fields as $key => $value) {
array_push($lead_fields, $new_fields[$key]);
}
return $lead_fields;
}
@tsanders42
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment