{"action":"created","issue":{"url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads/issues/4834","repository_url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads","labels_url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads/issues/4834/labels{/name}","comments_url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads/issues/4834/comments","events_url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads/issues/4834/events","html_url":"https://github.com/easydigitaldownloads/easy-digital-downloads/issues/4834","id":167835559,"number":4834,"title":"Login Shortcode - redirect to purchase_history_page","user":{"login":"kiarashi","id":7079137,"avatar_url":"https://avatars.githubusercontent.com/u/7079137?v=3","gravatar_id":"","url":"https://api.github.com/users/kiarashi","html_url":"https://github.com/kiarashi","followers_url":"https://api.github.com/users/kiarashi/followers","following_url":"https://api.github.com/users/kiarashi/following{/other_user}","gists_url":"https://api.github.com/users/kiarashi/gists{/gist_id}","starred_url":"https://api.github.com/users/kiarashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiarashi/subscriptions","organizations_url":"https://api.github.com/users/kiarashi/orgs","repos_url":"https://api.github.com/users/kiarashi/repos","events_url":"https://api.github.com/users/kiarashi/events{/privacy}","received_events_url":"https://api.github.com/users/kiarashi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads/labels/Bug","name":"Bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads/milestones/133","html_url":"https://github.com/easydigitaldownloads/easy-digital-downloads/milestones/2.6.6","labels_url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads/milestones/133/labels","id":1758591,"number":133,"title":"2.6.6","description":null,"creator":{"login":"pippinsplugins","id":1034109,"avatar_url":"https://avatars.githubusercontent.com/u/1034109?v=3","gravatar_id":"","url":"https://api.github.com/users/pippinsplugins","html_url":"https://github.com/pippinsplugins","followers_url":"https://api.github.com/users/pippinsplugins/followers","following_url":"https://api.github.com/users/pippinsplugins/following{/other_user}","gists_url":"https://api.github.com/users/pippinsplugins/gists{/gist_id}","starred_url":"https://api.github.com/users/pippinsplugins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pippinsplugins/subscriptions","organizations_url":"https://api.github.com/users/pippinsplugins/orgs","repos_url":"https://api.github.com/users/pippinsplugins/repos","events_url":"https://api.github.com/users/pippinsplugins/events{/privacy}","received_events_url":"https://api.github.com/users/pippinsplugins/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":0,"state":"open","created_at":"2016-05-10T18:57:40Z","updated_at":"2016-07-28T09:46:14Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-07-27T11:52:10Z","updated_at":"2016-07-28T09:47:57Z","closed_at":null,"body":"Users that use the` edd_login` gets redirected to the purchase history page, \r\nregardless of whether a login redirect page is selected in the admin area.\r\n\r\nedd/includes/shortcodes.php\r\n\r\n```\r\nfunction edd_login_form_shortcode( $atts, $content = null ) {\r\n\t$redirect         = home_url();\r\n\t$purchase_history = edd_get_option( 'purchase_history_page', 0 );\r\n\r\n\tif ( ! empty( $purchase_history ) ) {\r\n\t\t$redirect = get_permalink( $purchase_history );\r\n\t}\r\n\r\n\textract( shortcode_atts( array(\r\n\t\t\t'redirect' => $redirect\r\n\t\t), $atts, 'edd_login' )\r\n\t);\r\n\r\n\tif ( empty( $redirect ) ) {\r\n\t\t$redirect = get_permalink( edd_get_option( 'login_redirect_page', '' ) );\r\n\t}\r\n\r\n\treturn edd_login_form( $redirect );\r\n}\r\nadd_shortcode( 'edd_login', 'edd_login_form_shortcode' );\r\n```\r\n\r\nAs far as I know, `purchase_history_page` is required in the backend. But if this is set, we can't use `login_redirect_page`.  Or am I wrong?\r\nIf possible, also add a filter so developers can tweak the $redirect as well.\r\n"},"comment":{"url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads/issues/comments/235849938","html_url":"https://github.com/easydigitaldownloads/easy-digital-downloads/issues/4834#issuecomment-235849938","issue_url":"https://api.github.com/repos/easydigitaldownloads/easy-digital-downloads/issues/4834","id":235849938,"user":{"login":"chriscct7","id":1324637,"avatar_url":"https://avatars.githubusercontent.com/u/1324637?v=3","gravatar_id":"","url":"https://api.github.com/users/chriscct7","html_url":"https://github.com/chriscct7","followers_url":"https://api.github.com/users/chriscct7/followers","following_url":"https://api.github.com/users/chriscct7/following{/other_user}","gists_url":"https://api.github.com/users/chriscct7/gists{/gist_id}","starred_url":"https://api.github.com/users/chriscct7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriscct7/subscriptions","organizations_url":"https://api.github.com/users/chriscct7/orgs","repos_url":"https://api.github.com/users/chriscct7/repos","events_url":"https://api.github.com/users/chriscct7/events{/privacy}","received_events_url":"https://api.github.com/users/chriscct7/received_events","type":"User","site_admin":false},"created_at":"2016-07-28T09:47:57Z","updated_at":"2016-07-28T09:47:57Z","body":"The current shortcode uses the priority (top being most priority):\r\n- Redirect param on shortcode if set\r\n- Purchase confirmation page\r\n- Home URL\r\n\r\nIn the current iteration, $redirect is never empty by the time we check for the login redirect page, so it's never used\r\n\r\nThe code above correctly does\r\n- Redirect param on shortcode if set\r\n- Login redirect page\r\n- Purchase confirmation page\r\n- Home URL\r\n"}}
{"actor":{"display_login":"chriscct7"}}