Hi Guys,
We had the same issue. Problem is that Gravity Forms uploads its images in a separated folder, not wanting to contaminate the media library with uploads via forms. A noble idea but that creates a problem with this plugin as the get_cupp_meta() function only checks for images that are in the media library. So when using Gravity Forms User Registration, Gravity Forms actually does update the correct meta values but the get_cupp_meta cannot find the image and will return your gravatar image or blank.
So what you need to do it hook into the Gravity Forms after submit hook and run a sideload to put the image into the media library and update the cupp meta values. This way get_cupp_meta() can find the image and will return the correct URL.
Example code:
add_action( 'gform_after_submission, 'gf_process_user_update', 10, 2 );
function gf_process_user_update( $entry, $form ) {
foreach ( $form['fields'] as &$field ) :
if ( strpos( $field->cssClass, 'gform_user_photo' ) !== false ) :
if ( !empty( $entry[$field->id] ) ) :
if ( !function_exists('media_handle_upload') ) {
require_once(ABSPATH . "wp-admin" . '/includes/image.php');
require_once(ABSPATH . "wp-admin" . '/includes/file.php');
require_once(ABSPATH . "wp-admin" . '/includes/media.php');
}
$new_photo_url = $entry[$field->id];
$new_photo_src = media_sideload_image( $new_photo_url, 0, null, 'src' );
if ( !is_wp_error( $new_photo_url ) ) :
global $current_user;
get_currentuserinfo();
update_user_meta( $current_user->ID, 'cupp_meta', '' );
update_user_meta( $current_user->ID, 'cupp_upload_meta', $new_photo_src );
update_user_meta( $current_user->ID, 'cupp_upload_edit_meta', '' );
endif;
endif;
endif;
endforeach;
}