• Resolved badabingbreda

    (@badabingbreda)


    I’m desperately trying to export a website from one host to another and need to access the custom avatars that are uploaded to the users in Starbox.

    Is there a function that I can use to get me the url to the site’s uploads directory for each user that has added a custom image?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Calin Vingan

    (@calinvingan)

    Hi @badabingbreda, you can use a backup plugin to move the website content or if you want to do it manually, copy the line abh_options from the table wp_options and the /wp-content/uploads/gravatar directory.

    This should do it.

    Thread Starter badabingbreda

    (@badabingbreda)

    Hi Calin, thanks for that. There must be some reason for why it’s stored in wp_options table but I wouldn’t really have thought to look there, mainly because all users seem to have custom fields connected as well.

    I’ll be able to add an export callback to my WP All Exports plugin that tries to match the userid to a corresponding named array value to fetch me the image name. So thanks for your swift help.

    Thread Starter badabingbreda

    (@badabingbreda)

    In case anyone else would ever need it, I guess there’s no harm in sharing the code used by WP All Export (set it to use ID as the value and ‘export the value returned by a php function’, then point to following functionname):

    function return_abh_gravatarurl($value) {
            // get the obh_options from wp_options table
    	$abh = json_decode(get_option( 'abh_options' ));
            // reset the $value so we get the abh_author{value} property
    	$value = 'abh_author' . $value;
    	if (property_exists($abh , $value)) {
    		if (property_exists($abh->{$value}, 'abh_gravatar')) { 
    			return _ABH_GRAVATAR_URL_ . $abh->{$value}->abh_gravatar;
    	} 
    
    	}
    		return null;
    }
    • This reply was modified 3 years, 10 months ago by badabingbreda.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Export Custom Avatar’ is closed to new replies.