{"action":"reopened","issue":{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/2707","labels_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/2707/labels{/name}","comments_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/2707/comments","events_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/2707/events","html_url":"https://github.com/easydigitaldownloads/Easy-Digital-Downloads/issues/2707","id":45570896,"number":2707,"title":"Reduce duplicate logic in admin-notices.php","user":{"login":"cklosowski","id":1390124,"avatar_url":"https://avatars.githubusercontent.com/u/1390124?v=3","gravatar_id":"","url":"https://api.github.com/users/cklosowski","html_url":"https://github.com/cklosowski","followers_url":"https://api.github.com/users/cklosowski/followers","following_url":"https://api.github.com/users/cklosowski/following{/other_user}","gists_url":"https://api.github.com/users/cklosowski/gists{/gist_id}","starred_url":"https://api.github.com/users/cklosowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cklosowski/subscriptions","organizations_url":"https://api.github.com/users/cklosowski/orgs","repos_url":"https://api.github.com/users/cklosowski/repos","events_url":"https://api.github.com/users/cklosowski/events{/privacy}","received_events_url":"https://api.github.com/users/cklosowski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/labels/Administration","name":"Administration","color":"E74C3C"},{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/labels/Enhancement","name":"Enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/milestones/81","html_url":"https://github.com/easydigitaldownloads/Easy-Digital-Downloads/milestones/2.3","labels_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/milestones/81/labels","id":824150,"number":81,"title":"2.3","description":"","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":10,"closed_issues":102,"state":"open","created_at":"2014-10-13T16:09:32Z","updated_at":"2015-03-06T21:22:05Z","due_on":"2015-03-06T06:00:00Z","closed_at":null},"comments":11,"created_at":"2014-10-12T05:40:37Z","updated_at":"2015-03-06T21:22:05Z","closed_at":null,"body":"Looking at the ```includes/admin/admin-notices.php``` file there is a TON of code duplication that could be simplified into a single call. I'm thinking a helper function like:\r\n\r\n```edd_show_admin_message()``` and you can provide 2 parameters:\r\n\r\n```\r\n$message_id - a string like 'discount_added' or 'payment_deleted'\r\n$capability - The cap to check when verifying we should display this;\r\n```\r\n\r\nIt could look something like:\r\n```\r\nfunction edd_show_admin_message( $message_id = false, $capability = false) {\r\n\r\n    if ( ! isset( $_GET['edd-message'] ) {\r\n        return false;\r\n    }\r\n\r\n    if ( $message_id !== $_GET['edd-message'] ) {\r\n        return false;\r\n    }\r\n\r\n    if ( ! current_user_can( $capability ) ) {\r\n        return false;\r\n    }\r\n\r\n    return true;\r\n\r\n}\r\n```"}}