Skip to main content
6 events
when toggle format what by license comment
Mar 28, 2019 at 12:11 comment added Rup You could modify the existing code to be a get_avatar_data or get_avatar_url filter instead, and call get_avatar_url in PHP. (Just to be clear: this is more work than just changing the add_filter call.) Or just wrap a call to get_avatar_url with a little of your own code: all you're doing is fetching the user object and checking if it has a non-empty user_url property, and if it does using that instead of the default URL.
Mar 28, 2019 at 11:29 comment added Jason Is My Name I can get JS to do this. I would have just liked it to all be handled by php ideally
Mar 28, 2019 at 11:20 comment added Krzysiek Dróżdż This part won't be so easy... The custom function doesn't change the URL and it doesn't return the URL itself. So you would have to write your custom function that will do that.
Mar 28, 2019 at 11:09 comment added Jason Is My Name We are super close. You're correct in how it works and how to call it. However, I need to return just the url, I currently if echo'ing it out will get the full img tag. Are we able to cut just the url for the avatar out please?
Mar 28, 2019 at 11:03 comment added Jason Is My Name I think you may have hit the nail on the head here pal! Beautifully worded too.
Mar 28, 2019 at 10:59 history answered Krzysiek Dróżdż CC BY-SA 4.0