• Resolved furat2012

    (@furat2012)


    yesterday my website giving me white-screen
    drjumana.com

    after looking inside the error.log
    i found this line
    [24-Apr-2015 10:28:51 UTC] PHP Fatal error: Cannot redeclare get_avatar_url() (previously declared in /home/jumanajfc/public_html/wp-includes/link-template.php:3414) in /home/jumanajfc/public_html/wp-content/themes/quadrum-theme/functions/filters.php on line 155

    actually I don’t know my wordpress version, the filters.php file which contain the line 155 is like the following

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    unction get_avatar_url($get_avatar){
        if(preg_match("/src='(.*?)'/i", $get_avatar, $matches)) {
        	preg_match("/src='(.*?)'/i", $get_avatar, $matches);
       		return $matches[1];
        } else {
        	preg_match("/src=\"(.*?)\"/i", $get_avatar, $matches);
       		return $matches[1];
        }
    }

    any help plz

Viewing 10 replies - 1 through 10 (of 10 total)
  • Same problem here. After WordPress got updated to 4.2 I got this error and don’t know how to fix it please help.

    Fatal error: Cannot redeclare get_avatar_url() (previously declared in /home2/victory/public_html/wp-includes/link-template.php:3414) in /home2/victory/public_html/wp-content/themes/ninezeroseven/functions.php on line 807

    coding:
    function get_avatar_url($get_avatar){
    preg_match(“/src='(.*?)’/i”, $get_avatar, $matches);
    return $matches[1];
    }

    Thread Starter furat2012

    (@furat2012)

    you can just remove the code related to avatar

    I did this and the site work again

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Someone did, and they posted a fix too. πŸ˜‰

    Give this a read.

    https://ww.wp.xz.cn/support/topic/read-this-first-%e2%80%93-wordpress-42-master-list?replies=5&view=all#post-6860958

    See the part that says “Fatal Error with Cannot redeclare get_avatar url()”, follow those instructions.

    I had the same problem yesterday with the 4.2.1 update.
    I only commented the function in the functions.php file and everything go back to normality.

    Thank you Jan Dembowski, your post was the most useful.

    Look into your functions.php file in your theme and delete these lines

    // get gravatar URL
    	function get_avatar_url( $get_avatar ) {
    	    preg_match("/src='(.*?)'/i", $get_avatar, $matches);
    	    return $matches[1];
    	}

    Hi Rafal. Thank you so much. It really helped me fix the bug. πŸ™‚ Great help!

    THANKS A LOT!!! This really helped and WORKED! I’ve just commented on the lines :

    /*function get_avatar_url($get_avatar){
    preg_match(“/src='(.*?)’/i”, $get_avatar, $matches);
    return $matches[1];
    }*/

    And VOI-LA! Website back on track !!!
    Cheers!

    Thanks for the post rafadizeo. The get_avatar code line which caused my issues in the function.php file read like:

    function get_avatar_url( $id_or_email, $args = null ) {
    	$args = get_avatar_data( $id_or_email, $args );
    	return $args['url'];
    }

    and I changed to:

    /*function get_avatar_url( $id_or_email, $args = null ) {
    	$args = get_avatar_data( $id_or_email, $args );
    	return $args['url'];
    }*/

    Everything seems to working ok since the change, and I can access my website again. Happy days πŸ™‚

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Fatal Error: Cannot redeclare get_avatar_url()’ is closed to new replies.