Forums

[resolved] [Plugin: Profile Pic] Error Occurs when you do not select a field to show - SOLUTION INSIDE (2 posts)

  1. SangrelX
    Member
    Posted 2 years ago #

    When you edit your profile and you dont choose any boxes to display publicly it gives an error

    im sure people have seen this error...

    I am posting a fix for it

    incase this was posted already sorry.. but im to tired to read all these threads to see if its been posted

    profile-pic.php
    line 422

    Change THIS

    foreach ($raw_data as $key => $val) {
    		$reversed_data[$val] = $key;
    	}

    to THIS

    if (!empty($raw_data)){
    foreach ($raw_data as $key => $val) {
    		$reversed_data[$val] = $key;
    	}
    
    }

    This will make it CHECK to see if Raw_data has any options before attempting to setup the Foreach command etc..

    hope this helps someone.. I love this plugin and thank you for it. I have a heavily modified version I use on my own sites lol

    http://wordpress.org/extend/plugins/profile-pic/

  2. mrarrow
    Member
    Posted 1 year ago #

    Awesome!! I was getting exactly the same error and this code has sorted it! Many thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic