There is a native WordPress function to do exactly what it sounds like you’re trying to do.
You need to replace
userphoto_thumbnail($user_info, $before="", $after="", $attributes = array(width => '40', height => '40'), $default_src="")
with
get_avatar($user_info->ID,40)
Check here for your future reference – http://codex.wordpress.org/Function_Reference/get_avatar
Related Posts:
- Consuming an external API in WordPress?
- How can I import a class privately into a plugin?
- How to Loop Plugin Option Field Set?
- How can I execute some small piece of PHP code in a sandbox area of my WP?
- How to Create a Directory in a Plugin Folder?
- Activating a single plugin via php
- Create plugin that works in background
- Checking for user role in a custom plugin
- Is it possible to filter the wp_footer() scripts, read the content, and insert them inline?
- HELP: Integrating WP with raw PHP code once published button is hit
- Loading class files via autoload method
- plugins_url() incorrectly returns a url with www subdomain
- How to redirect Old Post URL to new Post and keep Old post Comments?
- Modifying Footnote Plugin for Descriptive Title Attributes
- I would like to use create a function in my custom plugin to tell WP to use a different header
- Getting media library popup in custom plugin admin page
- How to add pagination to wpbakery grid?
- jQuery function didn’t work in my plugin
- bulk change of image setting “link to” to “link to: image url “
- Why wp_mail() function isn’t sending any emails and displaying ‘0’ in Chrome ‘Network’ response
- Make id column as AUTO INCREMENT on plugin activation
- How can I display a contact form for out of stock products in WooCommerce?
- How to get number of Affected rows from wordpress dbDelta() function
- Sending email from inside a plugin using PHP PEAR
- Notepad sticky plugin
- WooCommerce Custom Product to checkout
- Adding an Options Page to a Plugin
- How do I “get the next 10 posts after post_id == x”?
- How to simultaneously access the same MySQL database in the main column and sidebar of WordPress?
- Error with Image Slide plug-in/ s3slider in WP
- Changing “elapsed time” to “time remaining” on MP3-jPlayer audio player with CSS or PHP changes
- Customizing NEXTGEN Gallery To link images to pages
- WooCommerce specifc variations for specific user role [closed]
- Nested shortcode functions accessing variable
- Ability to automatically redirect a URL
- Passing Page ID used in Meta Box Creation to JavaScript
- Activate my plugins via FTP
- Is wp-app.php or wp-apps.php needed for WordPress?
- How to add apply_filter for a class property in plugin
- Warning: Use of undefined constant list_all – assumed ‘list_all’ (this will throw an Error in a future version of PHP)
- How to distinguish if a plugin is not installed or just not active
- JavaScript in a PHP plugin
- Checking the count within a foreach loop
- A server-side hook failed when committing plugin code to SVN
- Content-Security-Policy Headers are there and showing the correct settings, but still getting a refused connection
- Need to replace Currency Shortforms
- Api external with wordpress
- How to delete all categories programatically?
- How to use custom Javascript code inside a plugin?
- How to use printf to output two links?
- Using meta_query in a WP_Query not working for numbers properly
- File Uploader – Upload without adding to Media Library
- Building a plugin into a theme
- 2 wordpress site same database
- How to redirect to a page after the form is submitted
- Trying to include files in plugin isn’t working
- Searching a tab/space delimited text file based upon form criteria and returning a ‘record’ into a word press results page
- How to makes changes on the shop/category/tag pages but not on the product pages in woocommerce?
- implement custom roles in custom plugin
- How to get current cart values using WC_Shortcodes?
- How to authorize viewing and clicking a function only logged users?
- WordPress is redirecting me to homepage
- How can we get this dynamically as this folder may not be by the same name always → wp-admin
- Cant create table on plugin activation
- How to arrange custom posts in the backend/admin by custom taxonomy
- Redirect to a page while maintaining search query parameters without causing an infinite loop
- How to ignore fields if empty?
- Why is my shortcode not working?
- Getting Fatal error: Uncaught Error: Call to undefined function plugin_dir_path() when linking to another file within my wordpress plugin
- the content of the uploads folder gets deleted periodically, how to figure out what causes it?
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- Moving a few select DB tables to a new WP instance
- implement checkbox or toggle switch in plugin code
- Custom Field used to allow a Free Story; no longer works
- How to send new visitor to a splash page for only one time in wordpress?
- WordPress User profile with Avatar upload on the front end without plugin?
- How to get the total count of Favorite/Favorited authors
- Admin login substantially slower on production server
- redirect to a custom page
- Can i add custom code in Source in specific page, Header from function.php?
- GET web api method from a WordPress PHP script
- How to change text in a page by utilizing a custom user id?
- Adding link on title its in description but not in title see screenshots attached
- How can I insert a record into a custom table from my custom form in my custom admin page?
- How to save information related to post in database?
- Save selectlist value (taxonomy) in wp:wp_set_object_terms
- Page doesn’t load
- Metabox Data not saving
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Xml output not places where i want
- Load my plugin before cache
- wp_insert_post() get Fatal Error from Plugin
- Move related products after product summary? [closed]
- Adminimize Plugin — Is there an alternative to limiting Editor to ‘Appearance > Widgets’ only?
- Is there a visual editor specifically for page snippets/sections?
- Visual Composer Data Source?
- Woocommerce disable checkout on specific day
- TML Theme My Login Plugin
- How to debug periodic performance issue
- Foreach retun in shortcode