Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment