{"action":"created","issue":{"url":"https://api.github.com/repos/3five/Custom-User-Profile-Photo/issues/2","repository_url":"https://api.github.com/repos/3five/Custom-User-Profile-Photo","labels_url":"https://api.github.com/repos/3five/Custom-User-Profile-Photo/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/3five/Custom-User-Profile-Photo/issues/2/comments","events_url":"https://api.github.com/repos/3five/Custom-User-Profile-Photo/issues/2/events","html_url":"https://github.com/3five/Custom-User-Profile-Photo/issues/2","id":169166554,"number":2,"title":"Gravity forms enhancement.","user":{"login":"Vinsanity","id":766503,"avatar_url":"https://avatars.githubusercontent.com/u/766503?v=3","gravatar_id":"","url":"https://api.github.com/users/Vinsanity","html_url":"https://github.com/Vinsanity","followers_url":"https://api.github.com/users/Vinsanity/followers","following_url":"https://api.github.com/users/Vinsanity/following{/other_user}","gists_url":"https://api.github.com/users/Vinsanity/gists{/gist_id}","starred_url":"https://api.github.com/users/Vinsanity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vinsanity/subscriptions","organizations_url":"https://api.github.com/users/Vinsanity/orgs","repos_url":"https://api.github.com/users/Vinsanity/repos","events_url":"https://api.github.com/users/Vinsanity/events{/privacy}","received_events_url":"https://api.github.com/users/Vinsanity/received_events","type":"User","site_admin":false},"labels":[{"id":418851964,"url":"https://api.github.com/repos/3five/Custom-User-Profile-Photo/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"Vinsanity","id":766503,"avatar_url":"https://avatars.githubusercontent.com/u/766503?v=3","gravatar_id":"","url":"https://api.github.com/users/Vinsanity","html_url":"https://github.com/Vinsanity","followers_url":"https://api.github.com/users/Vinsanity/followers","following_url":"https://api.github.com/users/Vinsanity/following{/other_user}","gists_url":"https://api.github.com/users/Vinsanity/gists{/gist_id}","starred_url":"https://api.github.com/users/Vinsanity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vinsanity/subscriptions","organizations_url":"https://api.github.com/users/Vinsanity/orgs","repos_url":"https://api.github.com/users/Vinsanity/repos","events_url":"https://api.github.com/users/Vinsanity/events{/privacy}","received_events_url":"https://api.github.com/users/Vinsanity/received_events","type":"User","site_admin":false},"assignees":[{"login":"Vinsanity","id":766503,"avatar_url":"https://avatars.githubusercontent.com/u/766503?v=3","gravatar_id":"","url":"https://api.github.com/users/Vinsanity","html_url":"https://github.com/Vinsanity","followers_url":"https://api.github.com/users/Vinsanity/followers","following_url":"https://api.github.com/users/Vinsanity/following{/other_user}","gists_url":"https://api.github.com/users/Vinsanity/gists{/gist_id}","starred_url":"https://api.github.com/users/Vinsanity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vinsanity/subscriptions","organizations_url":"https://api.github.com/users/Vinsanity/orgs","repos_url":"https://api.github.com/users/Vinsanity/repos","events_url":"https://api.github.com/users/Vinsanity/events{/privacy}","received_events_url":"https://api.github.com/users/Vinsanity/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-08-03T15:51:19Z","updated_at":"2016-12-08T07:36:57Z","closed_at":null,"body":"FROM HarroH on WordPress.org:\n\nHi Guys,\n\nWe 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.\n\nSo 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.\n\nExample code:\n`\nadd_action( 'gform_after_submission, 'gf_process_user_update', 10, 2 );\n\nfunction gf_process_user_update( $entry, $form ) {\n\n```\nforeach ( $form['fields'] as &$field ) :\n\n    if ( strpos( $field->cssClass, 'gform_user_photo' ) !== false ) :\n\n        if ( !empty( $entry[$field->id] ) ) :\n\n            if ( !function_exists('media_handle_upload') ) {\n\n                require_once(ABSPATH . \"wp-admin\" . '/includes/image.php');\n                require_once(ABSPATH . \"wp-admin\" . '/includes/file.php');\n                require_once(ABSPATH . \"wp-admin\" . '/includes/media.php');\n\n            }\n\n            $new_photo_url = $entry[$field->id];\n\n            $new_photo_src = media_sideload_image( $new_photo_url, 0, null, 'src' );\n\n            if ( !is_wp_error( $new_photo_url ) ) :\n\n                global $current_user;\n\n                get_currentuserinfo();\n\n                update_user_meta( $current_user->ID, 'cupp_meta', '' );\n                update_user_meta( $current_user->ID, 'cupp_upload_meta', $new_photo_src );\n                update_user_meta( $current_user->ID, 'cupp_upload_edit_meta', '' );\n\n            endif;`\n```\n"},"comment":{"url":"https://api.github.com/repos/3five/Custom-User-Profile-Photo/issues/comments/265673200","html_url":"https://github.com/3five/Custom-User-Profile-Photo/issues/2#issuecomment-265673200","issue_url":"https://api.github.com/repos/3five/Custom-User-Profile-Photo/issues/2","id":265673200,"user":{"login":"cleanforestco","id":653153,"avatar_url":"https://avatars.githubusercontent.com/u/653153?v=3","gravatar_id":"","url":"https://api.github.com/users/cleanforestco","html_url":"https://github.com/cleanforestco","followers_url":"https://api.github.com/users/cleanforestco/followers","following_url":"https://api.github.com/users/cleanforestco/following{/other_user}","gists_url":"https://api.github.com/users/cleanforestco/gists{/gist_id}","starred_url":"https://api.github.com/users/cleanforestco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cleanforestco/subscriptions","organizations_url":"https://api.github.com/users/cleanforestco/orgs","repos_url":"https://api.github.com/users/cleanforestco/repos","events_url":"https://api.github.com/users/cleanforestco/events{/privacy}","received_events_url":"https://api.github.com/users/cleanforestco/received_events","type":"User","site_admin":false},"created_at":"2016-12-08T07:36:57Z","updated_at":"2016-12-08T07:36:57Z","body":"Hey @jmichaelward, I am wondering if an update is still planned for this issue?"}}
{"actor":{"display_login":"cleanforestco"}}