WordPress.org

Ready to get started?Download WordPress

Forums

Social Author Bio
[resolved] Error in google_avatar function (2 posts)

  1. robertmeffe
    Member
    Posted 1 year ago #

    If you have "allow_url_fopen = 0" when viewing your author page you will get an error.

    I updated the function as follows if you want to commit it.

    function google_avatar( $id ) {
    		if(ini_get('allow_url_fopen') == 1)
    		{
    			$headers = get_headers("https://profiles.google.com/s2/photos/profile/".$id."?sz=48", 1);
    			$PicUrl = $headers['Location'];
    		} else {
    			$curl = curl_init();
    			curl_setopt_array( $curl, array(CURLOPT_RETURNTRANSFER => true,	CURLOPT_URL => "https://profiles.google.com/s2/photos/profile/".$id."?sz=48" ) );
    			curl_exec( $curl );
    			$response_code = curl_getinfo( $curl, CURLINFO_EFFECTIVE_URL );
    			curl_close( $curl );
    		}
    		return $PicUrl;
    	}

    http://wordpress.org/extend/plugins/social-autho-bio/

  2. Nick Powers
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks! I'll add that to the next upcoming version.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.