-
Added a whole bunch of custom social profiles for users (artists) to add…
Text input type.
For some reason when you click on the icons of the user (next to the default facebook, twitter, etc. ones), the base url precedes it…mywebsite.com/www.socialprofile.com/my_social_profile_name…
Any ideas?
Thanks!
Hi Richard, do you mind to put the purchase code in your profile 🙂
I wonder if the problem lies with Path Compatibility?
The social profile value should have http:// to make the link correct. This is not required for facebook / twitter fields tho, as I made some filters to automatically convert it to correct link.
Sorry? 🙂 If I understand correctly, isn’t the problem with social field (custom social fields) value/url?
I added custom fields with text value.
User enters his URL as http://mixcloud.com/myprofile as always.
Link in button next to FB/Twitter by profile pic returns this link:
http://blankbookingagency.com/profile/maximus.petrus/www.mixcloud.com/maximus-petrus
Can you try to replicate it here in your profile, e.g. edit your facebook/twitter link so I can understand the problem?
It has nothing to do with facebook/twitter links. I setup new custom fields for user to add other social profile links.
Ok, I added the http://…works fine….now how to tell each user to not to forget? 🙂 Is there some kind of hook that can be added? 🙂
I did that for facebook/twitter.
See common-functions.php this function userpro_link_filter() for idea about doing the same thing for other social profiles. You can also use this in a custom hook that you do not need to update plugin files directly.
That hook allow you to change value BEFORE IT IS PRINTED TO FORM VIEW. e.g. if I want to change Male to “I am a Man”.. so the ide ais: just example, lets say we want to validate twitter field and pre-append the value with http, we can do this inside the function
// auto twitter
if ($key == ‘twitter’ && !strstr($value, ‘http’) ) {
$v = ‘http://’;
if (!strstr($value, ‘twitter’)){
$v .= ‘twitter.com/’;
}
$v .= $value;
return $v;
}If key is twitter, and does not have http, we add it.. that’s all
add_filter(‘userpro_before_value_is_displayed’, ‘userpro_custom_hook’, 9999, 4);
function userpro_custom_hook($value, $key, $array, $user_id){}
Okay, that’s a cool solution. In the meantime I have added placeholder http:// and help text “Must begin with http://”
which I guess does it too for now. 🙂
You must be logged in to reply to this topic.