Mark
Forum Replies Created
-
Forum: Plugins
In reply to: [Invoice King Pro] PDF email not workingbtw Thankz for the update!
I do seem to edit my last post, but not my first.Forum: Plugins
In reply to: [Invoice King Pro] PDF email not workingOops.. No option for editing anymore… Any tips?
Small correction:
– remove the ‘Echo’ command from the Foreach loop. =)
Now to resolve the saving of the taxonomy terms to the user profile!!
Hi, take a look at this solution:
https://www.ads-software.com/support/topic/plugin-gravity-forms-custom-post-types-custom-user-taxonomies?replies=3#post-3038896Fixed!
– Add the code below to the functions.php file.
– Create a User object taxonomy. (eq. ‘Professions’)
(with help from: justintadlock.com)
– Now map the User Meta in the User Registation Add-on:
‘Professions’ -> (Drop Down field – populated by a taxonomy)
– The new function will now loops through all User meta. If a User meta keyname corresponse with a taxonomy name, the values are mapped.Ps. this solution does not support multi term selection (yet)
Good luck!
// Hook Gravity Forms user registration -> Map taxomomy function map_taxonomy($user_id, $config, $entry, $user_pass) { global $wpdb; // Get all taxonomies $taxs = get_taxonomies(); // Get all user meta $all_meta_for_user = get_user_meta($user_id); // Loop through meta data and map to taxonomies with same name as user meta key foreach ($all_meta_for_user as $taxonomy => $value ) { if (in_array ($taxonomy, $taxs) ) { // Check if there is a Taxonomy with the same name as the Custom user meta key // Get term id $term_id = get_user_meta($user_id, $taxonomy, true); If (is_numeric($term_id)) { // Check if Custom user meta is an ID Echo $taxonomy.'='.$term_id.'<br>'; // Add user to taxomomy term $term = get_term( $term_id, $taxonomy ); $termslug = $term->slug; wp_set_object_terms( $user_id, array( $termslug ), $taxonomy, false); } } } } add_action("gform_user_registered", "map_taxonomy", 10, 4);
Hi snails07, did you find a solution yet?
Having the same needs.Kind regards