Last active
December 24, 2015 15:09
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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
The url https://github.com/inboundnow/leads/blob/master/modules/wpl.m.userfields.php#L7 doesn't seem to be correct. Did it move?